# NOT RUN {
# initialize the model using the houses dataset
model <- new(
"diseq_deterministic_adjustment", # model type
c("ID", "TREND"), "TREND", "HS", "RM", # keys, time, quantity, and price variables
"RM + TREND + W + CSHS + L1RM + L2RM + MONTH", # demand specification
"RM + TREND + W + L1RM + MA6DSF + MA3DHF + MONTH", # supply specification
fair_houses(), # data
correlated_shocks = FALSE # allow shocks to be correlated
)
# estimate the model object (BFGS is used by default)
est <- estimate(model, control = list(maxit = 1e+5))
# get the mean marginal effect of variable "RM" on the shortage probabilities
shortage_probability_marginal(model, est@coef, "RM")
# get the marginal effect at the mean of variable "RM" on the shortage probabilities
shortage_probability_marginal(model, est@coef, "CSHS", aggregate = "at_the_mean")
# get the marginal effect of variable "RM" on the system
shortage_marginal(model, est@coef, "RM")
# }
Run the code above in your browser using DataLab