Description Usage Arguments Value Author(s) References See Also Examples
Simulates multiple AR(2) time series.
1 | r.cond.ar2(N,nj,r.phi1,r.phi2,r.sig2)
|
N |
Length of the series |
nj |
Number of series generated. |
r.phi1 |
Range of first AR order coefficient. It is a vector contains minimum and maximum possible coefficients. |
r.phi2 |
Range of second AR order coefficient. It is a vector contains minimum and maximum possible coefficients. |
r.sig2 |
Range of conditional innovation variances. It is a vector contains minimum and maximum possible variances. |
a list with 2 elements
X |
N by nj matrix of time series |
cep |
3 by nj matrix of parameters (phi1, phi2, sig2) |
Robert Krafty <rkrafty@pitt.edu>
Krafty, RT (2016) Discriminant Analysis of Time Series in the Presence of Within-Group Spectral Variability. Journal of Time series analysis
1 2 3 4 5 6 7 8 | ## Simulate data
nj = 50 #number of series in training data
N = 500 #length of time series
data1 <- r.cond.ar2(N=N,nj=nj,r.phi1=c(.01,.7),r.phi2=c(-.12,-.06),r.sig2=c(.3,3))
data2 <- r.cond.ar2(N=N,nj=nj,r.phi1=c(.5,1.2),r.phi2=c(-.36,-.25),r.sig2=c(.3,3))
data3 <- r.cond.ar2(N=N,nj=nj,r.phi1=c(.9,1.5),r.phi2=c(-.56,-.75),r.sig2=c(.3,3))
data <- cbind(data1$X,data2$X,data3$X)
y <- c(rep(1,nj),rep(2,nj),rep(3,nj))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.