R/2.8.generateARMA11SigmaThetaExprList.R

Defines functions generateARMA11SigmaThetaExprList

generateARMA11SigmaThetaExprList <- function(fit) {
  wavesCombination <- expand.grid(t = seq(fit$info$T), tlinha = seq(fit$info$T))

  sigmaThetaExpr <- mapply(function(t, tlinha) {
    if (abs(t - tlinha) - 1 < 0) {
      parse(text = paste0("sigma2u + sigma2v"))
    } else {
      parse(text = paste0("sigma2u + gamma * phi^", abs(t - tlinha) - 1, "* sigma2v"))
    }
  }, wavesCombination$t, wavesCombination$tlinha, SIMPLIFY = FALSE)

  sigmaThetaExprList <- list(
    expr = sigmaThetaExpr,
    paramsNames = c("sigma2u", "sigma2v", "gamma", "phi")
  )

  return(sigmaThetaExprList)
}

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.