Package: markets 1.1.5

Pantelis Karapanagiotis

markets: Estimation Methods for Markets in Equilibrium and Disequilibrium

Provides estimation methods for markets in equilibrium and disequilibrium. Supports the estimation of an equilibrium and four disequilibrium models with both correlated and independent shocks. Also provides post-estimation analysis tools, such as aggregation, marginal effect, and shortage calculations. See Karapanagiotis (2024) <doi:10.18637/jss.v108.i02> for an overview of the functionality and examples. The estimation methods are based on full information maximum likelihood techniques given in Maddala and Nelson (1974) <doi:10.2307/1914215>. They are implemented using the analytic derivative expressions calculated in Karapanagiotis (2020) <doi:10.2139/ssrn.3525622>. Standard errors can be estimated by adjusting for heteroscedasticity or clustering. The equilibrium estimation constitutes a case of a system of linear, simultaneous equations. Instead, the disequilibrium models replace the market-clearing condition with a non-linear, short-side rule and allow for different specifications of price dynamics.

Authors:Pantelis Karapanagiotis [aut, cre]

markets_1.1.5.tar.gz
markets_1.1.5.tar.gz(r-4.5-noble)markets_1.1.5.tar.gz(r-4.4-noble)
markets_1.1.5.tgz(r-4.4-emscripten)markets_1.1.5.tgz(r-4.3-emscripten)
markets.pdf |markets.html
markets/json (API)
NEWS

# Install 'markets' in R:
install.packages('markets', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/pi-kappa-devel/markets/issues

Pkgdown site:https://markets.pikappa.eu

Uses libs:
  • gsl– GNU Scientific Library (GSL)
  • onetbb– Parallelism library for C++
  • c++– GNU Standard C++ Library v3
Datasets:
  • houses - Credit market data for US housing starts

gslonetbbcpp

3.30 score 9 scripts 178 downloads 40 exports 21 dependencies

Last updated 11 months agofrom:5449ae155e. Checks:OK: 2. Indexed: no.

TargetResultDate
Doc / VignettesOKDec 25 2024
R-4.5-linux-x86_64OKDec 25 2024

Exports:aggregate_demandaggregate_supplycoefcoefficientsdemand_descriptivesdemanded_quantitiesdescribediseq_basicdiseq_deterministic_adjustmentdiseq_directionaldiseq_stochastic_adjustmentequilibrium_modelestimatefair_housesformulagradienthessianlog_likelihoodlogLikmarket_typenamencoefnobsnormalized_shortagesplotrelative_shortagesscoresshortage_indicatorsshortage_marginalshortage_probabilitiesshortage_probability_marginalshortage_standard_deviationshortagesshowsimulate_datasimulate_modelsummarysupplied_quantitiessupply_descriptivesvcov

Dependencies:clidplyrfansiFormulagenericsgluelifecyclemagrittrMASSpillarpkgconfigR6RcppRcppGSLRcppParallelrlangtibbletidyselectutf8vctrswithr

An example of market-clearing assessment

Rendered frommarket_clearing_assessment.Rmdusingknitr::rmarkdownon Dec 25 2024.

Last update: 2024-02-18
Started: 2022-05-18

Model initialization and estimation details

Rendered frommodel_details.Rmdusingknitr::rmarkdownon Dec 25 2024.

Last update: 2024-02-18
Started: 2022-05-18

Some examples of use-cases using the market models of the package

Rendered frombasic_usage.Rmdusingknitr::rmarkdownon Dec 25 2024.

Last update: 2024-02-18
Started: 2022-05-18

The R Package markets: Estimation Methods for Markets in Equilibrium and Disequilibrium

Rendered frompackage.Rmdusingknitr::rmarkdownon Dec 25 2024.

Last update: 2024-02-18
Started: 2022-05-18

Readme and manuals

Help Manual

Help pageTopics
Market fit coefficientscoef coef,market_fit-method coefficients,market_fit-method
Model estimationestimate estimate,equilibrium_model-method estimate,market_model-method
Market model formulaformula,market_model-method market_model_formula
Credit market data for US housing startsfair_houses houses
Log likelihood of a fitted market modellogLik,market_fit-method logLik.market_fit
Marginal effectsmarginal_effects shortage_marginal shortage_marginal,market_fit,ANY,missing,missing-method shortage_marginal,missing,ANY,market_model,ANY-method shortage_probability_marginal shortage_probability_marginal,market_fit,ANY,ANY,missing,missing-method shortage_probability_marginal,missing,ANY,ANY,market_model,ANY-method
Market side aggregationaggregate_demand aggregate_demand,market_fit,missing,missing-method aggregate_demand,missing,market_model,ANY-method aggregate_supply aggregate_supply,market_fit,missing,missing-method aggregate_supply,missing,market_model,ANY-method market_aggregation
Market force data descriptive statisticsdemand_descriptives demand_descriptives,market_model-method market_descriptives supply_descriptives supply_descriptives,market_model-method
Market model fitmarket_fit-class
Market model classesdisequilibrium_model-class diseq_basic-class diseq_deterministic_adjustment-class diseq_directional-class diseq_stochastic_adjustment-class equilibrium_model-class market_models
Estimated market quantitiesdemanded_quantities demanded_quantities,market_fit,missing,missing-method demanded_quantities,missing,market_model,ANY-method market_quantities supplied_quantities supplied_quantities,market_fit,missing,missing-method supplied_quantities,missing,market_model,ANY-method
Market model simulationmarket_simulation simulate_data simulate_data,ANY-method simulate_model simulate_model,ANY-method
Short model and market descriptionsdescribe describe,market_fit-method describe,market_model-method market_type market_type,market_fit-method market_type,market_model-method model_description name name,market_fit-method name,market_model-method
Model initializationinitialize,diseq_basic-method initialize,diseq_deterministic_adjustment-method initialize,diseq_directional-method initialize,diseq_stochastic_adjustment-method initialize,equilibrium_model-method model_initialization
Model likelihoods and derivativesgradient gradient,diseq_basic-method gradient,diseq_deterministic_adjustment-method gradient,diseq_directional-method gradient,diseq_stochastic_adjustment-method gradient,equilibrium_model-method hessian hessian,diseq_basic-method hessian,diseq_directional-method log_likelihood log_likelihood,diseq_basic-method log_likelihood,diseq_deterministic_adjustment-method log_likelihood,diseq_directional-method log_likelihood,diseq_stochastic_adjustment-method log_likelihood,equilibrium_model-method model_likelihoods scores scores,diseq_basic,ANY,ANY-method scores,diseq_deterministic_adjustment,ANY,ANY-method scores,diseq_directional,ANY,ANY-method scores,diseq_stochastic_adjustment,ANY,ANY-method scores,equilibrium_model,ANY,ANY-method scores,missing,missing,market_fit-method
Number of coefficientsncoef ncoef,market_fit-method ncoef,market_model-method
Number of observationsnobs,market_fit-method nobs,market_model-method
Plots the fitted modelplot,market_fit-method
Analysis of shortagesnormalized_shortages normalized_shortages,market_fit,missing,missing-method normalized_shortages,missing,market_model,ANY-method relative_shortages relative_shortages,market_fit,missing,missing-method relative_shortages,missing,market_model,ANY-method shortages shortages,market_fit,missing,missing-method shortages,missing,market_model,ANY-method shortage_analysis shortage_indicators shortage_indicators,market_fit,missing,missing-method shortage_indicators,missing,market_model,ANY-method shortage_probabilities shortage_probabilities,market_fit,missing,missing-method shortage_probabilities,missing,market_model,ANY-method shortage_standard_deviation shortage_standard_deviation,market_fit,missing,missing-method shortage_standard_deviation,missing,diseq_stochastic_adjustment,ANY-method shortage_standard_deviation,missing,market_model,ANY-method
Prints a short description of the modelshow,market_fit-method show,market_model-method
Single call estimationdiseq_basic diseq_basic,formula-method diseq_deterministic_adjustment diseq_deterministic_adjustment,formula-method diseq_directional diseq_directional,formula-method diseq_stochastic_adjustment diseq_stochastic_adjustment,formula-method equilibrium_model equilibrium_model,formula-method single_call_estimation
Model and fit summariessummary summary,market_fit-method summary,market_model-method
Variance-covariance matrix for a fitted market modelvcov,market_fit-method