Learn R Programming

diseq (version 0.4.6)

shortage_analysis: Analysis of shortages

Description

Analysis of shortages

Usage

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,market_model,ANY shortages(model, parameters)

# S4 method for missing,market_model,ANY normalized_shortages(model, parameters)

# S4 method for missing,market_model,ANY relative_shortages(model, parameters)

# S4 method for missing,market_model,ANY shortage_probabilities(model, parameters)

# S4 method for missing,market_model,ANY shortage_indicators(model, parameters)

# S4 method for missing,market_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)

Arguments

fit

A fitted model object.

model

A market model object.

parameters

A vector of parameters at which the shortages are evaluated.

Value

A vector with the (estimated) 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 of the market models. The methods can be called either using directly a fitted model object, or by separately providing a model object and a parameter vector.

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 state, 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 {
# 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)))

# get estimated normalized shortages
head(normalized_shortages(fit))

# get estimated relative shortages
head(relative_shortages(fit))

# get the estimated shortage probabilities
head(shortage_probabilities(fit))

# get the estimated shortage indicators
head(shortage_indicators(fit))

# get the estimated shortages
head(shortages(fit))

# get the estimated shortage variance
shortage_standard_deviation(fit)
# }

Run the code above in your browser using DataLab