spec_regress | R Documentation |
Estimates replicate-specific cepstral coefficients and corresponding smoothed log-spectra using a Whittle likelihood approximation.
spec_regress(perd, psi, Wmat, k0)
perd |
An N x K matrix of periodogram. |
psi |
A matrix of cepstral basis functions of dimension |
Wmat |
The inverse Gram matrix of the basis functions. |
k0 |
Number of cepstral basis function |
A list with:
f
An N × k0
matrix of estimated cepstral coefficients.
ff
An N × K
matrix of smoothed log-spectra.
set.seed(123)
N <- 5
len <- 20
L <- floor(len/2) - 1
frq <- (1:L) / len
Y <- matrix(rnorm(len * N), nrow = len, ncol = N)
perd <- perd_get(Y)
k0 <- 3
psi <- psi_get(k0, frq)
Wmatin <- matrix(0, k0, k0)
for (j in 1:ncol(psi)) {
Wmatin <- Wmatin + psi[, j] %*% t(psi[, j])
}
Wmat <- solve(Wmatin)
out <- spec_regress(perd, psi, Wmat, k0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.