Lopt.get: Optimal Choice of L

Description Usage Arguments Value Author(s) References See Also Examples

Description

Data driven selection of the number of cepstral coefficients (L) via leave-one-out cross-validation.

Usage

1
Lopt.get(data,mcep)

Arguments

data

Data frame containing cepstral coefficients and group information. Obtained from cep.get or cep.lda.

mcep

Maximum number of cepstral coefficient considerd. Default is set to 10

Value

Lopt

Optimal number of cepstral coefficients

Author(s)

Robert Krafty rkrafty@pitt.edu

References

Krafty, RT (2016) Discriminant Analysis of Time Series in the Presence of Within-Group Spectral Variability. Journal of Time series analysis

See Also

cep.lda, cep.get

Examples

 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)

CepLDA documentation built on May 1, 2019, 6:50 p.m.

Related to Lopt.get in CepLDA...