R/CES_mA.R

Defines functions CES_mA

Documented in CES_mA

#' @export
CES_mA <- function(sigma, alpha, Beta, p, Theta = NULL) {
  # computing CES demand structure matrix in a monetary economy
  nonnegative_Beta <- Beta
  nonnegative_Beta[Beta < 0] <- 0
  tmpA <- A <- CES_A(sigma, alpha, nonnegative_Beta, p, Theta)

  Indx <- which(Beta < 0, arr.ind = T)
  for (k in 1:nrow(Indx)) {
    A[Indx[k, 1], Indx[k, 2]] <- t(p) %*% tmpA[, Indx[k, 2]] / (-Beta[Indx[k, 1], Indx[k, 2]])
  }
  A
}

Try the CGE package in your browser

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

CGE documentation built on July 8, 2020, 5:16 p.m.