Learn R Programming

astsa (version 2.3)

ar.boot: Bootstrap Distribution of AR Model Parameters

Description

Performs a nonparametric bootstrap to obtain the distribution of the AR model parameters.

Usage

ar.boot(series, order.ar, nboot = 500, seed = NULL, plot = TRUE, ...)

Value

Returned invisibly as a list:

phi.star

[[1]] bootstrapped AR parameters

x.sim

[[2]] bootstrapped data

mean.star

[[3]] bootstrapped mean

var.star

[[4]] bootstrapped noise variance

yw.fit

[[5]] results of Yule-Walker fit to the data

Arguments

series

time series data (univariate only)

order.ar

autoregression order - must be specified

nboot

number of bootstrap iterations (default is 500)

seed

seed for the bootstrap sampling (defalut is NULL)

plot

if TRUE (default) and order.ar > 1, returns a scatterplot matrix of the bootstrapped parameters, - the diagonals show a histogram.

...

if plot=TRUE and order.ar > 1, graphical parameters sent to tspairs

Author

D.S. Stoffer

Details

For a specified series, finds the bootstrap distribution of the Yule-Walker estimates of \(\phi_1,\dots,\phi_p\) in the AR model specified by order.ar, $$x_t = \mu + \phi_1 (x_{t-1}-\mu) + \dots + \phi_p (x_{t-p}-\mu) + w_t ,$$ where \(w_t\) is white noise. The data are centered by the estimate of \(\mu\) prior to the bootstrap simulations.

The script displays a number of quantiles of the bootstrapped estimates, the means, the biases, and the root mean squared errors.

References

You can find demonstrations of astsa capabilities at FUN WITH ASTSA.

The most recent version of the package can be found at https://github.com/nickpoison/astsa/.

In addition, the News and ChangeLog files are at https://github.com/nickpoison/astsa/blob/master/NEWS.md.

The webpages for the texts and some help on using R for time series analysis can be found at https://nickpoison.github.io/.

Examples

Run this code
if (FALSE) {

u = ar.boot(rec, 2)
dev.new()
tspairs(u[[1]], hist=FALSE)   # another view of results
head(u[[1]])       # some booted AR parameters
head(u[[2]][,1:5]) # some booted data
}

Run the code above in your browser using DataLab