qar.sim | R Documentation |
Simulates a first-order quadratic AR model with normally distributed noise.
qar.sim(const = 0, phi0 = 0, phi1 = 0.5, sigma = 1, n = 20, init = 0)
const |
intercept |
phi0 |
coefficient of the lag 1 |
phi1 |
coefficient of the squared lag 1 |
sigma |
noise standard deviation |
n |
sample size |
init |
number of burn-in values |
The quadratic AR(1) model specifies that
Y_t = \mathrm{const}+φ_0 Y_{t-1}+φ_1 Y^2_{t-1}+e_t
where e_t are iid normally distributed with zero mean and standard deviation σ. If σ=0, the model is deterministic.
A simulated series from the quadratic AR(1) model, as a vector
Kung-Sik Chan
tar.sim
set.seed(1234567) plot(y=qar.sim(n=15,phi1=.5,sigma=1),x=1:15,type='l',ylab=expression(Y[t]),xlab='t') y=qar.sim(n=100,const=0.0,phi0=3.97, phi1=-3.97,sigma=0,init=.377) plot(y,x=1:100,type='l',ylab=expression(Y[t]),xlab='t') acf(y,main='')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.