R/1.4.fitModelWithSigmaAutoregressive.R

Defines functions getSigmaAutoregressive

getSigmaAutoregressive <- function(modelComponents) {
  fit <- fitModelWithSigmaIdentity(modelComponents)
  rho <- rhoCalculation(fit)

  waveCombinations <- expand.grid(t = seq(fit$info$T), tlinha = seq(fit$info$T))

  sigmaCalc <- function(t, tlinha) rho^abs(t - tlinha)
  sigma <- matrix(mapply(sigmaCalc, waveCombinations$t, waveCombinations$tlinha), ncol = fit$info$T)

  attr(sigma, "type") <- "autoregressive"
  attr(sigma, "rho") <- rho

  return(sigma)
}

Try the Mmcsd package in your browser

Any scripts or data that you put into this service are public.

Mmcsd documentation built on March 31, 2023, 7:23 p.m.