Learn R Programming

diseq (version 0.3.1)

shortage_analysis: Analysis of shortages

Description

Analysis of shortages

Usage

shortages(object, parameters)

normalized_shortages(object, parameters)

relative_shortages(object, parameters)

shortage_probabilities(object, parameters)

shortage_indicators(object, parameters)

shortage_standard_deviation(object, parameters)

# S4 method for disequilibrium_model shortages(object, parameters)

# S4 method for disequilibrium_model normalized_shortages(object, parameters)

# S4 method for disequilibrium_model relative_shortages(object, parameters)

# S4 method for disequilibrium_model shortage_probabilities(object, parameters)

# S4 method for disequilibrium_model shortage_indicators(object, parameters)

# S4 method for disequilibrium_model shortage_standard_deviation(object, parameters)

# S4 method for diseq_stochastic_adjustment shortage_standard_deviation(object, parameters)

Arguments

object

A disequilibrium model object.

parameters

A vector of parameters at which the shortages are evaluated.

Value

A vector with the (modified) shortages.

Functions

  • shortages: Shortages.

  • normalized_shortages: Normalized shortages.

  • relative_shortages: Relative shortages.

  • shortage_probabilities: Shortage probabilities.

  • shortage_indicators: Shortage indicators.

  • shortage_standard_deviation: Shortage variance.

Details

The following methods offer functionality for analyzing estimated shortages in the disequilibrium models.

shortages

Returns the predicted shortages at a given point.

normalized_shortages

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

relative_shortages

Returns the shortages normalized by the supplied quantity at a given point.

shortage_probabilities

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

shortage_indicators

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.

shortage_standard_deviation

Returns the variance of excess demand.

Examples

Run this code
# 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 estimated normalized shortages
head(normalized_shortages(model, est@coef))

# get estimated relative shortages
head(relative_shortages(model, est@coef))

# get the estimated shortage probabilities
head(shortage_probabilities(model, est@coef))

# get the estimated shortage indicators
head(shortage_indicators(model, est@coef))

# get the estimated shortages
head(shortages(model, est@coef))

# get the estimated shortage variance
shortage_standard_deviation(model, est@coef)
# }

Run the code above in your browser using DataLab