R/2.3.2.2.evalDeriv2SigmaThetaExprList.R

Defines functions evalDeriv2SigmaThetaExprList

evalDeriv2SigmaThetaExprList <- function(derivativesExprList, sigmaThetaExprList, paramsList) {
  names(paramsList) <- sigmaThetaExprList$paramsNames

  derivativesList <- lapply(derivativesExprList, function(expr) eval(expr, paramsList))
  deriv2SigmaThetaCombined <- sapply(derivativesList, function(expr) attr(expr, "hessian"))
  deriv2SigmaThetaList <- split(deriv2SigmaThetaCombined, seq(nrow(deriv2SigmaThetaCombined)))

  deriv2SigmaThetaMatrixList <- lapply(deriv2SigmaThetaList, function(expr) {
    matrix(expr, ncol = sqrt(length(derivativesList)), nrow = sqrt(length(derivativesList)))
  })

  return(deriv2SigmaThetaMatrixList)
}

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.