All models are estimated using full information maximum likelihood. The equilibrium_model can also be estimated using two-stage least squares. The maximum likelihood estimation is based on mle2. If no starting values are provided, the function uses linear regression estimates as initializing values. The default optimization method is BFGS. For other alternatives see mle2. The implementation of the two-stage least square estimation of the equilibrium_model is based on systemfit.

estimate(object, ...)

# S4 method for market_model
estimate(
  object,
  gradient = "calculated",
  hessian = "calculated",
  standard_errors = "homoscedastic",
  ...
)

# S4 method for equilibrium_model
estimate(object, method = "BFGS", ...)

Arguments

object

A model object.

...

Named parameter used in the model's estimation. These are passed further down to the estimation call. For the equilibrium_model model, the parameters are passed to systemfit, if the method is set to 2SLS, or to mle2 for any other method. For the rest of the models, the parameters are passed to mle2.

gradient

One of two potential options: `numerical` and `calculated`. By default, all the models are estimated using the analytic expressions of their likelihoods' gradients.

hessian

One of three potential options: `skip`, `numerical`, and `calculated`. The default is to use the `calculated` Hessian for the model that expressions are available and the `numerical` Hessian in other cases. Calculated Hessian expressions are available for the basic and directional models.

standard_errors

One of three potential options: `homoscedastic`, `heteroscedastic`, or a vector with variables names for which standard error clusters are to be created. The default value is `homoscedastic`. If the option `heteroscedastic` is passed, the variance-covariance matrix is calculated using heteroscedasticity adjusted (Huber-White) standard errors. If the vector is supplied, the variance-covariance matrix is calculated by grouping the score matrix based on the passed variables.

method

A string specifying the estimation method. When the passed value is among Nelder-Mead, BFGS, CG, L-BFGS-B, SANN, and Brent, the model is estimated using full information maximum likelihood based on mle2 functionality. When 2SLS is supplied, the model is estimated using two-stage least squares based on systemfit. In this case, the function returns a list containing the first and second stage estimates. The default value is BFGS.

Value

The object that holds the estimation result.

Functions

  • estimate,market_model-method: Full information maximum likelihood estimation.

  • estimate,equilibrium_model-method: Equilibrium model estimation.

Examples

# \donttest{ # 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)
#> Warning: convergence failure: code=1 (iteration limit 'maxit' reached)
# estimate the model by specifying the optimization details passed to the optimizer. est <- estimate(model, control = list(maxit = 1e+5), method = "BFGS") # summarize results bbmle::summary(est)
#> Maximum likelihood estimation #> #> Call: #> `bbmle::mle2`(list(control = list(maxit = 1e+05), method = "BFGS", #> start = c(D_RM = 0.0752819286439172, D_CONST = 74.6246015358951, #> D_TREND = 2.43181710042671, D_W = 2.39460250783347, D_CSHS = -0.0197679435608613, #> D_L1RM = 0.151248309821384, D_L2RM = -0.329088798453382, #> D_MONTH02 = 2.91785077957093, D_MONTH03 = 31.1042156616695, #> D_MONTH04 = 61.7294667247108, D_MONTH05 = 64.5246055151511, #> D_MONTH06 = 58.1865288839705, D_MONTH07 = 48.512086331174, #> D_MONTH08 = 47.4432951734493, D_MONTH09 = 42.1857136349017, #> D_MONTH10 = 45.6593695528453, D_MONTH11 = 28.845005948434, #> D_MONTH12 = 8.54788280845906, S_RM = 0.146484905699752, S_CONST = -50.757284660709, #> S_TREND = -0.124335187422979, S_W = 2.6693644141635, S_L1RM = -0.0888914832638965, #> S_MA6DSF = 0.0475382495196656, S_MA3DHF = 0.0455438436601716, #> S_MONTH02 = 3.37105763813256, S_MONTH03 = 32.5416664516372, #> S_MONTH04 = 65.9767050358237, S_MONTH05 = 66.5982300961035, #> S_MONTH06 = 56.0546087559882, S_MONTH07 = 41.7537533647093, #> S_MONTH08 = 47.1942181862088, S_MONTH09 = 41.7223385329141, #> S_MONTH10 = 48.924705170108, S_MONTH11 = 30.2619588774318, #> S_MONTH12 = 10.9350688568349, RM_DIFF = 1, D_VARIANCE = 1, #> S_VARIANCE = 1), minuslogl = function (...) #> minus_log_likelihood(object, ...), gr = function (...) #> gradient(object, ...))) #> #> Coefficients: #> Estimate Std. Error z value Pr(z) #> D_RM -4.5421833 0.6482610 -7.0067 2.440e-12 *** #> D_CONST 13.6043640 0.0403736 336.9619 < 2.2e-16 *** #> D_TREND -2.6245410 0.1505872 -17.4287 < 2.2e-16 *** #> D_W 2.5179980 1.2489517 2.0161 0.0437907 * #> D_CSHS 0.0244387 0.0017227 14.1865 < 2.2e-16 *** #> D_L1RM 6.2722420 0.9083797 6.9049 5.025e-12 *** #> D_L2RM -1.6968761 0.5154789 -3.2918 0.0009953 *** #> D_MONTH02 -10.9052541 0.0197558 -552.0034 < 2.2e-16 *** #> D_MONTH03 15.6940320 0.0227848 688.7928 < 2.2e-16 *** #> D_MONTH04 55.9541211 0.0168820 3314.4264 < 2.2e-16 *** #> D_MONTH05 61.1903194 0.0090759 6742.0315 < 2.2e-16 *** #> D_MONTH06 57.1590508 0.0058460 9777.4941 < 2.2e-16 *** #> D_MONTH07 62.8244019 0.0226392 2775.0295 < 2.2e-16 *** #> D_MONTH08 33.2241734 0.0457239 726.6252 < 2.2e-16 *** #> D_MONTH09 30.7249237 0.0097796 3141.7473 < 2.2e-16 *** #> D_MONTH10 42.3310863 0.0174846 2421.0493 < 2.2e-16 *** #> D_MONTH11 8.4521170 0.0143606 588.5642 < 2.2e-16 *** #> D_MONTH12 0.9478415 0.0283021 33.4902 < 2.2e-16 *** #> S_RM 0.6201371 0.2127543 2.9148 0.0035591 ** #> S_CONST -63.6607197 0.0149546 -4256.9262 < 2.2e-16 *** #> S_TREND -0.1705939 0.0384347 -4.4385 9.057e-06 *** #> S_W 2.9239541 0.5644298 5.1804 2.214e-07 *** #> S_L1RM -0.5448843 0.2167567 -2.5138 0.0119436 * #> S_MA6DSF 0.0494107 0.0040247 12.2768 < 2.2e-16 *** #> S_MA3DHF 0.0342611 0.0062900 5.4469 5.126e-08 *** #> S_MONTH02 3.2045328 0.0284327 112.7059 < 2.2e-16 *** #> S_MONTH03 32.4315018 0.0319135 1016.2305 < 2.2e-16 *** #> S_MONTH04 63.6170356 0.0344652 1845.8331 < 2.2e-16 *** #> S_MONTH05 65.4349712 0.0056722 11536.0946 < 2.2e-16 *** #> S_MONTH06 54.6745344 0.0073384 7450.5009 < 2.2e-16 *** #> S_MONTH07 40.2519085 0.0670845 600.0178 < 2.2e-16 *** #> S_MONTH08 45.8114812 0.0252137 1816.9298 < 2.2e-16 *** #> S_MONTH09 43.1528054 0.0313691 1375.6451 < 2.2e-16 *** #> S_MONTH10 46.1080783 0.0337658 1365.5249 < 2.2e-16 *** #> S_MONTH11 31.2357840 0.0083585 3737.0279 < 2.2e-16 *** #> S_MONTH12 8.9945434 0.0636202 141.3788 < 2.2e-16 *** #> RM_DIFF 1.6103141 0.6149296 2.6187 0.0088266 ** #> D_VARIANCE 810.0374812 0.0073430 110314.3873 < 2.2e-16 *** #> S_VARIANCE 110.5647297 0.0076077 14533.2478 < 2.2e-16 *** #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> -2 log L: 1724.56
# }