Sim.Ar | R Documentation |
Simulate an AR(2) process with parameters M, and eta.
Sim.Ar(Time, eta, M, Fs=1, m_burn = 100)
Time |
Length of output series. A strictly positive integer. |
eta |
Peak frequency of the spectrum. eta must be less or equal than Fs/2. |
M |
Modulus of the roots of phi(z), where $z_0^1=Conj(z_0^2)$. M must be bigger than 1. |
Fs |
Sampling frequency (Hz). Default value is 1. |
m_burn |
Length of ‘burn-in’ period. |
In time series methods there exist some parametric models such as the autoregressive process of order $p$ (AR($p$)) that have a closed form for the spectral density. In particular the AR(2) model can be parametrized as a function of the norm of the root of its characteristic polynomial (M) and the peak frequency of the spectrum (eta). These parameters will determine the shape of the spectral density (peak and sparseness).
A vector of length Time from an AR(2) model.
#Sim.Ar
eta<-2;M<-1.01;Fs<-10
Xt<-Sim.Ar(1000,eta,M,Fs)
fest<-spec.parzen(Xt,a=100,dt=1/Fs)
plot(seq(.1,100,.1),Xt,type="l",main="AR(2) Process",xlab="Time (sec)",ylab="")
plot(fest,type="l",lwd=2,main="Smoothed Periodogram",xlab="w (Hz)",ylab="")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.