Learn R Programming

CepReg (version 0.1.3)

spec_regress: Fisher Scoring Algorithm For Estimating Cepstral Coefficients

Description

Estimates replicate-specific cepstral coefficients and corresponding smoothed log-spectra using a Whittle likelihood approximation.

Usage

spec_regress(perd, psi, Wmat, k0)

Value

A list with:

f

An N × k0 matrix of estimated cepstral coefficients.

ff

An N × K matrix of smoothed log-spectra.

Arguments

perd

An N x K matrix of periodogram.

psi

A matrix of cepstral basis functions of dimension k0 × K.

Wmat

The inverse Gram matrix of the basis functions.

k0

Number of cepstral basis function

Examples

Run this code
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)

Run the code above in your browser using DataLab