R/cTMed-delta-beta-dot.R

Defines functions .DeltaBeta

.DeltaBeta <- function(delta_t,
                       phi,
                       vcov_phi_vec) {
  constructor <- function(delta_t) {
    return(
      function(x) {
        return(
          .TotalVec(
            phi_vec = x,
            delta_t = delta_t
          )
        )
      }
    )
  }
  func <- constructor(
    delta_t = delta_t
  )
  dim(phi) <- NULL
  jacobian <- numDeriv::jacobian(
    func = func,
    x = phi
  )
  return(
    list(
      delta_t = delta_t,
      jacobian = jacobian,
      est = func(x = phi),
      vcov = jacobian %*% vcov_phi_vec %*% t(jacobian)
    )
  )
}

Try the cTMed package in your browser

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

cTMed documentation built on Oct. 21, 2024, 5:08 p.m.