`R/disequilibrium_model.R`

, `R/diseq_stochastic_adjustment.R`

, `R/market_fit.R`

`shortage_analysis.Rd`

Analysis of shortages

```
shortages(fit, model, parameters)
normalized_shortages(fit, model, parameters)
relative_shortages(fit, model, parameters)
shortage_probabilities(fit, model, parameters)
shortage_indicators(fit, model, parameters)
shortage_standard_deviation(fit, model, parameters)
# S4 method for missing,disequilibrium_model,ANY
shortages(model, parameters)
# S4 method for missing,disequilibrium_model,ANY
normalized_shortages(model, parameters)
# S4 method for missing,disequilibrium_model,ANY
relative_shortages(model, parameters)
# S4 method for missing,disequilibrium_model,ANY
shortage_probabilities(model, parameters)
# S4 method for missing,disequilibrium_model,ANY
shortage_indicators(model, parameters)
# S4 method for missing,disequilibrium_model,ANY
shortage_standard_deviation(model, parameters)
# S4 method for missing,diseq_stochastic_adjustment,ANY
shortage_standard_deviation(model, parameters)
# S4 method for market_fit,missing,missing
shortages(fit)
# S4 method for market_fit,missing,missing
normalized_shortages(fit)
# S4 method for market_fit,missing,missing
relative_shortages(fit)
# S4 method for market_fit,missing,missing
shortage_probabilities(fit)
# S4 method for market_fit,missing,missing
shortage_indicators(fit)
# S4 method for market_fit,missing,missing
shortage_standard_deviation(fit)
```

- fit
A fitted model object.

- model
A disequilibrium model object.

- parameters
A vector of parameters at which the shortages are evaluated.

A vector with the (estimated) shortages.

The following methods offer functionality for analyzing estimated shortages in the disequilibrium models. The methods can be called either using directly a fitted model object, or by separately providing a model object and a parameter vector.

Returns the shortages normalized by the variance of the difference of the shocks at a given point.

Returns the shortage probabilities, i.e. the probabilities of an observation coming from an excess demand state, at the given point.

Returns a vector of indicators (Boolean values) for each observation. An element of the vector is TRUE for observations at which the estimated shortages are non-negative, i.e. the market at in an excess demand state. The remaining elements are FALSE. The evaluation of the shortages is performed using the passed parameter vector.

`shortages`

: Shortages.`normalized_shortages`

: Normalized shortages.`relative_shortages`

: Relative shortages.`shortage_probabilities`

: Shortage probabilities.`shortage_indicators`

: Shortage indicators.`shortage_standard_deviation`

: Shortage variance.

```
# \donttest{
# estimate a model using the houses dataset
fit <- diseq_deterministic_adjustment(
HS | RM | ID | TREND ~
RM + TREND + W + CSHS + L1RM + L2RM + MONTH |
RM + TREND + W + L1RM + MA6DSF + MA3DHF + MONTH,
fair_houses(), correlated_shocks = FALSE,
estimation_options = list(control = list(maxit = 1e+5)))
#> Warning: Using formula(x) is deprecated when x is a character vector of length > 1.
#> Consider formula(paste(x, collapse = " ")) instead.
#> Warning: Using formula(x) is deprecated when x is a character vector of length > 1.
#> Consider formula(paste(x, collapse = " ")) instead.
# get estimated normalized shortages
head(normalized_shortages(fit))
#> normalized_shortages
#> 1 -0.2725824
#> 2 0.2392505
#> 3 0.1104494
#> 4 -1.7675573
#> 5 0.7434607
#> 6 -0.2920426
# get estimated relative shortages
head(relative_shortages(fit))
#> relative_shortages
#> 1 -0.05966599
#> 2 0.05272308
#> 3 0.02515503
#> 4 -0.40363575
#> 5 0.18520902
#> 6 -0.07403025
# get the estimated shortage probabilities
head(shortage_probabilities(fit))
#> shortage_probabilities
#> 1 0.39258710
#> 2 0.59454434
#> 3 0.54397352
#> 4 0.03856747
#> 5 0.77139859
#> 6 0.38512702
# get the estimated shortage indicators
head(shortage_indicators(fit))
#> shortage_indicators
#> 1 FALSE
#> 2 TRUE
#> 3 TRUE
#> 4 FALSE
#> 5 TRUE
#> 6 FALSE
# get the estimated shortages
head(shortages(fit))
#> shortages
#> 1 -8.275923
#> 2 7.263927
#> 3 3.353374
#> 4 -53.665114
#> 5 22.572339
#> 6 -8.866757
# get the estimated shortage variance
shortage_standard_deviation(fit)
#> shortage_standard_deviation
#> 30.36117
# }
```