Description Usage Arguments Value Author(s) References See Also Examples
Data driven selection of the number of cepstral coefficients (L) via leave-one-out cross-validation.
1 |
data |
Data frame containing cepstral coefficients and group information. Obtained from |
mcep |
Maximum number of cepstral coefficient considerd. Default is set to 10 |
Lopt |
Optimal number of cepstral coefficients |
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 9 10 11 12 | ## Simulate data
ntrain = 50 #number of series in training data
Nlength = 500 #length of each series
set.seed(2016)
traindata1 <- r.cond.ar2(N=Nlength,nj=ntrain,r.phi1=c(.01,.7),r.phi2=c(-.12,-.06),r.sig2=c(.3,3))
traindata2 <- r.cond.ar2(N=Nlength,nj=ntrain,r.phi1=c(.5,1.2),r.phi2=c(-.36,-.25),r.sig2=c(.3,3))
traindata3 <- r.cond.ar2(N=Nlength,nj=ntrain,r.phi1=c(.9,1.5),r.phi2=c(-.56,-.75),r.sig2=c(.3,3))
train <- cbind(traindata1$X,traindata2$X,traindata3$X)
## group information
y <- c(rep(1,ntrain),rep(2,ntrain),rep(3,ntrain))
dat <- cep.get(y,train)
Lopt.get(dat,10)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.