diff --git a/.buildinfo b/.buildinfo new file mode 100644 index 000000000..e8b69f354 --- /dev/null +++ b/.buildinfo @@ -0,0 +1,4 @@ +# Sphinx build info version 1 +# This file records the configuration used when building these files. When it is not found, a full rebuild will be done. +config: 822806cea4bc8a1f1e272b791c1d9964 +tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 000000000..e69de29bb diff --git a/CNAME b/CNAME new file mode 100644 index 000000000..cd2929e36 --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +docs.econ-ark.org \ No newline at end of file diff --git a/Documentation/CHANGELOG.html b/Documentation/CHANGELOG.html new file mode 100644 index 000000000..91858801e --- /dev/null +++ b/Documentation/CHANGELOG.html @@ -0,0 +1,1272 @@ + + + + + + + + + + + Release Notes — HARK latest documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+
+ + + + + + +
+ + +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ +
+

Release Notes#

+
+

Introduction#

+

This document contains the release notes of HARK. HARK aims to produce an open source repository of highly modular, easily interoperable code for solving, simulating, and estimating dynamic economic models with heterogeneous agents.

+

For more information on HARK, see our Github organization.

+
+
+

Changes#

+
+

0.16.0 (in development)#

+

Release Date: TBD

+
+
+

Major Changes#

+
    +
  • Adds a discretize method to DBlocks and RBlocks #1460

  • +
  • Allows structural equations in model files to be provided in string form #1427

  • +
  • Introduces `HARK.parser’ module for parsing configuration files into models #1427

  • +
  • Allows construction of shocks with arguments based on mathematical expressions #1464

  • +
  • YAML configuration file for the normalized consumption and portolio choice #1465

  • +
  • Reorganizes the HARK.distribution file into HARK.distributions submodule with various files for readability and extensibility #1496

  • +
+
+

Minor Changes#

+
    +
  • Fixes bug in AgentPopulation that caused discretization of distributions to not work. 1275

  • +
  • Adds support for distributions, booleans, and callables as parameters in the Parameters class. 1387

  • +
  • Removes a specific way of accounting for ``employment’’ in the idiosyncratic-shocks income process. 1473

  • +
  • Changes the behavior of make_lognormal_RiskyDstn so that the standard deviation represents the standard deviation of log(returns)

  • +
  • Adds detailed parameter and latex documentation to most models.

  • +
  • Add PermGroFac constructor that explicitly combines idiosyncratic and aggregate sources of growth. 1489

  • +
+
+
+
+

0.15.1#

+

Release Date: June 15, 2024

+

This minor release was produced prior to CEF 2024 to enable public usage of HARK with the SSJ toolkit.

+
+

Major Changes#

+

none

+
+
+

Minor Changes#

+
    +
  • Adds example of integration of HARK with SSJ toolkit. #1447

  • +
  • Maintains compatibility between EconForge interpolation and numba #1457

  • +
+
+
+
+

0.15.0#

+

Release Date: June 4, 2024

+

Note: Due to major changes on this release, you may need to adjust how AgentTypes are instantiated in your projects using HARK. If you are manually constructing “complicated” objects like MrkvArray, they should be assigned to your instances after initialization, not passed as part of the parameter dictionary. See also the new constructor methodology for how to pass parameters for such constructed inputs.

+

This release drops support for Python 3.8 and 3.9, consistent with SPEC 0, and adds support for Python 3.11 and 3.12. We expect that all HARK features still work with the older versions, but they are no longer part of our testing regimen.

+
+

Major Changes#

+
    +
  • Drop official support for Python 3.8 and 3.9, add support for 3.11 and 3.12. #1415

  • +
  • Replace object-oriented solvers with single function versions. #1394

  • +
  • Object-oriented solver code has been moved to /HARK/ConsumptionSaving/LegacyOOsolvers.py, for legacy support of downstream projects.

  • +
  • AgentTypeMonteCarloSimulator now requires model shock, parameter, and dynamics information to be organized into ‘blocks’. The DBlock object is introduced. #1411

  • +
  • RBlock object allows for recursive composition of DBlocks in models, as demonstrated by the AgentTypeMonteCarloSimulator #1417

  • +
  • Transtion, reward, state-rule value function, decision value function, and arrival value function added to DBlock #1417

  • +
  • All methods that construct inputs for solvers are now functions that are specified in the dictionary attribute constructors. #1410

  • +
  • Such constructed inputs can use alternate parameterizations / formats by changing the constructor function and providing its arguments in parameters.

  • +
  • Move HARK.datasets to HARK.Calibration for better organization of data and calibration tools. #1430

  • +
+
+
+

Minor Changes#

+
    +
  • Add option to pass pre-built grid to LinearFast. 1388

  • +
  • Moves calculation of stable points out of ConsIndShock solver, into method called by post_solve #1349

  • +
  • Adds cubic spline interpolation and value function construction to “warm glow bequest” models.

  • +
  • Fixes cubic spline interpolation for ConsMedShockModel.

  • +
  • Moves computation of “stable points” from inside of ConsIndShock solver to a post-solution method. #1349

  • +
  • Corrects calculation of “human wealth” under risky returns, providing correct limiting linear consumption function. #1403

  • +
  • Removed ‘parameters’ from new block definitions; these are now ‘calibrations’ provided separately.

  • +
  • Create functions for well-known and repeated calculations in single-function solvers. 1395

  • +
  • Re-work WealthPortfolioSolver to use approximate EGM method #1404

  • +
  • Default parameter dictionaries for AgentType subclasses have been “flattened”: all parameters appear in one place for each model, rather than inheriting from parent models’ dictionaries. The only exception is submodels within a file when only 1 or 2 parameters are added or changed. #1425

  • +
  • Fix minor bug in HARK.distributions.Bernoulli to allow conversion into DiscreteDistributionLabeled. #1432

  • +
+
+
+
+

0.14.1#

+

Release date: February 28, 2024

+
+

Major Changes#

+

none

+
+
+

Minor Changes#

+
    +
  • Fixes a bug in make_figs arising from the metadata argument being incompatible with jpg. #1386

  • +
  • Reverts behavior of the repr method of the Model class, so that long strings aren’t generated. Full description is available with describe(). #1390

  • +
+
+
+
+

0.14.0#

+

Release Date: February 12, 2024

+
+

Major Changes#

+
    +
  • Adds HARK.core.AgentPopulation class to represent a population of agents with ex-ante heterogeneous parametrizations as distributions. #1237

  • +
  • Adds HARK.core.Parameters class to represent a collection of time varying and time invariant parameters in a model. #1240

  • +
  • Adds HARK.simulation.monte_carlo module for generic Monte Carlo simulation functions using Python model configurations. 1296

  • +
+
+
+

Minor Changes#

+
    +
  • Adds option sim_common_Rrisky to control whether risky-asset models draw common or idiosyncratic returns in simulation. #1250,#1253

  • +
  • Addresses #1255. Makes age-varying stochastic returns possible and draws from their discretized version. #1262

  • +
  • Fixes bug in the metric that compares dictionaries with the same keys. #1260

  • +
+
+
+
+

0.13.0#

+

Release Date: February 16, 2023

+
+

Major Changes#

+
    +
  • Updates the DCEGM tools to address the flaws identified in issue #1062. PR: 1100.

  • +
  • Updates IndexDstn, introducing the option to use an existing RNG instead of creating a new one, and creating and storing all the conditional distributions at initialization. 1104

  • +
  • make_shock_history and read_shocks == True now store and use the random draws that determine newborn’s initial states #1101.

  • +
  • FrameModel and FrameSet classes introduced for more modular construction of framed models. FrameAgentType dedicated to simulation. #1117

  • +
  • General control transitions based on decision rules in FrameAgentType. #1117

  • +
  • Adds distr_of_function tool to calculate the distribution of a function of a discrete random variable. #1144

  • +
  • Changes the DiscreteDistribution class to allow for arbitrary array-valued random variables. #1146

  • +
  • Adds IndShockRiskyAssetConsumerType as agent which can invest savings all in safe asset, all in risky asset, a fixed share in risky asset, or optimize its portfolio. #1107

  • +
  • Updates all HARK models to allow for age-varying interest rates. #1150

  • +
  • Adds DiscreteDistribution.expected method which expects vectorized functions and is faster than HARK.distributions.calc_expectation. #1156

  • +
  • Adds DiscreteDistributionXRA class which extends DiscreteDistribution to allow for underlying data to be stored in a xarray.DataArray object. #1156

  • +
  • Adds keyword argument labels to expected() when using DiscreteDistributionXRA to allow for expressive functions that use labeled xarrays. #1156

  • +
  • Adds a wrapper for interpolation.py for fast multilinear interpolation. #1151

  • +
  • Adds support for the calculation of dreivatives in the interpolation.py wrappers. #1157

  • +
  • Adds class DecayInterp to econforgeinterp.py. It implements interpolators that “decay” to some limiting function when extrapolating. #1165

  • +
  • Add methods to non stochastically simulate an economy by computing transition matrices. Functions to compute transition matrices and ergodic distribution have been added #1155.

  • +
  • Fixes a bug that causes t_age and t_cycle to get out of sync when reading pre-computed mortality. #1181

  • +
  • Adds Methods to calculate Heterogenous Agent Jacobian matrices. #1185

  • +
  • Enhances combine_indep_dstns to work with labeled distributions (DiscreteDistributionLabeled). #1191

  • +
  • Updates the numpy random generator from RandomState to Generator. #1193

  • +
  • Turns the income and income+return distributions into DiscreteDistributionLabeled objects. #1189

  • +
  • Creates UtilityFuncCRRA which is an object oriented utility function with a coefficient of constant relative risk aversion and includes derivatives and inverses. Also creates UtilityFuncCobbDouglas, UtilityFuncCobbDouglasCRRA, and UtilityFuncConstElastSubs. #1168

  • +
  • Reorganizes HARK.distributions. All distributions now inherit all features from scipy.stats. New ContinuousFrozenDistribution and DiscreteFrozenDistribution to use scipy.stats distributions not yet implemented in HARK. New Distribution.discretize(N, method = "***") replaces Distribution.approx(N). New DiscreteDistribution.limit attribute describes continuous origin and discretization method. #1197.

  • +
  • Creates new class of labeled models under ConsLabeledModel that use xarray for more expressive modeling of underlying mathematical and economics variables. #1177

  • +
+
+
+

Minor Changes#

+
    +
  • Updates the lognormal-income-process constructor from ConsIndShockModel.py to use IndexDistribution. #1024, #1115

  • +
  • Allows for age-varying unemployment probabilities and replacement incomes with the lognormal income process constructor. #1112

  • +
  • Option to have newborn IndShockConsumerType agents with a transitory income shock in the first period. Default is false, meaning they only have a permanent income shock in period 1 and permanent AND transitory in the following ones. #1126

  • +
  • Adds benchmark utility to profile the performance of HARK solvers. #1131

  • +
  • Fixes scaling bug in Normal equiprobable approximation method. 1139

  • +
  • Removes the extra-dimension that was returned by calc_expectations in some instances. #1149

  • +
  • Adds HARK.distributions.expected alias for DiscreteDistribution.expected. #1156

  • +
  • Renames attributes in DiscreteDistribution: X to atoms and pmf to pmv. #1164, #1051, #1159.

  • +
  • Remove or replace automated tests that depend on brittle simulation results. #1148

  • +
  • Updates asset grid constructor from ConsIndShockModel.py to allow for linearly-spaced grids when aXtraNestFac == -1. #1172

  • +
  • Renames DiscreteDistributionXRA to DiscreteDistributionLabeled and updates methods #1170

  • +
  • Renames HARK.numba to HARK.numba_tools #1183

  • +
  • Adds the RNG seed as a property of DiscreteDistributionLabeled #1184

  • +
  • Updates the approx method of HARK.distributions.Uniform to include the endpoints of the distribution with infinitesimally small (zero) probability mass. #1180

  • +
  • Refactors tests to incorporate custom precision HARK_PRECISION = 4. #1193

  • +
  • Cast DiscreteDistribution.pmv attribute as a np.ndarray. #1199

  • +
  • Update structure of dynamic interest rate. #1221

  • +
+
+
+
+

0.12.0#

+

Release Date: December 14, 2021

+
+

Major Changes#

+
    +
  • FrameAgentType for modular definitions of agents #865 #1064

  • +
  • Frame relationships with backward and forward references, with plotting example #1071

  • +
  • PortfolioConsumerFrameType, a port of PortfolioConsumerType to use Frames #865

  • +
  • Input parameters for cyclical models now indexed by t #1039

  • +
  • A IndexDistribution class for representing time-indexed probability distributions #1018.

  • +
  • Adds new consumption-savings-portfolio model RiskyContrib, which represents an agent who can save in risky and risk-free assets but faces +frictions to moving funds between them. To circumvent these frictions, he has access to an income-deduction scheme to accumulate risky assets. +PR: #832. See this forthcoming REMARK for the model’s details.

  • +
  • ‘cycles’ agent property moved from constructor argument to parameter #1031

  • +
  • Uses iterated expectations to speed-up the solution of RiskyContrib when income and returns are independent #1058.

  • +
  • ConsPortfolioSolver class for solving portfolio choice model replaces solveConsPortfolio method #1047

  • +
  • ConsPortfolioDiscreteSolver class for solving portfolio choice model when allowed share is on a discrete grid #1047

  • +
  • ConsPortfolioJointDistSolver class for solving portfolio chioce model when the income and risky return shocks are not independent #1047

  • +
+
+
+

Minor Changes#

+
    +
  • Using Lognormal.from_mean_std in the forward simulation of the RiskyAsset model #1019

  • +
  • Fix bug in DCEGM’s primary kink finder due to numpy no longer accepting NaN in integer arrays #990.

  • +
  • Add a general class for consumers who can save using a risky asset #1012.

  • +
  • Add Boolean attribute ‘PerfMITShk’ to consumption models. When true, allows perfect foresight MIT shocks to be simulated. #1013.

  • +
  • Track and update start-of-period (pre-income) risky and risk-free assets as states in the RiskyContrib model 1046.

  • +
  • distribute_params now uses assign_params to create consistent output #1044

  • +
  • The function that computes end-of-period derivatives of the value function was moved to the inside of ConsRiskyContrib’s solver #1057

  • +
  • Use np.fill(np.nan) to clear or initialize the arrays that store simulations. #1068

  • +
  • Add Boolean attribute ‘neutral_measure’ to consumption models. When true, simulations are more precise by allowing permanent shocks to be drawn from a neutral measure (see Harmenberg 2021). #1069

  • +
  • Fix mathematical limits of model example in example_ConsPortfolioModel.ipynb #1047

  • +
  • Update ConsGenIncProcessModel.py to use calc_expectation method #1072

  • +
  • Fix bug in calc_normal_style_pars_from_lognormal_pars due to math error. #1076

  • +
  • Fix bug in distribute_params so that AgentCount parameter is updated. #1089

  • +
  • Fix bug in ‘vFuncBool’ option for ‘MarkovConsumerType’ so that the value function may now be calculated. #1095

  • +
+
+
+
+

0.11.0#

+

Release Date: March 4, 2021

+
+

Major Changes#

+
    +
  • Converts non-mathematical code to PEP8 compliant form #953

  • +
  • Adds a constructor for LogNormal distributions from mean and standard deviation #891

  • +
  • Uses new LogNormal constructor in ConsPortfolioModel #891

  • +
  • calcExpectations method for taking the expectation of a distribution over a function [#884](econ-ark/HARK#] (#897)[https://github.com/econ-ark/HARK/pull/897/)

  • +
  • Implements the multivariate normal as a supported distribution, with a discretization method. See #948.

  • +
  • Centralizes the definition of value, marginal value, and marginal marginal value functions that use inverse-space +interpolation for problems with CRRA utility. See #888.

  • +
  • MarkovProcess class used in ConsMarkovModel, ConsRepAgentModel, ConsAggShockModel #902 #929

  • +
  • replace HARKobject base class with MetricObject and Model classes #903

  • +
  • Add repr and eq methods to Model class #903

  • +
  • Adds SSA life tables and methods to extract survival probabilities from them #986.

  • +
  • Adds the U.S. CPI research series and tools to extract inflation adjustments from it #930.

  • +
  • Adds a module for extracting initial distributions of permanent income (pLvl) and normalized assets (aNrm) from the SCF #932.

  • +
  • Fix the return fields of dcegm/calcCrossPoints#909.

  • +
  • Corrects location of constructor documentation to class string for Sphinx rendering #908

  • +
  • Adds a module with tools for parsing and using various income calibrations from the literature. It includes the option of using life-cycle profiles of income shock variances from Sabelhaus and Song (2010). See #921, #941, #980.

  • +
  • remove “Now” from model variable names #936

  • +
  • remove Model.call; use Model init in Market and AgentType init to standardize on parameters dictionary #947

  • +
  • Moves state MrkvNow to shocks[‘Mrkv’] in AggShockMarkov and KrusellSmith models #935

  • +
  • Replaces ConsIndShock’s init_lifecycle with an actual life-cycle calibration #951.

  • +
+
+
+

Minor Changes#

+
    +
  • Move AgentType constructor parameters docs to class docstring so it is rendered by Sphinx.

  • +
  • Remove uses of deprecated time.clock #887

  • +
  • Change internal representation of parameters to Distributions to ndarray type

  • +
  • Rename IncomeDstn to IncShkDstn

  • +
  • AgentType simulate() method now returns history. #916

  • +
  • Rename DiscreteDistribution.drawDiscrete() to draw()

  • +
  • Update documentation and warnings around IncShkDstn #955

  • +
  • Adds csv files to MANIFEST.in. 957

  • +
+
+
+
+

0.10.8#

+

Release Date: Nov. 05 2020

+
+

Major Changes#

+
    +
  • Namespace variables for the Market class #765

  • +
  • We now have a Numba based implementation of PerfForesightConsumerType model available as PerfForesightConsumerTypeFast #774

  • +
  • Namespace for exogenous shocks #803

  • +
  • Namespace for controls #855

  • +
  • State and poststate attributes replaced with state_now and state_prev namespaces #836

  • +
+
+
+

Minor Changes#

+
    +
  • Use shock_history namespace for pre-evaluated shock history #812

  • +
  • Fixes seed of PrefShkDstn on initialization and add tests for simulation output

  • +
  • Reformat code style using black

  • +
+
+
+
+

0.10.7#

+

Release Date: 08-08-2020

+
+

Major Changes#

+
    +
  • Add a custom KrusellSmith Model #762

  • +
  • Simulations now uses a dictionary history to store state history instead of _hist attributes #674

  • +
  • Removed time flipping and time flow state, “forward/backward time” through data access #570

  • +
  • Simulation draw methods are now individual distributions like Uniform, Lognormal, Weibull #624

  • +
+
+
+

Minor Changes#

+
    +
  • unpackcFunc is deprecated, use unpack(parameter) to unpack a parameter after solving the model #784

  • +
  • Remove deprecated Solution Class, use HARKObject across the codebase #772

  • +
  • Add option to find crossing points in the envelope step of DCEGM algorithm #758

  • +
  • Fix reset bug in the behaviour of AgentType.resetRNG(), implemented individual resetRNG methods for AgentTypes #757

  • +
  • Seeds are set at initialisation of a distribution object rather than draw method #691 #750, #729

  • +
  • Deal with portfolio share of ‘bad’ assets #749

  • +
  • Fix bug in make_figs utilities function #755

  • +
  • Fix typo bug in Perfect Foresight Model solver #743

  • +
  • Add initial support for logging in ConsIndShockModel #714

  • +
  • Speed up simulation in AggShockMarkovConsumerType #702

  • +
  • Fix logic bug in DiscreteDistribution draw method #715

  • +
  • Implemented distributeParams to distributes heterogeneous values of one parameter to a set of agents #692

  • +
  • NelderMead is now part of estimation #693

  • +
  • Fix typo bug in parallel #682

  • +
  • Fix DiscreteDstn to make it work with multivariate distributions #646

  • +
  • BayerLuetticke removed from HARK, is now a REMARK #603

  • +
  • cstwMPC removed from HARK, is now a REMARK #666

  • +
  • SolvingMicroDSOPs removed from HARK, is now a REMARK #651

  • +
  • constructLogNormalIncomeProcess is now a method of IndShockConsumerType #661

  • +
  • Discretize continuous distributions #657

  • +
  • Data used in cstwMPC is now in HARK.datasets #622

  • +
  • Refactor checkConditions by adding a checkCondition method instead of writing custom checks for each condition #568

  • +
  • Examples update #768, #759, #756, #727, #698, #697, #561, #654, #633, #775

  • +
+
+
+
+

0.10.6#

+

Release Date: 17-04-2020

+
+

Major Changes#

+
    +
  • Add Bellman equations for cyclical model example #600

  • +
  • read_shocks now reads mortality as well #613

  • +
  • Discrete probability distributions are now classes #610

  • +
+
+
+

Minor Changes#

+
+
+
+

0.10.5#

+

Release Date: 24-03-2020

+
+

Major Changes#

+
    +
  • Default parameters dictionaries for ConsumptionSaving models have been moved from ConsumerParameters to nearby the classes that use them. #527

  • +
  • Improvements and cleanup of ConsPortfolioModel, and adding the ability to specify an age-varying list of RiskyAvg and RiskyStd. #577

  • +
  • Rewrite and simplification of ConsPortfolioModel solver. #594

  • +
+
+
+

Minor Changes#

+
+
+
+

0.10.4#

+

Release Date: 05-03-2020

+
+

Major Changes#

+
    +
  • Last release to support Python 2.7, future releases of econ-ark will support Python 3.6+ #478

  • +
  • Move non-reusable model code to examples directory, BayerLuetticke, FashionVictim now in examples instead of in HARK code #442

  • +
  • Load default parameters for ConsumptionSaving models #466

  • +
  • Improved implementaion of parallelNelderMead #300

  • +
+
+
+

Minor Changes#

+
    +
  • Notebook utility functions for determining platform, GUI, latex (installation) are available in HARK.utilities #512

  • +
  • Few DemARKs moved to examples #472

  • +
  • MaxKinks available in ConsumerParameters again #486

  • +
+
+
+
+

0.10.3#

+

Release Date: 12-12-2019

+
+

Major Changes#

+
    +
  • Added constrained perfect foresight model solution. (#299

  • +
+
+
+

Minor Changes#

+
    +
  • Fixed slicing error in minimizeNelderMead. (#460)

  • +
  • Fixed matplotlib GUI error. (#444)

  • +
  • Pinned sphinx dependency. (#436)

  • +
  • Fixed bug in ConsPortfolioModel in which the same risky rate of return would be drawn over and over. (#433)

  • +
  • Fixed sphinx dependency errors. (#411)

  • +
  • Refactored simultation.py. (#408)

  • +
  • AgentType.simulate() now throws informative errors if +attributes required for simulation do not exist, or initializeSim() has +never been called. (#320)

  • +
+
+
+
+

0.10.2#

+

Release Date: 10-03-2019

+
+

Minor Changes#

+
    +
  • Add some bugfixes and unit tests to HARK.core. (#401)

  • +
  • Fix error in discrete portfolio choice’s AdjustPrb. (#391)

  • +
+
+
+
+

0.10.1.dev5#

+

Release Date: 09-25-2019

+
+

Minor Changes#

+
    +
  • Added portfolio choice between risky and safe assets (ConsPortfolioModel). (#241)

  • +
+
+
+
+

0.10.1.dev4#

+

Release Date: 09-19-2019

+
+

Minor Changes#

+
    +
  • Fixes cubic interpolation in KinkedRSolver. (#386)

  • +
  • Documentes the procedure for constructing value function inverses and fixes bug in which survival rate was not included in absolute patience factor. (#383)

  • +
  • Fixes problems that sometimes prevented multiprocessing from working. (#377)

  • +
+
+
+
+

0.10.1.dev3#

+

Release Date: 07-23-2019

+
+

Minor Changes#

+
    +
  • Missed pre-solve fix (see #363 for more context). (#367)

  • +
+
+
+
+

0.10.1.dev2#

+

Release Date: 07-22-2019

+
+

Minor Changes#

+
    +
  • Revert pre-solve commit due to bug. (#363)

  • +
+
+
+
+

0.10.1.dev1#

+

Release Date: 07-20-2019

+
+

Breaking Changes#

+
    +
  • See #302 under minor changes.

  • +
+
+
+

Major Changes#

+
    +
  • Adds BayerLuetticke notebooks and functionality. (#328)

  • +
+
+
+

Minor Changes#

+
    +
  • Fixes one-asset HANK models for endowment economy (had MP wired in as the shock). (#355)

  • +
  • Removes jupytext *.py files. (#354)

  • +
  • Reorganizes documentation and configures it to work with Read the Docs. (#353)

  • +
  • Adds notebook illustrating dimensionality reduction in Bayer and Luetticke. (#345)

  • +
  • Adds notebook illustrating how the Bayer & Luetticke invoke the discrete cosine transformation(DCT) and fixed copula to reduce dimensions of the problem.(#344)

  • +
  • Makes BayerLuetticke HANK tools importable as a module. (#342)

  • +
  • Restores functionality of SGU_solver. (#341)

  • +
  • Fixes datafile packaging issue. (#332)

  • +
  • Deletes .py file from Bayer-Luetticke folder. (#329)

  • +
  • Add an empty method for preSolve called checkRestrictions that can be overwritten in classes inheriting from AgentType to check for illegal parameter values. (#324)

  • +
  • Adds a call to updateIncomeProcess() in preSolve() to avoid solutions being based on wrong income process specifications if some parameters change between two solve() calls. (#323)

  • +
  • Makes checkConditions() less verbose when the checks are not actually performed by converting a print statement to an inline comment. (#321)

  • +
  • Raises more readable exception when simultate() is called without solving first. (#315)

  • +
  • Removes testing folder (part of ongoing test restructuring). (#304)

  • +
  • Fixes unintended behavior in default simDeath(). Previously, all agents would die off in the first period, but they were meant to always survive. (#302) Warning: Potentially breaking change.

  • +
+
+
+
+

0.10.1#

+

Release Date: 05-30-2019

+

No changes from 0.10.0.dev3.

+
+
+

0.10.0.dev3#

+

Release Date: 05-18-2019

+
+

Major Changes#

+
    +
  • Fixes multithreading problems by using Parallels(backend=’multiprocessing’). (287)

  • +
  • Fixes bug caused by misapplication of check_conditions. (284)

  • +
  • Adds functions to calculate quadrature nodes and weights for numerically evaluating expectations in the presence of (log-)normally distributed random variables. (258)

  • +
+
+
+

Minor Changes#

+
    +
  • Adds method decorator which validates that arguments passed in are not empty. (282

  • +
  • Lints a variety of files. These PRs include some additional/related minor changes, like replacing an exec function, removing some lambdas, adding some files to .gitignore, etc. (274, 276, 277, 278, 281)

  • +
  • Adds vim swp files to gitignore. (269)

  • +
  • Adds version dunder in init. (265)

  • +
  • Adds flake8 to requirements.txt and config. (261)

  • +
  • Adds some unit tests for IndShockConsumerType. (256)

  • +
+
+
+
+

0.10.0.dev2#

+

Release Date: 04-18-2019

+
+

Major Changes#

+

None

+
+
+

Minor Changes#

+
    +
  • Fix verbosity check in ConsIndShockModel. (250)

  • +
+
+
+

Other Changes#

+

None

+
+
+
+

0.10.0.dev1#

+

Release Date: 04-12-2019

+
+

Major Changes#

+
    +
  • Adds tools to solve problems that arise from the interaction of discrete and continuous variables, using the DCEGM method of Iskhakov et al., who apply the their discrete-continuous solution algorithm to the problem of optimal endogenous retirement; their results are replicated using our new tool here. (226)

  • +
  • Parameters of ConsAggShockModel.CobbDouglasEconomy.updateAFunc and ConsAggShockModel.CobbDouglasMarkovEconomy.updateAFunc that govern damping and the number of discarded ‘burn-in’ periods were previously hardcoded, now proper instance-level parameters. (244)

  • +
  • Improve accuracy and performance of functions for evaluating the integrated value function and conditional choice probabilities for models with extreme value type I taste shocks. (242)

  • +
  • Add calcLogSum, calcChoiceProbs, calcLogSumChoiceProbs to HARK.interpolation. (209, 217)

  • +
  • Create tool to produce an example “template” of a REMARK based on SolvingMicroDSOPs. (176)

  • +
+
+
+

Minor Changes#

+
    +
  • Moved old utilities tests. (245)

  • +
  • Deleted old files related to “cstwMPCold”. (239)

  • +
  • Set numpy floating point error level to ignore. (238)

  • +
  • Fixed miscellaneous imports. (212, 224, 225)

  • +
  • Improve the tests of buffer stock model impatience conditions in IndShockConsumerType. (219)

  • +
  • Add basic support for Travis continuous integration testing. (208)

  • +
  • Add SciPy to requirements.txt. (207)

  • +
  • Fix indexing bug in bilinear interpolation. (194)

  • +
  • Update the build process to handle Python 2 and 3 compatibility. (172)

  • +
  • Add MPCnow attribute to ConsGenIncProcessModel. (170)

  • +
  • All standalone demo files have been removed. The content that was in these files can now be found in similarly named Jupyter notebooks in the DEMARK repository. Some of these notebooks are also linked from econ-ark.org. (229, 243)

  • +
+
+
+

Other Notes#

+
    +
  • Not all changes from 0.9.1 may be listed in these release notes. If you are having trouble addressing a breaking change, please reach out to us.

  • +
+
+
+
+
+ + +
+ + + + + + + +
+ + + + + + + +
+ + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/Documentation/guides/contributing.html b/Documentation/guides/contributing.html new file mode 100644 index 000000000..9f53a35c6 --- /dev/null +++ b/Documentation/guides/contributing.html @@ -0,0 +1,1082 @@ + + + + + + + + + + + Contributing to Econ-ARK — HARK latest documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+
+ + + + +
+ + + + + + + + + + + + + +
+ +
+ + +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ +
+

Contributing to Econ-ARK#

+
+

Code of Conduct#

+

The Econ-ARK project has a Code of Conduct +to which all contributors must adhere. +See details in the written policy statement.

+
+
+

Welcome!#

+

Thank you for considering contributing to Econ-ARK! +We’re a young project with a small but committed community +that’s hoping to grow while maintaining our friendly and responsive culture. +Whether you’re an economist or a technologist, +a writer or a coder, an undergrad or a full professor, +a professional or a hobbyist, there’s a place for you in the Econ-ARK community.

+

We’re still creating our contribution infrastructure, +so this document is a work in progress. +If you have any questions, please feel free to @ +or otherwise reach out to project leaders Chris and Matt. +If you prefer to connect through email, +you can send it to econ-ark at jhuecon dot org. +We have a Gitter chat room you are welcome to meet us in, +as well as a Discord channel +listed under the channel for the Scientific Python community!

+
+
+

How to Contribute#

+

We’re open to all kinds of contributions, +from bug reports to help with our docs to suggestions on how to improve our code. +The best way to figure out if the contribution you’d like to make +is something we’d merge or otherwise accept, +is to open up an issue in our issue tracker. +Please create an issue rather than immediately submitting pull request, +unless the change you’d like to make is so minor +you won’t mind if the pull request is rejected. +For bigger contributions, we want to proactively talk things through, +so that we don’t end up wasting your time.

+

While we’re thrilled to receive all kinds of contributions, +there are a few key areas we’d especially like help with:

+
    +
  • porting existing heterogeneous agent/agent-based models into HARK

  • +
  • curating and expanding the collection of projects which use Econ-ARK +(which we store in the REMARK repository)

  • +
  • creating demonstrations of how to use Econ-ARK +(which we store in the DemARK repository)

  • +
  • expanding test coverage of our existing code

  • +
+

If you’d like to help with those or any other kind of contribution, +reach out to us, and we’ll help you to do so.

+

We don’t currently have guidelines for opening issues or pull requests, +so include as much information as seems relevant to you, +and we’ll ask you if we need to know more.

+
+
+

Responding to Issues and Pull Requests#

+

We’re trying to get better at managing our open issues and pull requests. +We’ve created a new set of goals for all issues and pull requests in our Econ-ARK repos:

+
    +
  1. Initial response within one or two days.

  2. +
  3. Substantive response within two weeks.

  4. +
  5. Resolution of issue/pull request within three months.

  6. +
+

If you’ve been waiting on us for more than two weeks for any reason, +please feel free to give us a nudge. +Correspondingly, we ask that you respond to any questions or requests +from us within two weeks as well, +even if it’s just to say, “Sorry, I can’t get to this for a while yet”. +If we don’t hear back from you, we may close your issue or pull request. +If you want to re-open it, just ask—we’re glad to do so.

+
+
+

Getting Started#

+

The Contributing Guide below provides instructions for how to get started running HARK. +This also serves as a setup guide for new contributors. +If you run into any problems, please let us know by opening an issue in the issue tracker.

+

Thanks again! We’re so glad to have you in our community.

+
+

Contributing Guide#

+
    +
  1. If you are a first-time contributor:

    +
      +
    • Go to https://github.com/econ-ark/HARK and click the +“fork” button to create your own copy of the project. If you are new to GitHub, you can perform the next steps using GitHub Desktop as well.

    • +
    • Clone the project to your local computer

      +
      git clone git@github.com:your-username/HARK
      +
      +
      +
    • +
    • Navigate to the folder HARK and add the upstream repository

      +
      git remote add upstream git@github.com:econ-ark/HARK
      +
      +
      +
    • +
    • Now, you have remote repositories named:

      +
        +
      • upstream, which refers to the HARK repository

      • +
      • origin, which refers to your personal fork of HARK.

      • +
      +
    • +
    +
  2. +
  3. Develop your contribution:

    +
      +
    • Pull the latest changes from upstream

      +
      git checkout master
      +git pull upstream master
      +
      +
      +
    • +
    • Create a branch for the feature you want to work on. +Since the +branch name will appear in the merge message, use a sensible name +such as ‘bugfix-for-issue-220’

      +
      git checkout -b bugfix-for-issue-220
      +
      +
      +
    • +
    • Commit locally as you progress (git add and git commit)

    • +
    +
  4. +
  5. To submit your contribution:

    +
      +
    • Push your changes back to your fork on GitHub

      +
      git push origin bugfix-for-issue-220
      +
      +
      +
    • +
    • Go to GitHub. +The new branch will show up with a green Pull Request +button—click it.

    • +
    +
  6. +
  7. Review process:

    +
      +
    • Reviewers (the other developers and interested community members) will +write inline and/or general comments on your Pull Request (PR) to help +you improve its implementation, documentation, and style. +Every single +developer working on the project has their code reviewed, and we’ve come +to see it as friendly conversation from which we all learn and the +overall code quality benefits. +Therefore, please don’t let the review +discourage you from contributing: its only aim is to improve the quality +of the project, not to criticize +(we are, after all, very grateful for the time you’re donating!).

    • +
    • To update your pull request, make your changes in your local repository +and commit. +As soon as those changes are pushed up +(to the same branch as before) +the pull request will update automatically.

    • +
    • GitHub Actions, +a continuous integration service, +is triggered after each Pull Request update to build the code and run unit +tests of your branch. +The tests must pass before your PR can be merged. +If the tests fail, you can find out why by clicking on the “failed” icon +(red cross) and inspecting the build and test log.

    • +
    +
  8. +
+

NOTE: If closing a bug, also add “Fixes #1480” where 1480 is the issue number.

+
+
+

Build environment setup#

+

Once you’ve cloned your fork of the HARK repository, +you should set up a Python development environment tailored for HARK. Currently, we recommend version 3.10. +You may choose the environment manager of your choice. +Here we provide instructions for two popular environment managers: +venv (pip based) and conda (Anaconda or Miniconda).

+
+

venv#

+

When using venv, you may find the following bash commands useful

+
# Create a virtualenv named ``econ-dev`` that lives in the directory of
+# the same name
+python -m venv econ-dev
+# Activate it
+source econ-dev/bin/activate
+# Build and install HARK from source with developer requirements
+pip install -e ".[dev]"
+# Test your installation
+pip install pytest
+pytest HARK/
+
+
+
+
+

conda#

+

When using conda, you may find the following bash commands useful

+
# Create a conda environment named ``econ-dev``
+conda create -n econ-dev python=3.10
+# Activate it
+conda activate econ-dev
+# Build and install HARK from source with developer requirements
+pip install -e ".[dev]"
+# Test your installation
+pip install pytest
+pytest HARK/
+
+
+
+
+
+

Guidelines#

+
    +
  • All code should have tests.

  • +
  • All code should be documented, to the same +standard +as NumPy and SciPy.

  • +
  • All changes are reviewed.

  • +
+
+
+

Stylistic Guidelines#

+
    +
  • We use black <https://black.readthedocs.io> for styling of code

  • +
+
# install black
+pip install black
+# run black on the changed files
+black path_to_changed_file.py
+
+
+
+
+

Naming Conventions#

+

Object naming conventions in HARK are fairly different than existing standards, +and differ somewhat between tool modules vs model or application modules. +The following conventions apply throughout HARK:

+
    +
  • Functions and methods are always in ‘’camel case’’: no underscores, +first letter is lower case, first letter of each subsequent word is capitalized. +E.g. approxLognormal.

  • +
  • Function and method names should accurately and concisely describe what the function does; +the first word in the name must be a verb

  • +
  • Variable and class names should not have a verb as their first word.

  • +
  • Class names should use no underscores and capitalize the first letter of each word; +moreover, a class name must include a noun. +E.g. ConsPerfForesightSolver.

  • +
+

When naming variables in model modules, +the HARK team strongly discourages using single letter names, like c for consumption. +Instead, we encourage contributors to use longer, +more descriptive variable names using additional words and common abbreviations to specify the variable more precisely. +In NARK, +we list standard single letter variable ‘’bases’’ and an array of prefixes and suffixes to adjust them. +Economic variables in model modules should (usually) not use underscores, +instead using camel case to the greatest extent possible. +For ‘’non-economic’’ variables that are only used temporarily, underscores are permissible. +The development team prefers this standard +so that users can translate between Python code and LaTeX script with minimal work.

+

Conventions for naming variables in HARK’s tool modules are significantly closer to more commonly used standards. +Variable names should be in all lower case, with underscores between words, e.g. data_to_match. +The functions and classes in these modules are more general +and almost surely do not have any inherent ‘’economic content’’; +they are numerical or algorithmic objects, +not variables that might appear in an equation in an article for a (non-computational) economics journal. +Variable names in application modules (e.g. the files that execute the cstwMPC estimations) +are a mix of the conventions for tool and model files, +as appropriate for each variable. +That is, variables that are directly related to ‘’economic variables’’ in model modules should follow those conventions, +while objects created solely for data manipulation or reporting should use the style of tool modules.

+
+
+

Documentation Convention#

+

The HARK team wants the toolKit to be as accessible to users as possible; +our greatest fear (other than spiders, of course) is that a new user will open up our code, +get hopelessly confused trying to read it, +and then never look at HARK again. +To prevent this tragic outcome, we have tried hard to provide comprehensive, +accurate documentation and comments within the code describing our methods. +Moreover, +HARK uses the Sphinx utility +to generate a website with online documentation +for all of our tool and model modules, +so that users can learn about what’s available in HARK without digging through the source code. +When making contributions to HARK, +the development team asks users +to format their inline documentation to work with Sphinx by following a few simple rules.

+
    +
  • The top of every module should begin with a ‘’docstring’’ providing a clear description of the contents of the module. +The first sentence should concisely summarize the file, +as it may appear in an index or summary of all modules without the remaining sentences. +A docstring at the top of a module should be formatted as:

  • +
+
"""
+Specifies an economic model and provides methods for solving it.
+
+More specific description of the key features of the model and variations of it in this module.
+
+Maybe some comments about the solution method or limitations of the model.
+
+Your bank account routing number.
+"""
+
+
+
    +
  • The line directly below the declaration of a function, method or class should begin a docstring describing that object. +As with modules, the first sentence should concisely summarize the function or class, +as it might be included in an index or summary. +For functions and methods, the docstring should be formatted as:

  • +
+
def functionName(input1, input2):
+    """
+    Concise description of the function.  More details about what
+    the function does, options or modes available, and maybe mathematical
+    methods used.  Credit to a source if you poached their algorithm.
+
+    Parameters
+    --------------------
+
+    input1: type
+    Description of what input1 represents.
+    input2: type
+    Description of what input2 represents.
+
+    Returns
+    --------------
+    output_name: type
+    Description of the output(s) of the function.  Might have
+    multiple entries.  If no output, this is just "None".
+    """
+
+
+
    +
  • Provide ample comments within a function or method +so that a relatively intelligent reader can follow along with your algorithm. +Short comments can follow at the end of a line, +longer comments (or descriptions of the step or task about to be performed) +should precede a block of code on the line(s) above it.

  • +
+

Finally, if you write a new model module, +the HARK team asks that you also provide a short mathematical writeup of the model as a PDF. +This document does not need +to go into great detail about the solution method for the model or the functions and classes included in the module, +merely specify the economic model and provide a summary of how it is solved. +See ConsumptionSavingModels.pdf for an example of this.

+
+

Contributing to documentation#

+

Econ-ARK’s documentation is managed with Sphinx. +The documentation is written in reStructuredText and +MyST Markdown.

+

Contributing to documentation involves editing the file you want to change, +and creating a pull request in the usual fashion above. +All changes to documentation are automatically rendered and deployed to +docs.econ-ark.org by our automated infrastructure.

+

To test your changes to the documentation locally, you can render as follows:

+
    +
  1. Install the dependencies for the documentation:

    +
     pip install -e .[doc]
    + pip install pandoc
    +
    +
    +
  2. +
  3. Run sphinx-build:

  4. +
+
sphinx-build -M html . HARK-docs -T -c Documentation -W
+
+
+
    +
  1. View the rendered HTML by opening the +./HARK-docs/html/index.html file.

  2. +
+
+
+

Adding examples to the documentation#

+

HARK’s example notebooks are stored in the HARK/examples file. +Every pull request to HARK automatically reruns every example notebook +to keep them up to date.

+

To add a notebook from the examples folder to the documentation, add a link +to the notebook to the Documentation/overview/index.rst file. It should +the format ../../examples/AAA/BBB.ipynb. Then add a link to the notebook +in the Documentation/example_notebooks/Include_list.txt file. It should have +the format examples/AAA/BBB.ipynb.

+

Sphinx requires it’s example notebooks to have a title, and headings in order of +decreasing size. Make sure the notebook you added has those qualities before you push. +Otherwise sphinx will fail to build.

+
+

Warning

+

Make sure not to include the HARK-docs folder in your pull request if you’re +testing locally. HARK will automatically build this file when the pull request +is made. Including the HARK-docs folder may create unexpected conflicts.

+

If you would like to build the documentation without warnings being treated as errors use the command:

+
   sphinx-build -M html . HARK-docs -T -c Documentation
+
+
+

This lets you see every warning without sphinx quitting after the first issue it finds. +If you’re doing this, make sure to delete the HARK-docs folder before running it again. +Otherwise it won’t show the warnings again, and you won’t be able to check if they’ve been fixed.

+
+
+
+
+

Testing#

+

HARK has a test suite that ensures correct +execution on your system. +The test suite has to pass before a pull +request can be merged, and tests should be added to cover any +modifications to the code base.

+

We make use of the pytest and unittests +testing framework, with tests located in the various +HARK/submodule/tests folders.

+

To use pytest, ensure that the library is installed in development mode

+
$ pip install -e .
+
+
+

Now, run all tests using

+
$ pytest HARK
+
+
+

Or the tests for a specific submodule

+
$ pytest HARK/ConsumptionSaving
+
+
+

Or tests from a specific file

+
$ pytest HARK/ConsumptionSaving/tests/test_ConsAggShockModel.py
+
+
+
+
+

Pre-commit hooks#

+

HARK uses pre-commit to ensure that all code is well organized and formatted, +as well as to ensure the integrity of example notebooks. +To install pre-commit, run

+
$ pip install pre-commit
+$ pre-commit install
+
+
+

Once you do this, it will run the pre-commit hooks on every commit while only affecting modified files. +If you want to run the pre-commit hooks manually on every file, run

+
$ pre-commit run --all-files
+
+
+

Because this is an optional feature, it does not come installed with HARK by default. +This is to avoid overhead for new users and contributors who might be new to github and software development in general.

+

If you are having issues with pre-commit, +and just want to commit your changes, you can use the --no-verify flag to bypass the pre-commit hooks.

+
$ git commit -m "commit message" --no-verify
+
+
+

If you do this, +please alert one of the core developers +so that we can review your changes to make sure that there are no issues and that your code is formatted correctly.

+

The following pre-commit hooks are currently configured:

+
    +
  • [jupytext] sync, clean up, and execute jupyter notebooks

  • +
  • [black] format code

  • +
  • [pyupgrade] update small python snippets as we drop older versions of python

  • +
  • [blacken-docs] format documentation

  • +
  • [isort] sort imports on .py files

  • +
  • [mirrors-prettier] clean up and format other types of files in codebase

  • +
  • [pre-commit-hooks] other small clean-up/formatting

  • +
+

If you are interested in using pre-commit, +please see the pre-commit documentation for more information.

+
+
+

Pull request codes#

+

When you submit a pull request to GitHub, GitHub will ask you for a summary. +If +your code is not ready to merge, but you want to get feedback, please consider +using WIP: experimental optimization or similar for the title of your pull +request. +That way we will all know that it’s not yet ready to merge and that +you may be interested in more fundamental comments about design.

+

When you think the pull request is ready to merge, change the title (using the +Edit button) to remove the WIP:.

+
+
+

Bugs#

+

Please report bugs on GitHub.

+
+
+
+

Developer’s Certificate of Origin 1.1#

+

By making a contribution to this project, I certify that:

+
    +
  • (a) The contribution was created in whole or in part by me and I +have the right to submit it under the open source license +indicated in the file; or

  • +
  • (b) The contribution is based upon previous work that, to the best +of my knowledge, is covered under an appropriate open source +license and I have the right under that license to submit that +work with modifications, whether created in whole or in part +by me, under the same open source license (unless I am +permitted to submit under a different license), as indicated +in the file; or

  • +
  • (c) The contribution was provided directly to me by some other +person who certified (a), (b) or (c) and I have not modified +it.

  • +
  • (d) I understand and agree that this project and the contribution +are public and that a record of the contribution (including all +personal information I submit with it, including my sign-off) is +maintained indefinitely and may be redistributed consistent with +this project or the open source license(s) involved.

  • +
+
+
+ + +
+ + + + + + + +
+ + + + + + + +
+ + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/Documentation/guides/index.html b/Documentation/guides/index.html new file mode 100644 index 000000000..6057dd283 --- /dev/null +++ b/Documentation/guides/index.html @@ -0,0 +1,550 @@ + + + + + + + + + + + Guides — HARK latest documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+
+ + + + +
+ + + + + + + + + + + + + +
+ +
+ + +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + +
+ + + + +
+ + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/Documentation/guides/installation.html b/Documentation/guides/installation.html new file mode 100644 index 000000000..65eb602a6 --- /dev/null +++ b/Documentation/guides/installation.html @@ -0,0 +1,729 @@ + + + + + + + + + + + HARK installation guide — HARK latest documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+
+ + + + +
+ + + + + + + + + + + + + +
+ +
+ + +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ +
+

HARK installation guide#

+

HARK is an open source project written in Python. It’s supported for Python versions 3.10 and up.

+
+

Instructions for a new user#

+

In order to use HARK, you firstly need to download Python and add Python to the PATH. If you are not confident about the installation process you can use this step-by-step guide. You can also install the Anaconda Python distribution by following this guide. Anaconda comes bundled with most commonly used mathematical and scientific Python packages. We recommend using Conda to all HARK users.

+
+

Note

+

You can have the default Python distribution from python.org and from Anaconda, as they do not interfere. However, be careful with setting the PATH. To avoid problems you can set the environment variables path to the default distribution and access Anaconda distribution via Anaconda prompt.

+
+

Next, you’ll want a text editor for Python. We recommend using VSCode or PyCharm. If you’re using Anaconda, we’d also recommend using Spyder which comes bundled.

+
+ +
+

To install VScode visit: +https://code.visualstudio.com/docs

+
+ + + +
+

To install Anaconda, follow the guide here.

+

They may ask you to give them your email to install Anaconda. If they do you can click the skip registration button and it will take you directly to the installation window.

+

Once Anaconda is installed visit the Sypder installation guide to set up Spyder.

+

Sypder can be opened through the Anaconda navigator, or by typing spyder into the command line.

+
+ +
+

If you’re looking for more options or these recommendations aren’t working for you, don’t worry, there are plenty of others. You can start with This list or just type ‘Python IDE’ into your prefered search engine.

+
+
+

After installing Python and the text editor, you can install the HARK package. The simplest way is to use pip by running the command pip install econ-ark.

+

If you prefer to isolate your installation of econ-ark from the installations of any other python tools and packages, use a virtual environment such as virtualenv.

+
+ +
+

To install virtualenv, then to create an environment named econ-ark, and finally to activate that environment, at a command line type:

+
cd [directory where you want to store the econ-ark virtual environment]
+pip install virtualenv
+virtualenv econ-ark
+
+
+

Then for Windows, type:

+
.\econ-ark\Scripts\activate.bat
+
+
+
+

While for Mac or Linux:

+
source econ-ark/bin/activate
+
+
+

In the both cases, you may see (econ-ark) in your command prompt.

+

If you want to leave your environment, type:

+
deactivate
+
+
+
+

Note

+

If you install econ-ark into a virtual environment, your HARK scripts will not compile unless the virtual environment is activated.

+

If you’re using an IDE, you also need to configure the environment.

+

check out the virtual env documentation for more information about virtual environments.

+
+
+ +
+

Anaconda includes its own virtual environment system called conda which stores environments in a preset location (so you don’t have to choose). So in order to create your econ-ark virtual environment type:

+
conda create -n econ-ark anaconda
+
+
+

Then you can activate it by typing:

+
conda activate econ-ark
+
+
+

If you want to leave your environment, type:

+
deactivate
+
+
+
+

Note

+

If you install econ-ark into a virtual environment, your HARK scripts will not compile unless the virtual environment is activated.

+

If you’re using an IDE, you also need to configure the environment.

+

check out the conda documentation for more information about virtual environments.

+
+
+
+

Next, install econ-ark into your new virtual environment via pip:

+
pip install econ-ark
+
+
+
+
+
+

Instructions for an advanced user/developer#

+

If you want to make changes or contributions (yay!) to HARK, you’ll need to have access to the source files. Installing HARK via pip (either at the command line, or inside Spyder) makes it hard to access those files (and it’s a bad idea to mess with the original code anyway because you’ll likely forget what changes you made). If you are adept at GitHub, you can fork the repo. If you are less experienced, you should download a personal copy of HARK again using git clone (see part for a new user) or the GitHub Desktop app.

+
    +
  1. Create and activate a virtual environment.

  2. +
  3. Navigate to wherever you want to put the repository and type git clone git@github.com:econ-ark/HARK.git (more details here). If you get a permission denied error, you may need to setup SSH for GitHub, or you can clone using HTTPS: git clone https://github.com/econ-ark/HARK.git. If you’re using the desktop app, go to file->Clone Repository->url, and use https://github.com/econ-ark/HARK.git as the Repository url.

  4. +
  5. Make sure to navigate to the HARK directory, and install HARK’s requirements into the virtual environment with pip install -r ./requirements/base.txt. The requirements folder also contains dev.txt and doc.txt which install packages relevant to develoment and the documentation respectively.

  6. +
  7. Install econ-ark locally: navigate to your local repository and then type:

  8. +
+
pip install -e .
+
+
+
    +
  1. To check that everything has been set up correctly, run HARK’s tests with python -m unittest.

  2. +
+
+
+

Note

+

To check the package performance with your local changes, use the same command from the command line (after navigating to your HARK directory):

+
pip install -e .
+
+
+

If for some reason you want to switch back to the PyPI version:

+
pip uninstall econ-ark
+pip install econ-ark (options)
+
+
+
+
+
+

Content Aside from the Toolkit#

+

If you don’t already have one, you should designate a place on your computer where you will be putting all the Econ-ARK content. +For example, it is common to just create a folder GitHub in your home user directory. Inside GitHub you should create folders +corresponding to the GitHub ID’s of users whose work you want to obtain; for example, GitHub/econ-ark. Inside the econ-ark directory you can obtain a number of different resources.

+
+

Demonstrations And Illustrations#

+

Most of the modules in HARK are just collections of tools. To look at a demonstrations, check repository: * DemARK: Demonstrations of the use of HARK

+

You will want to obtain your own local copy of these repos using:

+
git clone https://github.com/econ-ark/DemARK.git
+
+
+

Once you have downloaded them, you will find that the repo contains a notebooks directory that contains a number of jupyter notebooks. If you have the jupyter notebook tool installed (it is installed as part of Anaconda), you should be able to launch the jupyter notebook app from the command line with the command: jupyter notebook.

+
+
+

REMARK: Replications and Examples Made Using the ARK#

+

From inside the GitHub/econ-ark directory, you will want to obtain your own local copy of the REMARK repo:

+
git clone https://github.com/econ-ark/REMARK.git
+
+
+

Once the download finishes (it should have created GitHub/econ-ark/REMARK, change into that directory. +Its root level is mostly descriptive; the main content is in the REMARKs subdirectory, so cd REMARKs to +have a look at what is there. Each REMARK is contained in a directory with the handle of the REMARK; +for example, BufferStockTheory is the handle for the REMARK on ‘The Theoretical Foundations of Buffer Stock Saving’.

+

At the top level of the directory for each REMARK we have some meta-information (title, authors, etc) and an eponymous Jupyter notebook, e.g. BufferStockTheory.ipynb. In most cases there will also be an subdirectory, e.g. BufferStockTheory which is a placeholder for the substantive content of the project (like, the original paper).

+
    +
  • Until a REMARK is finalized and frozen, the original content is often kept somewhere else, e.g.\ in an author’s GitHub repo. In this case, the REMARK repo uses a submodule version, which is sort of like a link to the original material. To save space, a regular ‘clone’ of the REMARK repo does not incorporate all the submodules; therefore you may find those folders empty when you first use them. In order to obtain the real content, in the root directory of the repo in question (e.g., in REMARKs/BufferStockTheory), you need execute the command git submodule update --recursive --remote.

  • +
+

Once you have downloaded them, you will find that the repo contains a notebooks directory that contains a number of jupyter notebooks. If you have the jupyter notebook tool installed (it is installed as part of Anaconda), you should be able to launch the jupyter notebook app from the command line with the command:

+
jupyter notebook
+
+
+
+
+
+ + +
+ + + + + + + +
+ + + + + + + +
+ + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/Documentation/guides/quick_start.html b/Documentation/guides/quick_start.html new file mode 100644 index 000000000..71ac1ec52 --- /dev/null +++ b/Documentation/guides/quick_start.html @@ -0,0 +1,645 @@ + + + + + + + + + + + Quick Start Guide — HARK latest documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+
+ + + + +
+ + + + + + + + + + + + + +
+ +
+ + +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ +
+

Quick Start Guide#

+
+

Installing HARK#

+

HARK is an open source project that is compatible with Python 3. Currently, HARK is supported for python versions 3.10 or higher.

+

The simplest way to install HARK is to use pip by running pip install econ-ark in your command line.

+

Before installing HARK, we recommend creating a new virtual environment, which isolates the installation of econ-ark from the installations of any other Python tools and packages, thus avoiding conflicts.

+

The easiest way to get started with managing environments is to use conda, which is packaged with either the Anaconda distribution or Miniconda. To create a new virtual environment and install econ-ark, enter this in your command line:

+
conda create -n econ-ark
+conda activate econ-ark
+pip install econ-ark
+
+
+
+
+

Learning HARK#

+

We’ve prepared a set of 30-second Elevator Spiels describing the project, tailored to people with several different kinds of background.

+

To start learning HARK we recommend working through the Overview and Examples section starting with A Gentle Introduction to HARK.

+
+ +For people without a technical/scientific/computing background
+

Recent years have seen major advances in the ability of computational tools to explain the economic behavior of households, firms, and whole economies. But a major impediment to the widespread adoption of these techniques among economists has been the extent to which the advances are the culmination of years of development of intricate and hand-crafted (but mutually incomprehensible) computational tools by a few pioneering scholars and their students. The aim of the Econ-ARK project is to make it much easier for new scholars to begin using these techniques, by providing a modern, robust, open-source set of high-quality computational tools with components that can be mixed, matched, and extended to address the wide variety of problems across all fields of economics that can be effectively studied using such tools.

+

For users unfamiliar with programming, we strongly encourage you to review the background material on python provided by the good people at QuantEcon including the material on NumPy.

+
+
+ +For people with a technical/scientific/computing background but little economics background
+

Most of what economists have done so far with ‘big data’ has been like what Kepler did with astronomical data: Organizing the data, and finding patterns and regularities and interconnections. An alternative approach called ‘structural modeling’ aims to do, for economic data, what Newton did for astronomical data: Provide a deep and rigorous mathematical (or computational) framework that distills the essence of the underlying behavior that produces the ‘big data.’ But structural techniques are so novel and computationally difficult that few economists have mastered them. The aim of the Econ-ARK project is to make it much, much easier for new scholars to do structural modeling, by providing a well-documented, open source codebase that contains the core techniques and can be relatively easily adapted to address many different questions.

+
+
+ +For economists who have done some structural modeling
+

The Econ-ARK project is motivated by a sense that quantitative structural modeling of economic agents’ behavior (consumers; firms), at present, is roughly like econometric modeling in the 1960s: Lots of theoretical results are available and a great deal can be done in principle, but actually using such tools for any specific research question requires an enormous investment of a scholar’s time and attention to learn techniques that are fundamentally not related to economics but instead are algorithmic/computational (in the 1960s, e.g., inverting matrices; now, e.g., solving dynamic stochastic optimization problems). The toolkit is built using the suite of open source, transparent tools for collaborative software development that have become ubiquitous in other fields in the last few years: Github, object-oriented coding, and methods that make it much easier to produce plug-and-play software modules that can be (relatively) easily combined, enhanced and adapted to address new problems.

+

After working through the Overview and Examples section:

+
    +
  • A full replication of the Iskhakov, Jørgensen, Rust, and Schjerning paper for solving the discrete-continuous retirement saving problem

    +
      +
    • An informal discussion of the issues involved is here (part of the DemARK repo)

    • +
    +
  • +
  • Structural-Estimates-From-Empirical-MPCs is an example of the use of the toolkit in a discussion of a well known paper. (Yes, it is easy enough to use that you can estimate a structural model on somebody else’s data in the limited time available for writing a discussion)

  • +
+
+
+ +For economists who have not yet done any structural modeling but might be persuadable to start
+

Dissatisfaction with the ability of Representative Agent models to answer important questions raised by the Great Recession has led to a strong movement in the macroeconomics literature toward ‘Heterogeneous Agent’ models, in which microeconomic agents (consumers; firms) solve a structural problem calibrated to match microeconomic data; aggregate outcomes are derived by explicitly simulating the equilibrium behavior of populations solving such models. The same kinds of modeling techniques are also gaining popularity among microeconomists, in areas ranging from labor economics to industrial organization. In both macroeconomics and structural micro, the chief barrier to the wide adoption of these techniques has been that programming a structural model has, until now, required a great deal of specialized knowledge and custom software development. The aim of the Econ-ARK project is to provide a robust, well-designed, open-source infrastructure for building such models much more efficiently than has been possible in the past.

+

After working through the Overview and Examples section:

+
    +
  • A simple indirect inference/simulated method of moments structural estimation along the lines of Gourinchas and Parker’s 2002 Econometrica paper or Cagetti’s 2003 paper is performed by the SolvingMicroDSOPs REMARK; this code implements the solution methods described in the corresponding section of these lecture notes.

  • +
+
+
+ +For Other Developers of Software for Computational Economics
+

The Econ-ARK project’s aim is to create a modular and extensible open-source toolkit for solving heterogeneous-agent partial-and general-equilibrium structural models. The code for such models has always been handcrafted, idiosyncratic, poorly documented, and sometimes not generously shared from leading researchers to outsiders. The result that it can take years for a new researcher to become proficient. Building an integrated system from the bottom up using object-oriented programming techniques and other tools (GitHub, open source licensing, unit testing, etc), we aim to provide a platform that will become a focal point for people using such models. At present, the project contains: A set of general purpose tools for solving such models; a number of tutorials and examples of how to use the tools; and complete archives of several papers whose main contribution is structural modeling results, and whose modeling work has been done using the toolkit.

+
+
+

Demonstrations on using HARK#

+

Most of the modules in HARK are just collections of tools. There are a few demonstrations/applications that use the tools that you automatically get when you install HARK – they are available in Overview & Examples. A much larger set of uses of HARK can be found at two repositories:

+
    +
  • DemARK: Demonstrations of the use of HARK

  • +
  • REMARK: Replications of existing papers made using HARK

  • +
+

You will want to obtain your own local copy of these repos using:

+
git clone https://github.com/econ-ark/DemARK.git
+git clone https://github.com/econ-ark/REMARK.git
+
+
+

Once you have downloaded them, you will find that each repo contains a notebooks directory that contains a number of jupyter notebooks. You can either view them in your integrated development environment (IDE) – such as VS Code or PyCharm – or if you have jupyter installed, launch the Jupyter notebook tool using the command line:

+
cd [directory containing the repository]
+jupyter notebook
+
+
+
+
+
+

Next steps#

+

To learn more about how to use HARK, check the next sections in this documentation, in particular the example notebooks. For instructions on making changes to HARK, refer to our contributing guide.

+
+
+ + +
+ + + + + + + +
+ + + + +
+ + +
+ + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/Documentation/license.html b/Documentation/license.html new file mode 100644 index 000000000..09aace862 --- /dev/null +++ b/Documentation/license.html @@ -0,0 +1,568 @@ + + + + + + + + + + + License — HARK latest documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+
+ + + + + + +
+ + +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ +
+

License#

+

All of HARK is licensed under the Apache License, Version 2.0 (ALv2). Please see +the LICENSE file for the text of the license. More information can be found at: +https://www.apache.org/dev/apply-license.html

+
+ + +
+ + + + + + + +
+ + + + +
+ + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/Documentation/overview/ARKitecture.html b/Documentation/overview/ARKitecture.html new file mode 100644 index 000000000..04620eac7 --- /dev/null +++ b/Documentation/overview/ARKitecture.html @@ -0,0 +1,756 @@ + + + + + + + + + + + ARKitecture of Econ-ARK — HARK latest documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+
+ + + + + + +
+ + +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ +
+

ARKitecture of Econ-ARK#

+

This document guides you through the structure of Econ-ARK, and explains the main ingredients. +Note that it does not explain how to use it—for this, please follow the example notebooks, which you can find on the left.

+

Econ-ARK contains the three main repositories HARK, DemARK, and REMARK. On top of that, the website combines all of them. Hence, if you want to find a notebook search them in materials.

+
    +
  • HARK: Includes the source code as well as some example notebooks.

  • +
  • DemARK: Here you can find Demonstrations of tools, AgentTypes, and ModelClasses.

  • +
  • REMARK: Here you can find R[eplications/eproductions] and Explorations Made using ARK.

  • +
+

Before describing each repository in detail, some preliminary remarks.

+

HARK is written in Python, an object-oriented programming (OOP) language that is quite popular in the scientific community. A significant reason for the adoption of Python is the numpy and scipy packages, which offer a wide array of mathematical and statistical functions and tools; HARK makes liberal use of these libraries. Python’s object-oriented nature allows models in HARK to be easily extended: new models can inherit functions and methods existing models, eliminating the need to reproduce or repurpose code.

+

We encourage HARK users to use the conda or mamba package managers, which include all commonly used mathematical and scientific Python packages.

+

For users unfamiliar with OOP, we strongly encourage you to review the background material on OOP provided by the good people at QuantEcon (for more on them, see below) at this link: Object Oriented Programming. Unlike non-OOP languages, OOP bundles together data and functions into objects. These can be accessed via: object_name.data and object_name.method_name(), respectively. For organizational purposes, definitions of multiple objects are stored in modules, which are simply files with a .py extension. Modules can be accessed in Python via:

+
import module_name as import_name
+
+
+

This imports the module and gives it a local name of import_name. We can access a function within this module by simply typing: import_name.function_name(). The following example will illustrate the usage of these commands. CRRAutility is the function object for calculating CRRA utility supplied by the HARK.rewards module. CRRAutility is called attributes of the module HARK.rewards. In order to calculate CRRA utility with a consumption of 1 and a coefficient of risk aversion of 2 we run:

+
from HARK.rewards import CRRAutility
+
+CRRAutility(1, 2)
+
+
+

Python modules in HARK can generally be categorized into two types: tools and models. Tool modules contain functions and classes with general purpose tools that have no inherent ‘’economic content’’, but that can be used in many economic models as building blocks or utilities; they could plausibly be useful in non-economic settings. Tools might include functions for data analysis (e.g. calculating Lorenz shares from data, or constructing a non-parametric kernel regression), functions to create and manipulate discrete approximations to continuous distributions, or classes for constructing interpolated approximations to non-parametric functions. The most commonly used tool modules reside in HARK’s root directory and have names like HARK.distributions and HARK.interpolation.

+

Model modules specify particular economic models, including classes to represent agents in the model (and the ‘’market structure’’ in which they interact) and functions for solving the ‘’one period problem’’ of those models. For example, ConsIndShockModel.py concerns consumption-saving models in which agents have CRRA utility over consumption and face idiosyncratic shocks to permanent and transitory income. The module includes classes for representing ‘’types’’ of consumers, along with functions for solving (several flavors of) the one period consumption-saving problem. Model modules generally have Model in their name, and the classes for representing agents all have Type at the end of their name (as instances represent a collection of ex ante homogeneous agents who share common model and parameters– a “type”). For example, HARK.ConsumptionSaving.ConsIndShockModel includes the class IndShockConsumerType.

+
+

HARK#

+

After you installed or cloned the repository of HARK, you can explore the content of it. In the subfolder HARK, you can find a range of general purpose tools, as well as the next subfolder ConsumptionSaving which has AgentType subclasses and Market subclasses.

+
+

General Purpose Tools#

+

HARK’s root directory contains several tool modules, each containing a variety of functions and classes that can be used in many economic models– or even for mathematical purposes that have nothing to do with economics. Some of the tool modules are very sparely populated, while others are quite large. These modules are continuously being developed and expanded, as there are many numeric tools that are well known and understood, and programming them is usually independent of other “moving parts” in HARK.

+
+

HARK.core#

+

A key goal of the project is to create modularity and interoperability between models, making them easy to combine, adapt, and extend. To this end, the HARK.core module specifies a framework for economic models in HARK, creating a common structure for them on two levels that can be called ‘’microeconomic’’ and ‘’macroeconomic’’.

+

Microeconomic models in HARK use the AgentType class to represent agents with an intertemporal optimization problem. Each of these models specifies a subclass of AgentType; an instance of the subclass represents agents who are ex-ante homogeneous– they have common values for all parameters that describe the problem. For example, ConsIndShockModel specifies the IndShockConsumerType class, which has methods specific to consumption-saving models with idiosyncratic shocks to income; an instance of the class might represent all consumers who have a CRRA of 3, discount factor of 0.98, etc. The AgentType class has a solve method that acts as a ‘’universal microeconomic solver’’ for any properly formatted model, making it easier to set up a new model and to combine elements from different models; the solver is intended to encompass any model that can be framed as a sequence of one period problems. For a complete description, see section AgentType Class.

+

Macroeconomic models in HARK use the Market class to represent a market (or other aggregator) that combines the actions, states, and/or shocks (generally, outcomes) of individual agents in the model into aggregate outcomes that are ‘’passed back’’ to the agents. For example, the market in a consumption-saving model might combine the individual asset holdings of all agents in the market to generate aggregate capital in the economy, yielding the interest rate on assets (as the marginal product of capital); the individual agents then learn the aggregate capital level and interest rate, conditioning their next action on this information. Objects that microeconomic agents treat as exogenous when solving (or simulating) their model are thus endogenous at the macroeconomic level. Like AgentType, the Market class also has a solve method, which seeks out a dynamic general equilibrium: a ‘’rule’’ governing the dynamic evolution of macroeconomic objects such that if agents believe this rule and act accordingly, then their collective actions generate a sequence of macroeconomic outcomes that justify the belief in that rule. For a more complete description, see section Market Class.

+
+
+

HARK.metric#

+

HARK.metric defines a superclass called MetricObject that is used throughout HARK’s tools and models. When solving a dynamic microeconomic model with an infinite horizon (or searching for a dynamic general equilibrium), it is often required to consider whether two solutions are sufficiently close to each other to warrant stopping the process (i.e. approximate convergence). It is thus necessary to calculate the ‘’distance’’ between two solutions, so HARK specifies that classes should have a distance method that takes a single input and returns a non-negative value representing the (generally unitless) distance between the object in question and the input to the method. As a convenient default, MetricObject provides a ‘’universal distance metric’’ that should be useful in many contexts. (Roughly speaking, the universal distance metric is a recursive supnorm, returning the largest distance between two instances, among attributes named in distance_criteria. Those attributes might be complex objects themselves rather than real numbers, generating a recursive call to the universal distance metric. +) When defining a new subclass of MetricObject, the user simply defines the attribute distance_criteria as a list of strings naming the attributes of the class that should be compared when calculating the distance between two instances of that class. For example, the class ConsumerSolution has distance_criteria = [‘cFunc’], indicating that only the consumption function attribute of the solution matters when comparing the distance between two instances of ConsumerSolution. See here for further documentation.

+
+
+

HARK.utilities#

+

The HARK.utilities module contains a variety of general purpose tools, including some data manipulation tools (e.g. for calculating an average of data conditional on being within a percentile range of different data), basic kernel regression tools, convenience functions for retrieving information about functions, and basic plotting tools using matplotlib.pyplot. See here for further documentation.

+
+
+

HARK.distributions#

+

The HARK.distributions module includes classes for representing continuous distributions in a relatively consistent framework. Critically for numeric purposes, it also has methods and functions for constructing discrete approximations to those distributions (e.g. approx_lognormal() to approximate a log-normal distribution) as well as manipulating these representations (e.g. appending one outcome to an existing distribution, or combining independent univariate distributions into one multivariate distribution). As a convention in HARK, continuous distributions are approximated as finite discrete distributions when solving models. This both simplifies solution methods (reducing numeric integrals to simple dot products) and allows users to easily test whether their chosen degree of discretization yields a sufficient approximation to the full distribution. See here for further documentation.

+
+
+

HARK.interpolation#

+

The HARK.interpolation module defines classes for representing interpolated function approximations. Interpolation methods in HARK all inherit from a superclass such as HARKinterpolator1D or HARKinterpolator2D, wrapper classes that ensures interoperability across interpolation methods. For example, HARKinterpolator1D specifies the methods _call_ and derivative to accept an arbitrary array as an input and return an identically shaped array with the interpolated function evaluated at the values in the array or its first derivative, respectively. However, these methods do little on their own, merely reshaping arrays and referring to the _evaluate and _der methods, which are not actually defined in HARKinterpolator1D. Each subclass of HARKinterpolator1D specifies their own implementation of _evaluate and _der particular to that interpolation method, accepting and returning only 1D arrays. In this way, subclasses of HARKinterpolator1D are easily interchangeable with each other, as all methods that the user interacts with are identical, varying only by ‘’internal’’ methods.

+

When evaluating a stopping criterion for an infinite horizon problem, it is often necessary to know the ‘’distance’’ between functions generated by successive iterations of a solution procedure. To this end, each interpolator class in HARK must define a distance method that takes as an input another instance of the same class and returns a non-negative real number representing the ‘’distance’’ between the two. As each of the HARKinterpolatorXD classes inherits from MetricObject, all interpolator classes have the default ‘’universal’’ distance method; the user must simply list the names of the relevant attributes in the attribute distance_criteria of the class.

+

Interpolation methods currently implemented in HARK include (multi)linear interpolation up to 4D, 1D cubic spline interpolation, (multi)linear interpolation over 1D interpolations (up to 4D total), (multi)linear interpolation over 2D interpolations (up to 4D total), linear interpolation over 3D interpolations, 2D curvilinear interpolation over irregular grids, interpolors for representing functions whose domain lower bound in one dimension depends on the other domain values, and 1D lower/upper envelope interpolators. See here for further documentation.

+
+
+

HARK.estimation#

+

Functions for optimizing an objective function for the purposes of estimating a model can be found in HARK.estimation. As of this writing, the implementation includes only minimization by the Nelder-Mead simplex method, minimization by a derivative-free Powell method variant, and two small tools for resampling data (i.e. for a bootstrap); the minimizers are merely convenience wrappers (with result reporting) for optimizers included in scipy.optimize. The module also has functions for a parallel implementation of the Nelder-Mead simplex algorithm, as described in Wiswall and Lee (2011). Future functionality will include more robust global search methods, including genetic algorithms, simulated annealing, and differential evolution. See here for full documentation.

+
+
+

HARK.parallel#

+

By default, processes in Python are single-threaded, using only a single CPU core. The HARK.parallel module provides basic tools for using multiple CPU cores simultaneously, with minimal effort. In particular, it provides the function multi_thread_commands, which takes two arguments: a list of AgentType s and a list of commands as strings; each command should be a method of the AgentType s. The function simply distributes the AgentType s across threads on different cores and executes each command in order, returning no output (the AgentType s themselves are changed by running the commands). Equivalent results would be achieved by simply looping over each type and running each method in the list. Indeed, HARK.parallel also has a function called multi_thread_commands_fake that does just that, with identical syntax to multi_thread\commands_. Multithreading in HARK can thus be easily turned on and off. See here for full documentation.

+
+
+

HARK.rewards#

+

The HARK.rewards module has a variety of functions and classes for representing commonly used utility (or reward) functions, along with their derivatives and inverses.

+
+
+
+

AgentType Class#

+

The core of our microeconomic dynamic optimization framework is a flexible object-oriented representation of economic agents. The HARK.core module defines a superclass called AgentType; each model defines a subclass of AgentType, specifying additional model-specific features and methods while inheriting the methods of the superclass. Most importantly, the method solve acts as a ‘’universal solver’’ applicable to any (properly formatted) discrete time model. This section describes the format of an instance of AgentType as it defines a dynamic microeconomic problem. Note that each instance of AgentType represents an ex-ante heterogeneous ‘’type’’ of agent; ex-post heterogeneity is achieved by simulating many agents of the same type, each of whom receives a unique sequence of shocks.

+
+

Attributes of an AgentType#

+

A discrete time model in our framework is characterized by a sequence of ‘’periods’’ that the agent will experience. A well-formed instance of AgentType includes the following attributes:

+
    +
  • solve_one_period: A function representing the solution method for a single period of the agent’s problem. The inputs passed to a solveOnePeriod function include all data that characterize the agent’s problem in that period, including the solution to the subsequent period’s problem (designated as solution_next). The output of these functions is a single Solution object, which can be passed to the solver for the previous period.

  • +
  • time_inv: A list of strings containing all of the variable names that are passed to at least one function in solveOnePeriod but do not vary across periods. Each of these variables resides in a correspondingly named attribute of the AgentType instance.

  • +
  • time_vary: A list of strings naming the attributes of this instance that vary across periods. Each of these attributes is a list of period-specific values, which should be of the same length.

  • +
  • solution_terminal: An object representing the solution to the ‘’terminal’’ period of the model. This might represent a known trivial solution that does not require numeric methods, the solution to some previously solved ‘’next phase’’ of the model, a scrap value function, or an initial guess of the solution to an infinite horizon model.

  • +
  • pseudo_terminal: A Boolean flag indicating that solution_terminal is not a proper terminal period solution (rather an initial guess, ‘’next phase’’ solution, or scrap value) and should not be reported as part of the model’s solution.

  • +
  • cycles: A non-negative integer indicating the number of times the agent will experience the sequence of periods in the problem. For example, cycles = 1 means that the sequence of periods is analogous to a lifecycle model, experienced once from beginning to end. An infinite horizon problem in which the sequence of periods repeats indefinitely is indicated with cycles = 0. For any cycles > 1, the agent experiences the sequence N times, with the first period in the sequence following the last; this structure is uncommon, and almost all applications with use a lifecycle or infinite horizon format.

  • +
  • tolerance: A positive real number indicating convergence tolerance, representing the maximum acceptable ‘’distance’’ between successive cycle solutions in an infinite horizon model; it is irrelevant when cycles > 0. As the distance metric on the space of solutions is model-specific, the value of tolerance is generally dimensionless.

  • +
+

An instance of AgentType also has the attributes named in time_vary and time_inv, and may have other attributes that are not included in either (e.g. values not used in the model solution, but instead to construct objects used in the solution). Note that time_vary may include attributes that are never used by a function in solveOnePeriod. Most saliently, the attribute solution is time-varying but is not used to solve individual periods.

+
+
+

A Universal Solver#

+

When an instance of AgentType invokes its solve method, the solution to the agent’s problem is stored in the attribute solution. The solution is computed by recursively solving the sequence of periods defined by the variables listed in time_vary and time_inv using the functions in solve_one_period. The time-varying inputs are updated each period, including the successive period’s solution as solution_next; the same values of time invariant inputs in time_inv are passed to the solver in every period. The first call to solve_one_period uses solution_terminal as solution_next. In an infinite horizon problem (cycles=0), the sequence of periods is solved until the solutions of successive cycles have a ‘’distance’’ of less than tolerance. Usually, the “sequence” of periods in such models is just one period long.

+

The output from a function in solve_one_period is an instance of a model-specific solution class. The attributes of a solution to one period of a problem might include behavioral functions, (marginal) value functions, and other variables characterizing the result. Each solution class must have a method called distance(), which returns the ‘’distance’’ between itself and another instance of the same solution class, so as to define convergence as a stopping criterion; for many models, this will be the ‘’distance’’ between a policy or value function in the solutions. If the solution class is defined as a subclass of MetricObject, it automatically inherits the default distance method, so that the user must only list the relevant object attributes in distance_criteria.

+

The AgentType also has methods named pre_solve and post_solve, both of which take no arguments and do absolutely nothing. A subclass of AgentType can overwrite these blank methods with its own model specific methods. pre_solve is automatically called near the beginning of the solve method, before solving the sequence of periods. It is used for specifying tasks that should be done before solving the sequence of periods, such as pre-constructing some objects repeatedly used by the solution method or finding an analytical terminal period solution. For example, the IndShockConsumerType class in ConsIndShockModel has a pre_solve method that calls its update_solution_terminal method to ensure that solution_terminal is consistent with the model parameters. The post_solve method is called shortly after the sequence of periods is fully solved; it can be used for ‘’post-processing’’ of the solution or performing a step that is only useful after solution convergence. For example, the TractableConsumerType in TractableBufferStockModel has a post_solve method that constructs an interpolated consumption function from the list of stable arm points found during solution.

+

Our universal solver is written in a very general way that should be applicable to any discrete time optimization problem– because Python is so flexible in defining objects, the time-varying inputs for each period can take any form. Indeed, the solver does no ‘’real work’’ itself, but merely provides a structure for describing models in the HARK framework, allowing interoperability among current and future modules.

+

The base AgentType is sparsely defined, as most ‘’real’’ methods will be application-specific. One method of note, however, is reset_rng, which simply resets the AgentType’s random number generator (as the attribute RNG) using the value in the attribute seed. (Every instance of AgentType is created with a random number generator as an instance of the class numpy.random.RandomState, with a default seed of zero.) This method is useful for (inter alia) ensuring that the same underlying sequence of shocks is used for every simulation run when a model is solved or estimated.

+
+
+
+

Market Class#

+

The modeling framework of AgentType is deemed ‘’microeconomic’’ because it pertains only to the dynamic optimization problem of agents, treating all inputs of the problem as exogenously fixed. In what we label as ‘’macroeconomic’’ models, some of the inputs for the microeconomic models are endogenously determined by the collective states and controls of agents in the model. In a dynamic general equilibrium, there must be consistency between agents’ beliefs about these macroeconomic objects, their individual behavior, and the realizations of the macroeconomic objects that result from individual choices.

+

The Market class in HARK.core provides a framework for such macroeconomic models, with a solve method that searches for a dynamic general equilibrium. An instance of Market includes a list of AgentType s that compose the economy, a method for transforming microeconomic outcomes (states, controls, and/or shocks) into macroeconomic outcomes, and a method for interpreting a history or sequence of macroeconomic outcomes into a new ‘’dynamic rule’’ for agents to believe. Agents treat the dynamic rule as an input to their microeconomic problem, conditioning their optimal policy functions on it. A dynamic general equilibrium is a fixed point dynamic rule: when agents act optimally while believing the equilibrium rule, their individual actions generate a macroeconomic history consistent with the equilibrium rule.

+
+

Down on the Farm#

+

The Market class uses a farming metaphor to conceptualize the process for generating a history of macroeconomic outcomes in a model. Suppose all AgentTypes in the economy believe in some dynamic rule (i.e. the rule is stored as attributes of each AgentType, which directly or indirectly enters their dynamic optimization problem), and that they have each found the solution to their microeconomic model using their solve method. Further, the macroeconomic and microeconomic states have been reset to some initial orientation.

+

To generate a history of macroeconomic outcomes, the Market repeatedly loops over the following steps a set number of times:

+
    +
  • sow: Distribute the macroeconomic state variables to all AgentType s in the market.

  • +
  • cultivate: Each AgentType executes their market_action method, likely corresponding to simulating one period of the microeconomic model.

  • +
  • reap: Microeconomic outcomes are gathered from each AgentType in the market.

  • +
  • mill: Data gathered by reap is processed into new macroeconomic states according to some ‘’aggregate market process’’.

  • +
  • store: Relevant macroeconomic states are added to a running history of outcomes.

  • +
+

This procedure is conducted by the make_history method of Market as a subroutine of its solve method. After making histories of the relevant macroeconomic variables, the market then executes its calc_dynamics function with the macroeconomic history as inputs, generating a new dynamic rule to distribute to the **AgentType**s in the market. The process then begins again, with the agents solving their updated microeconomic models given the new dynamic rule; the solve loop continues until the ‘’distance’’ between successive dynamic rules is sufficiently small.

+
+
+

Attributes of a Market#

+

To specify a complete instance of Market, the user should give it the following attributes:

+
    +
  • agents: A list of **AgentType**s, representing the agents in the market. Each element in agents represents an ex-ante heterogeneous type; each type could have many ex-post heterogeneous agents.

  • +
  • sow_vars: A list of strings naming variables that are output from the aggregate market process, representing the macroeconomic outcomes. These variables will be distributed to the agents in the sow step.

  • +
  • reap_vars: A list of strings naming variables to be collected from the agents in the reap step, to be used as inputs for the aggregate market process.

  • +
  • const_vars: A list of strings naming variables used by the aggregate market process that do not come from agents; they are constant or come from the Market itself.

  • +
  • track_vars: A list of strings naming variables generated by the aggregate market process that should be tracked as a history, to be used when calculating a new dynamic rule. Usually a subset of sow_vars.

  • +
  • dyn_vars: A list of strings naming the variables that constitute a dynamic rule. These will be stored as attributes of the agents whenever a new rule is calculated.

  • +
  • mill_rule: A function for the ‘’aggregate market process’’, transforming microeconomic outcomes into macroeconomic outcomes. Its inputs are named in reap_vars and const_vars, and it returns a single object with attributes named in sow_vars and/or track_vars. Can be defined as a method of a subclass of Market.

  • +
  • calc_dynamics: A function that generates a new dynamic rule from a history of macroeconomic outcomes. Its inputs are named in track_vars, and it returns a single object with attributes named in dyn_vars.

  • +
  • act_T: The number of times that the make_history method should execute the ‘’farming loop’’ when generating a new macroeconomic history.

  • +
  • tolerance: The minimum acceptable ‘’distance’’ between successive dynamic rules produced by calc_dynamics to constitute a sufficiently converged solution.

  • +
+

Further, each AgentType in agents must have two methods not necessary for microeconomic models; neither takes any input (except self):

+
    +
  • market_action: The microeconomic process to be run in the cultivate step. Likely uses the new macroeconomic outcomes named in sow_vars; should store new values of relevant microeconomic outcomes in the attributes (of self) named in reap_vars.

  • +
  • reset: Reset, initialize, or prepare for a new ‘’farming loop’’ to generate a macroeconomic history. Might reset its internal random number generator, set initial state variables, clear personal histories, etc.

  • +
+

When solving macroeconomic models in HARK, the user should also define classes to represent the output from the aggregate market process in mill_rule and for the model-specific dynamic rule. The latter should have a distance method to test for solution convergence; if the class inherits from MetricObject, the user need only list relevant attributes in distance_criteria. For some purposes, it might be useful to specify a subclass of Market, defining millRule and/or calcDynamics as methods rather than functions.

+
+
+
+
+

DemARK#

+

If you want to get a feeling for how the code works and what you can do with it, check out the DemARK repository which contains many useful demonstrations of tools, AgentTypes, and ModelClasses.

+

If you want to run the notebooks on your own machine make sure to install the necessary packages described in the readme file. Afterwards you can dive in the notebook folder. Each example has a markdown (.md) version with explanatory notes. The notebook (.ipynb) describes the method and runs (part of the) code.

+
+
+

REMARK#

+

HARK can be used to replicate papers as well. For this purpose the R[eplications/eproductions] and Explorations Made using ARK (REMARK) repository was created.

+

Each replication consists of a metadata file (.md) with an overview, a notebook which replicates the paper, and a requirement.txt file with the necessary packages to run the notebooks on your local mashine.

+
+
+ + +
+ + + + + + + +
+ + + + + + + +
+ + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/Documentation/overview/index.html b/Documentation/overview/index.html new file mode 100644 index 000000000..15afac479 --- /dev/null +++ b/Documentation/overview/index.html @@ -0,0 +1,635 @@ + + + + + + + + + + + Overview — HARK latest documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+
+ + + + + + +
+ + + + + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/Documentation/overview/introduction.html b/Documentation/overview/introduction.html new file mode 100644 index 000000000..25a9f6126 --- /dev/null +++ b/Documentation/overview/introduction.html @@ -0,0 +1,578 @@ + + + + + + + + + + + Introduction to HARK — HARK latest documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+
+ + + + + + +
+ + +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ +
+

Introduction to HARK#

+

If you are willing to risk some mild psychological trauma, conjure to mind your first experience of hand-coding a structural economic model. Your clunky effort probably built on legacy code provided by an adviser or colleague – which itself came from who-knows-what apocryphal sources. Efforts to combine elements from one model with those from another were likely frustrated by the ‘’Tower of Babel’’ problem: Code from one source could not ‘’speak’’ to code from another without your own intermediation as a translator, possibly between two unfamiliar languages and aided only by oracular comments that, at best, made sense only in the context of other (now missing) code.

+

After months of effort, you may have had the character-improving experience of proudly explaining to your adviser that not only had you grafted two ideas together, you also found a trick that speeded the solution by an order of magnitude, only to be told that your breathtaking insight had been understood for many years, as reflected in an appendix to a 2008 paper; or, worse, your discovery was something that ‘’everybody knows’’ but did not exist at all in published form!

+

Learning by doing has value, but only within limits. We do not require young drivers to design an internal combustion engine before driving a car, nor must graduate students write their own matrix inversion algorithms before running an OLS regression.

+

In recent years, considerable progress has been made in addressing these kinds of problems in many areas of economic modeling. Macroeconomists using representative agent models can send Dynare model files to each other; reduced form econometricians can choose from a host of econometric packages. But modelers whose questions require explicit structural modeling which involve nontrivial differences in agents (households, firms, etc.) that cannot simply be aggregated away are mostly still stuck in the bad old days.

+

The ultimate goal of the HARK project is to fix these problems. Specifically, our aim is to produce an open source repository of highly modular, easily interoperable code for solving, simulating, and estimating dynamic economic models with heterogeneous agents.[1] Further, we seek to establish (with input from the community) standards for the description and specification of objects like discrete approximations to continuous distributions and interpolated function approximations, so that numeric methods can be quickly swapped without ugly ‘’patching.’’

+

We hope that HARK will make it much easier and faster for researchers to develop solution and estimation methods for new models. The open source nature of HARK will make it easier for other researchers to audit and verify new models and methods, and to collaborate on correcting deficiencies when found. As HARK expands to include more canonical models and more tools and utilities, we can all spend less time managing numerical minutiae and more time fretting about identification arguments and data accuracy.

+
+
+ + + +
+ + + + + + + +
+ + + + +
+ + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/Documentation/reference/ConsumptionSaving/ConsAggShockModel.html b/Documentation/reference/ConsumptionSaving/ConsAggShockModel.html new file mode 100644 index 000000000..6e1e2cf0b --- /dev/null +++ b/Documentation/reference/ConsumptionSaving/ConsAggShockModel.html @@ -0,0 +1,1538 @@ + + + + + + + + + + + ConsAggShockModel — HARK latest documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+
+ + + + +
+ + + + + + + + + + + + + +
+ +
+ + +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ +
+

ConsAggShockModel#

+

Consumption-saving models with aggregate productivity shocks as well as idiosyn- +cratic income shocks. Currently only contains one microeconomic model with a +basic solver. Also includes a subclass of Market called CobbDouglas economy, +used for solving “macroeconomic” models with aggregate shocks.

+
+
+class HARK.ConsumptionSaving.ConsAggShockModel.AggShockConsumerType(**kwds)#
+

Bases: IndShockConsumerType

+

A class to represent consumers who face idiosyncratic (transitory and per- +manent) shocks to their income and live in an economy that has aggregate +(transitory and permanent) shocks to labor productivity. As the capital- +to-labor ratio varies in the economy, so does the wage rate and interest +rate. “Aggregate shock consumers” have beliefs about how the capital ratio +evolves over time and take aggregate shocks into account when making their +decision about how much to consume.

+
+
+reset()#
+

Initialize this type for a new simulated history of K/L ratio.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+pre_solve()#
+

Method that is run automatically just before solution by backward iteration. +Solves the (trivial) terminal period and does a quick check on the borrowing +constraint and MaxKinks attribute (only relevant in constrained, infinite +horizon problems).

+
+ +
+
+get_economy_data(economy)#
+

Imports economy-determined objects into self from a Market. +Instances of AggShockConsumerType “live” in some macroeconomy that has +attributes relevant to their microeconomic model, like the relationship +between the capital-to-labor ratio and the interest and wage rates; this +method imports those attributes from an “economy” object and makes them +attributes of the ConsumerType.

+
+
Parameters:
+

economy (Market) – The “macroeconomy” in which this instance “lives”. Might be of the +subclass CobbDouglasEconomy, which has methods to generate the +relevant attributes.

+
+
Return type:
+

None

+
+
+
+ +
+
+add_AggShkDstn(AggShkDstn)#
+

Updates attribute IncShkDstn by combining idiosyncratic shocks with aggregate shocks.

+
+
Parameters:
+

AggShkDstn ([np.array]) – Aggregate productivity shock distribution. First element is proba- +bilities, second element is agg permanent shocks, third element is +agg transitory shocks.

+
+
Return type:
+

None

+
+
+
+ +
+
+sim_birth(which_agents)#
+

Makes new consumers for the given indices. Initialized variables include aNrm and pLvl, as +well as time variables t_age and t_cycle. Normalized assets and permanent income levels +are drawn from lognormal distributions given by aNrmInitMean and aNrmInitStd (etc).

+
+
Parameters:
+

which_agents (np.array(Bool)) – Boolean array of size self.AgentCount indicating which agents should be “born”.

+
+
Return type:
+

None

+
+
+
+ +
+
+sim_death()#
+

Randomly determine which consumers die, and distribute their wealth among the survivors. +This method only works if there is only one period in the cycle.

+
+
Parameters:
+

None

+
+
Returns:
+

who_dies – Boolean array of size AgentCount indicating which agents die.

+
+
Return type:
+

np.array(bool)

+
+
+
+ +
+
+get_Rfree()#
+

Returns an array of size self.AgentCount with self.RfreeNow in every entry.

+
+
Parameters:
+

None

+
+
Returns:
+

RfreeNow – Array of size self.AgentCount with risk free interest rate for each agent.

+
+
Return type:
+

np.array

+
+
+
+ +
+
+get_shocks()#
+

Finds the effective permanent and transitory shocks this period by combining the aggregate +and idiosyncratic shocks of each type.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+get_controls()#
+

Calculates consumption for each consumer of this type using the consumption functions.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+get_MaggNow()#
+
+ +
+
+market_action()#
+

In the aggregate shocks model, the “market action” is to simulate one +period of receiving income and choosing how much to consume.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+calc_bounding_values()#
+

Calculate human wealth plus minimum and maximum MPC in an infinite +horizon model with only one period repeated indefinitely. Store results +as attributes of self. Human wealth is the present discounted value of +expected future income after receiving income this period, ignoring mort- +ality. The maximum MPC is the limit of the MPC as m –> mNrmMin. The +minimum MPC is the limit of the MPC as m –> infty.

+

NOT YET IMPLEMENTED FOR THIS CLASS

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+make_euler_error_func(mMax=100, approx_inc_dstn=True)#
+

Creates a “normalized Euler error” function for this instance, mapping +from market resources to “consumption error per dollar of consumption.” +Stores result in attribute eulerErrorFunc as an interpolated function. +Has option to use approximate income distribution stored in self.IncShkDstn +or to use a (temporary) very dense approximation.

+

NOT YET IMPLEMENTED FOR THIS CLASS

+
+
Parameters:
+
    +
  • mMax (float) – Maximum normalized market resources for the Euler error function.

  • +
  • approx_inc_dstn (Boolean) – Indicator for whether to use the approximate discrete income distri- +bution stored in self.IncShkDstn[0], or to use a very accurate +discrete approximation instead. When True, uses approximation in +IncShkDstn; when False, makes and uses a very dense approximation.

  • +
+
+
Return type:
+

None

+
+
+

Notes

+

This method is not used by any other code in the library. Rather, it is here +for expository and benchmarking purposes.

+
+ +
+ +
+
+class HARK.ConsumptionSaving.ConsAggShockModel.AggShockMarkovConsumerType(**kwds)#
+

Bases: AggShockConsumerType

+

A class for representing ex ante heterogeneous “types” of consumers who +experience both aggregate and idiosyncratic shocks to productivity (both +permanent and transitory), who lives in an environment where the macroeconomic +state is subject to Markov-style discrete state evolution.

+
+
+add_AggShkDstn(AggShkDstn)#
+

Variation on AggShockConsumerType.add_AggShkDstn that handles the Markov +state. AggShkDstn is a list of aggregate productivity shock distributions +for each Markov state.

+
+ +
+
+update_solution_terminal()#
+

Update the terminal period solution. This method should be run when a +new AgentType is created or when CRRA changes.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+reset_rng()#
+

Reset the RNG behavior of this type. This method is called automatically +by initialize_sim(), ensuring that each simulation run uses the same sequence +of random shocks; this is necessary for structural estimation to work. +This method extends AgentType.reset_rng() to also reset elements of IncShkDstn.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+get_shocks()#
+

Gets permanent and transitory income shocks for this period. Samples from IncShkDstn for +each period in the cycle. This is a copy-paste from IndShockConsumerType, with the +addition of the Markov macroeconomic state. Unfortunately, the get_shocks method for +MarkovConsumerType cannot be used, as that method assumes that MrkvNow is a vector +with a value for each agent, not just a single int.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+get_controls()#
+

Calculates consumption for each consumer of this type using the consumption functions. +For this AgentType class, MrkvNow is the same for all consumers. However, in an +extension with “macroeconomic inattention”, consumers might misperceive the state +and thus act as if they are in different states.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+getMrkvNow()#
+
+ +
+ +
+
+class HARK.ConsumptionSaving.ConsAggShockModel.CobbDouglasEconomy(agents=None, tolerance=0.0001, act_T=1200, **kwds)#
+

Bases: Market

+

A class to represent an economy with a Cobb-Douglas aggregate production +function over labor and capital, extending HARK.Market. The “aggregate +market process” for this market combines all individuals’ asset holdings +into aggregate capital, yielding the interest factor on assets and the wage +rate for the upcoming period.

+

Note: The current implementation assumes a constant labor supply, but +this will be generalized in the future.

+
+
Parameters:
+
    +
  • agents ([ConsumerType]) – List of types of consumers that live in this economy.

  • +
  • tolerance (float) – Minimum acceptable distance between “dynamic rules” to consider the +solution process converged. Distance depends on intercept and slope +of the log-linear “next capital ratio” function.

  • +
  • act_T (int) – Number of periods to simulate when making a history of of the market.

  • +
+
+
+
+
+mill_rule(aLvl, pLvl)#
+

Function to calculate the capital to labor ratio, interest factor, and +wage rate based on each agent’s current state. Just calls calc_R_and_W().

+

See documentation for calc_R_and_W for more information.

+
+ +
+
+calc_dynamics(MaggNow, AaggNow)#
+

Calculates a new dynamic rule for the economy: end of period savings as +a function of aggregate market resources. Just calls calc_AFunc().

+

See documentation for calc_AFunc for more information.

+
+ +
+
+update()#
+

Use primitive parameters (and perfect foresight calibrations) to make +interest factor and wage rate functions (of capital to labor ratio), +as well as discrete approximations to the aggregate shock distributions.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+get_PermGroFacAggLR()#
+

A trivial function that returns self.PermGroFacAgg. Exists to be overwritten +and extended by ConsAggShockMarkov model.

+
+
Parameters:
+

None

+
+
Returns:
+

PermGroFacAggLR – Long run aggregate permanent income growth, which is the same thing +as aggregate permanent income growth.

+
+
Return type:
+

float

+
+
+
+ +
+
+make_AggShkDstn()#
+

Creates the attributes TranShkAggDstn, PermShkAggDstn, and AggShkDstn. +Draws on attributes TranShkAggStd, PermShkAddStd, TranShkAggCount, PermShkAggCount.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+reset()#
+

Reset the economy to prepare for a new simulation. Sets the time index +of aggregate shocks to zero and runs Market.reset().

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+make_AggShkHist()#
+

Make simulated histories of aggregate transitory and permanent shocks. +Histories are of length self.act_T, for use in the general equilibrium +simulation.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+calc_R_and_W(aLvlNow, pLvlNow)#
+

Calculates the interest factor and wage rate this period using each agent’s +capital stock to get the aggregate capital ratio.

+
+
Parameters:
+

aLvlNow ([np.array]) – Agents’ current end-of-period assets. Elements of the list correspond +to types in the economy, entries within arrays to agents of that type.

+
+
Returns:
+

    +
  • MaggNow (float) – Aggregate market resources for this period normalized by mean permanent income

  • +
  • AaggNow (float) – Aggregate savings for this period normalized by mean permanent income

  • +
  • RfreeNow (float) – Interest factor on assets in the economy this period.

  • +
  • wRteNow (float) – Wage rate for labor in the economy this period.

  • +
  • PermShkAggNow (float) – Permanent shock to aggregate labor productivity this period.

  • +
  • TranShkAggNow (float) – Transitory shock to aggregate labor productivity this period.

  • +
  • KtoLnow (float) – Capital-to-labor ratio in the economy this period.

  • +
+

+
+
+
+ +
+
+calc_AFunc(MaggNow, AaggNow)#
+

Calculate a new aggregate savings rule based on the history +of the aggregate savings and aggregate market resources from a simulation.

+
+
Parameters:
+
    +
  • MaggNow ([float]) – List of the history of the simulated aggregate market resources for an economy.

  • +
  • AaggNow ([float]) – List of the history of the simulated aggregate savings for an economy.

  • +
+
+
Returns:
+

(unnamed) – Object containing a new savings rule

+
+
Return type:
+

CapDynamicRule

+
+
+
+ +
+ +
+
+class HARK.ConsumptionSaving.ConsAggShockModel.SmallOpenEconomy(agents=None, tolerance=0.0001, act_T=1000, **kwds)#
+

Bases: Market

+

A class for representing a small open economy, where the wage rate and interest rate are +exogenously determined by some “global” rate. However, the economy is still subject to +aggregate productivity shocks.

+
+
Parameters:
+
    +
  • agents ([ConsumerType]) – List of types of consumers that live in this economy.

  • +
  • tolerance (float) – Minimum acceptable distance between “dynamic rules” to consider the +solution process converged. Distance depends on intercept and slope +of the log-linear “next capital ratio” function.

  • +
  • act_T (int) – Number of periods to simulate when making a history of of the market.

  • +
+
+
+
+
+update()#
+

Use primitive parameters to set basic objects. +This is an extremely stripped-down version +of update for CobbDouglasEconomy.

+
+
Parameters:
+

none

+
+
Return type:
+

none

+
+
+
+ +
+
+make_AggShkDstn()#
+

Creates the attributes TranShkAggDstn, PermShkAggDstn, and AggShkDstn. +Draws on attributes TranShkAggStd, PermShkAddStd, TranShkAggCount, PermShkAggCount.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+mill_rule()#
+

No aggregation occurs for a small open economy, because the wage and interest rates are +exogenously determined. However, aggregate shocks may occur.

+

See documentation for get_AggShocks() for more information.

+
+ +
+
+calc_dynamics(KtoLnow)#
+

Calculates a new dynamic rule for the economy, which is just an empty object. +There is no “dynamic rule” for a small open economy, because K/L does not generate w and R.

+
+ +
+
+reset()#
+

Reset the economy to prepare for a new simulation. Sets the time index of aggregate shocks +to zero and runs Market.reset(). This replicates the reset method for CobbDouglasEconomy; +future version should create parent class of that class and this one.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+make_AggShkHist()#
+

Make simulated histories of aggregate transitory and permanent shocks. Histories are of +length self.act_T, for use in the general equilibrium simulation. This replicates the same +method for CobbDouglasEconomy; future version should create parent class.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+get_AggShocks()#
+

Returns aggregate state variables and shocks for this period. The capital-to-labor ratio +is irrelevant and thus treated as constant, and the wage and interest rates are also +constant. However, aggregate shocks are assigned from a prespecified history.

+
+
Parameters:
+

None

+
+
Returns:
+

    +
  • MaggNow (float) – Aggregate market resources for this period normalized by mean permanent income

  • +
  • AaggNow (float) – Aggregate savings for this period normalized by mean permanent income

  • +
  • RfreeNow (float) – Interest factor on assets in the economy this period.

  • +
  • wRteNow (float) – Wage rate for labor in the economy this period.

  • +
  • PermShkAggNow (float) – Permanent shock to aggregate labor productivity this period.

  • +
  • TranShkAggNow (float) – Transitory shock to aggregate labor productivity this period.

  • +
  • KtoLnow (float) – Capital-to-labor ratio in the economy this period.

  • +
+

+
+
+
+ +
+ +
+
+class HARK.ConsumptionSaving.ConsAggShockModel.CobbDouglasMarkovEconomy(agents=None, tolerance=0.0001, act_T=1200, sow_vars=['MaggNow', 'AaggNow', 'RfreeNow', 'wRteNow', 'PermShkAggNow', 'TranShkAggNow', 'KtoLnow', 'Mrkv'], **kwds)#
+

Bases: CobbDouglasEconomy

+

A class to represent an economy with a Cobb-Douglas aggregate production +function over labor and capital, extending HARK.Market. The “aggregate +market process” for this market combines all individuals’ asset holdings +into aggregate capital, yielding the interest factor on assets and the wage +rate for the upcoming period. This small extension incorporates a Markov +state for the “macroeconomy”, so that the shock distribution and aggregate +productivity growth factor can vary over time.

+
+
Parameters:
+
    +
  • agents ([ConsumerType]) – List of types of consumers that live in this economy.

  • +
  • tolerance (float) – Minimum acceptable distance between “dynamic rules” to consider the +solution process converged. Distance depends on intercept and slope +of the log-linear “next capital ratio” function.

  • +
  • act_T (int) – Number of periods to simulate when making a history of of the market.

  • +
+
+
+
+
+update()#
+

Use primitive parameters (and perfect foresight calibrations) to make +interest factor and wage rate functions (of capital to labor ratio), +as well as discrete approximations to the aggregate shock distributions.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+get_PermGroFacAggLR()#
+

Calculates and returns the long run permanent income growth factor. This +is the average growth factor in self.PermGroFacAgg, weighted by the long +run distribution of Markov states (as determined by self.MrkvArray).

+
+
Parameters:
+

None

+
+
Returns:
+

PermGroFacAggLR – Long run aggregate permanent income growth factor

+
+
Return type:
+

float

+
+
+
+ +
+
+make_AggShkDstn()#
+

Creates the attributes TranShkAggDstn, PermShkAggDstn, and AggShkDstn. +Draws on attributes TranShkAggStd, PermShkAddStd, TranShkAggCount, PermShkAggCount. +This version accounts for the Markov macroeconomic state.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+make_AggShkHist()#
+

Make simulated histories of aggregate transitory and permanent shocks. +Histories are of length self.act_T, for use in the general equilibrium +simulation. Draws on history of aggregate Markov states generated by +internal call to make_Mrkv_history().

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+make_Mrkv_history()#
+

Makes a history of macroeconomic Markov states, stored in the attribute +MrkvNow_hist. This version ensures that each state is reached a sufficient +number of times to have a valid sample for calc_dynamics to produce a good +dynamic rule. It will sometimes cause act_T to be increased beyond its +initially specified level.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+mill_rule(aLvl, pLvl)#
+

Function to calculate the capital to labor ratio, interest factor, and +wage rate based on each agent’s current state. Just calls calc_R_and_W() +and adds the Markov state index.

+

See documentation for calc_R_and_W for more information.

+
+

Params#

+

aLvl : float +pLvl : float

+
+
returns:
+
    +
  • Mnow (float) – Aggregate market resources for this period.

  • +
  • Aprev (float) – Aggregate savings for the prior period.

  • +
  • KtoLnow (float) – Capital-to-labor ratio in the economy this period.

  • +
  • Rnow (float) – Interest factor on assets in the economy this period.

  • +
  • Wnow (float) – Wage rate for labor in the economy this period.

  • +
  • MrkvNow (int) – Binary indicator for bad (0) or good (1) macroeconomic state.

  • +
+
+
+
+
+ +
+
+calc_AFunc(MaggNow, AaggNow)#
+

Calculate a new aggregate savings rule based on the history of the +aggregate savings and aggregate market resources from a simulation. +Calculates an aggregate saving rule for each macroeconomic Markov state.

+
+
Parameters:
+
    +
  • MaggNow ([float]) – List of the history of the simulated aggregate market resources for an economy.

  • +
  • AaggNow ([float]) – List of the history of the simulated aggregate savings for an economy.

  • +
+
+
Returns:
+

(unnamed) – Object containing new saving rules for each Markov state.

+
+
Return type:
+

CapDynamicRule

+
+
+
+ +
+ +
+
+class HARK.ConsumptionSaving.ConsAggShockModel.SmallOpenMarkovEconomy(agents=None, tolerance=0.0001, act_T=1000, **kwds)#
+

Bases: CobbDouglasMarkovEconomy, SmallOpenEconomy

+

A class for representing a small open economy, where the wage rate and interest rate are +exogenously determined by some “global” rate. However, the economy is still subject to +aggregate productivity shocks. This version supports a discrete Markov state. All +methods in this class inherit from the two parent classes.

+
+
+update()#
+

Use primitive parameters (and perfect foresight calibrations) to make +interest factor and wage rate functions (of capital to labor ratio), +as well as discrete approximations to the aggregate shock distributions.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+make_AggShkDstn()#
+

Creates the attributes TranShkAggDstn, PermShkAggDstn, and AggShkDstn. +Draws on attributes TranShkAggStd, PermShkAddStd, TranShkAggCount, PermShkAggCount. +This version accounts for the Markov macroeconomic state.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+mill_rule()#
+

Function to calculate the capital to labor ratio, interest factor, and +wage rate based on each agent’s current state. Just calls calc_R_and_W() +and adds the Markov state index.

+

See documentation for calc_R_and_W for more information.

+
+

Params#

+

aLvl : float +pLvl : float

+
+
returns:
+
    +
  • Mnow (float) – Aggregate market resources for this period.

  • +
  • Aprev (float) – Aggregate savings for the prior period.

  • +
  • KtoLnow (float) – Capital-to-labor ratio in the economy this period.

  • +
  • Rnow (float) – Interest factor on assets in the economy this period.

  • +
  • Wnow (float) – Wage rate for labor in the economy this period.

  • +
  • MrkvNow (int) – Binary indicator for bad (0) or good (1) macroeconomic state.

  • +
+
+
+
+
+ +
+
+calc_dynamics(KtoLnow)#
+

Calculates a new dynamic rule for the economy: end of period savings as +a function of aggregate market resources. Just calls calc_AFunc().

+

See documentation for calc_AFunc for more information.

+
+ +
+
+make_AggShkHist()#
+

Make simulated histories of aggregate transitory and permanent shocks. +Histories are of length self.act_T, for use in the general equilibrium +simulation. Draws on history of aggregate Markov states generated by +internal call to make_Mrkv_history().

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+ +
+
+class HARK.ConsumptionSaving.ConsAggShockModel.AggregateSavingRule(intercept, slope)#
+

Bases: MetricObject

+

A class to represent agent beliefs about aggregate saving at the end of this period (AaggNow) as +a function of (normalized) aggregate market resources at the beginning of the period (MaggNow).

+
+
Parameters:
+
    +
  • intercept (float) – Intercept of the log-linear capital evolution rule.

  • +
  • slope (float) – Slope of the log-linear capital evolution rule.

  • +
+
+
+
+ +
+
+class HARK.ConsumptionSaving.ConsAggShockModel.AggShocksDynamicRule(AFunc)#
+

Bases: MetricObject

+

Just a container class for passing the dynamic rule in the aggregate shocks model to agents.

+
+
Parameters:
+

AFunc (CapitalEvoRule) – Aggregate savings as a function of aggregate market resources.

+
+
+
+ +
+ + +
+ + + + + + + +
+ + + + +
+ + +
+ + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/Documentation/reference/ConsumptionSaving/ConsBequestModel.html b/Documentation/reference/ConsumptionSaving/ConsBequestModel.html new file mode 100644 index 000000000..b1fc1da0d --- /dev/null +++ b/Documentation/reference/ConsumptionSaving/ConsBequestModel.html @@ -0,0 +1,987 @@ + + + + + + + + + + + ConsBequestModel — HARK latest documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+
+ + + + +
+ + + + + + + + + + + + + +
+ +
+ + +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ +
+

ConsBequestModel#

+

Classes to solve consumption-saving models with a bequest motive and +idiosyncratic shocks to income and wealth. All models here assume +separable CRRA utility of consumption and Stone-Geary utility of +savings with geometric discounting of the continuation value and +shocks to income that have transitory and/or permanent components.

+
+
It currently solves two types of models:
    +
  1. A standard lifecycle model with a terminal and/or accidental bequest motive.

  2. +
  3. A portfolio choice model with a terminal and/or accidental bequest motive.

  4. +
+
+
+
+
+HARK.ConsumptionSaving.ConsBequestModel.make_bequest_solution_terminal(CRRA, BeqCRRATerm, BeqFacTerm, BeqShiftTerm, aXtraGrid)#
+

Make the terminal period solution when there is a warm glow bequest motive with +Stone-Geary form utility. If there is no warm glow bequest motive (BeqFacTerm = 0), +then the terminal period solution is identical to ConsIndShock.

+
+
Parameters:
+
    +
  • CRRA (float) – Coefficient on relative risk aversion over consumption.

  • +
  • BeqCRRATerm (float) – Coefficient on relative risk aversion in the terminal warm glow bequest motive.

  • +
  • BeqFacTerm (float) – Scaling factor for the terminal warm glow bequest motive.

  • +
  • BeqShiftTerm (float) – Stone-Geary shifter term for the terminal warm glow bequest motive.

  • +
  • aXtraGrid (np.array) – Set of assets-above-minimum to be used in the solution.

  • +
+
+
Returns:
+

solution_terminal – Terminal period solution when there is a warm glow bequest.

+
+
Return type:
+

ConsumerSolution

+
+
+
+ +
+
+HARK.ConsumptionSaving.ConsBequestModel.make_warmglow_portfolio_solution_terminal(CRRA, BeqCRRATerm, BeqFacTerm, BeqShiftTerm, aXtraGrid)#
+

Make the terminal period solution when there is a warm glow bequest motive with +Stone-Geary form utility and portfolio choice. If there is no warm glow bequest +motive (BeqFacTerm = 0), then the terminal period solution is identical to ConsPortfolio.

+
+
Parameters:
+
    +
  • CRRA (float) – Coefficient on relative risk aversion over consumption.

  • +
  • BeqCRRATerm (float) – Coefficient on relative risk aversion in the terminal warm glow bequest motive.

  • +
  • BeqFacTerm (float) – Scaling factor for the terminal warm glow bequest motive.

  • +
  • BeqShiftTerm (float) – Stone-Geary shifter term for the terminal warm glow bequest motive.

  • +
  • aXtraGrid (np.array) – Set of assets-above-minimum to be used in the solution.

  • +
+
+
Returns:
+

solution_terminal – Terminal period solution when there is a warm glow bequest and portfolio choice.

+
+
Return type:
+

ConsumerSolution

+
+
+
+ +
+
+class HARK.ConsumptionSaving.ConsBequestModel.BequestWarmGlowConsumerType(**kwds)#
+

Bases: IndShockConsumerType

+

A consumer type with based on IndShockConsumerType, with an additional bequest motive. +They gain utility for any wealth they leave when they die, according to a Stone-Geary utility.

+
+\[\begin{split}\newcommand{\CRRA}{\rho} +\newcommand{\DiePrb}{\mathsf{D}} +\newcommand{\PermGroFac}{\Gamma} +\newcommand{\Rfree}{\mathsf{R}} +\newcommand{\DiscFac}{\beta} +\begin{align*} +v_t(m_t) &= \max_{c_t}u(c_t) + \DiePrb_{t+1} u_{Beq}(a_t)+\DiscFac (1 - \DiePrb_{t+1}) \mathbb{E}_{t} \left[ (\PermGroFac_{t+1} \psi_{t+1})^{1-\CRRA} v_{t+1}(m_{t+1}) \right], \\ +& \text{s.t.} \\ +a_t &= m_t - c_t, \\ +a_t &\geq \underline{a}, \\ +m_{t+1} &= a_t \Rfree_{t+1}/(\PermGroFac_{t+1} \psi_{t+1}) + \theta_{t+1}, \\ +(\psi_{t+1},\theta_{t+1}) &\sim F_{t+1}, \\ +\mathbb{E}[\psi]=\mathbb{E}[\theta] &= 1, \\ +u(c) &= \frac{c^{1-\CRRA}}{1-\CRRA} \\ +u_{Beq} (a) &= \textbf{BeqFac} \frac{(a+\textbf{BeqShift})^{1-\CRRA_{Beq}}}{1-\CRRA_{Beq}} \\ +\end{align*}\end{split}\]
+
+
Constructors:
+
+
+
Solving Parameters:
+
    +
  • cycles (int) – 0 specifies an infinite horizon model, 1 specifies a finite model.

  • +
  • T_cycle (int) – Number of periods in the cycle for this agent type.

  • +
  • CRRA (float, \(\rho\)) – Coefficient of Relative Risk Aversion.

  • +
  • BeqCRRA (float, \(\rho_{Beq}\)) – Coefficient of Relative Risk Aversion for the bequest motive. +If this value isn’t the same as CRRA, then the model can only be represented as a Bellman equation. +This may cause unintented behavior.

  • +
  • BeqCRRATerm (float, \(\rho_{Beq}\)) – The Coefficient of Relative Risk Aversion for the bequest motive, but only in the terminal period. +In most cases this should be the same as beqCRRA.

  • +
  • BeqShift (float, \(\textbf{BeqShift}\)) – The Shift term from the bequest motive’s utility function. +If this value isn’t 0, then the model can only be represented as a Bellman equation. +This may cause unintented behavior.

  • +
  • BeqShiftTerm (float, \(\textbf{BeqShift}\)) – The shift term from the bequest motive’s utility function, in the terminal period. +In most cases this should be the same as beqShift

  • +
  • BeqFac (float, \(\textbf{BeqFac}\)) – The weight for the bequest’s utility function.

  • +
  • Rfree (float or list[float], time varying, \(\mathsf{R}\)) – Risk Free interest rate. Pass a list of floats to make Rfree time varying.

  • +
  • DiscFac (float, \(\beta\)) – Intertemporal discount factor.

  • +
  • LivPrb (list[float], time varying, \(1-\mathsf{D}\)) – Survival probability after each period.

  • +
  • PermGroFac (list[float], time varying, \(\Gamma\)) – Permanent income growth factor.

  • +
  • BoroCnstArt (float, \(\underline{a}\)) – The minimum Asset/Perminant Income ratio, None to ignore.

  • +
  • vFuncBool (bool) – Whether to calculate the value function during solution.

  • +
  • CubicBool (bool) – Whether to use cubic spline interpoliation.

  • +
+
+
Simulation Parameters:
+
    +
  • AgentCount (int) – Number of agents of this kind that are created during simulations.

  • +
  • T_age (int) – Age after which to automatically kill agents, None to ignore.

  • +
  • T_sim (int, required for simulation) – Number of periods to simulate.

  • +
  • track_vars (list[strings]) – List of variables that should be tracked when running the simulation. +For this agent, the options are ‘PermShk’, ‘TranShk’, ‘aLvl’, ‘aNrm’, ‘bNrm’, ‘cNrm’, ‘mNrm’, ‘pLvl’, and ‘who_dies’.

    +

    PermShk is the agent’s permanent income shock

    +

    TranShk is the agent’s transitory income shock

    +

    aLvl is the nominal asset level

    +

    aNrm is the normalized assets

    +

    bNrm is the normalized resources without this period’s labor income

    +

    cNrm is the normalized consumption

    +

    mNrm is the normalized market resources

    +

    pLvl is the permanent income level

    +

    who_dies is the array of which agents died

    +
  • +
  • aNrmInitMean (float) – Mean of Log initial Normalized Assets.

  • +
  • aNrmInitStd (float) – Std of Log initial Normalized Assets.

  • +
  • pLvlInitMean (float) – Mean of Log initial permanent income.

  • +
  • pLvlInitStd (float) – Std of Log initial permanent income.

  • +
  • PermGroFacAgg (float) – Aggregate permanent income growth factor (The portion of PermGroFac attributable to aggregate productivity growth).

  • +
  • PerfMITShk (boolean) – Do Perfect Foresight MIT Shock (Forces Newborns to follow solution path of the agent they replaced if True).

  • +
  • NewbornTransShk (boolean) – Whether Newborns have transitory shock.

  • +
+
+
Attributes:
+
    +
  • solution (list[Consumer solution object]) – Created by the solve() method. Finite horizon models create a list with T_cycle+1 elements, for each period in the solution. +Infinite horizon solutions return a list with T_cycle elements for each period in the cycle.

    +

    Visit HARK.ConsumptionSaving.ConsIndShockModel.ConsumerSolution for more information about the solution.

    +
  • +
  • history (Dict[Array]) – Created by running the simulate() method. +Contains the variables in track_vars. Each item in the dictionary is an array with the shape (T_sim,AgentCount). +Visit HARK.core.AgentType.simulate for more information.

  • +
+
+
+
+
+time_inv_ = ['CRRA', 'DiscFac', 'BoroCnstArt', 'BoroCnstArt', 'vFuncBool', 'CubicBool', 'BeqCRRA', 'BeqShift', 'BeqFac']#
+
+ +
+ +
+
+HARK.ConsumptionSaving.ConsBequestModel.solve_one_period_ConsWarmBequest(solution_next, IncShkDstn, LivPrb, DiscFac, CRRA, Rfree, PermGroFac, BoroCnstArt, aXtraGrid, BeqCRRA, BeqFac, BeqShift, CubicBool, vFuncBool)#
+

Solves one period of a consumption-saving model with idiosyncratic shocks to +permanent and transitory income, with one risk free asset and CRRA utility. +The consumer also has a “warm glow” bequest motive in which they gain additional +utility based on their terminal wealth upon death.

+
+
Parameters:
+
    +
  • solution_next (ConsumerSolution) – The solution to next period’s one period problem.

  • +
  • IncShkDstn (distribution.Distribution) – A discrete approximation to the income process between the period being +solved and the one immediately following (in solution_next).

  • +
  • LivPrb (float) – Survival probability; likelihood of being alive at the beginning of +the succeeding period.

  • +
  • DiscFac (float) – Intertemporal discount factor for future utility.

  • +
  • CRRA (float) – Coefficient of relative risk aversion.

  • +
  • Rfree (float) – Risk free interest factor on end-of-period assets.

  • +
  • PermGroFac (float) – Expected permanent income growth factor at the end of this period.

  • +
  • BoroCnstArt (float or None) – Borrowing constraint for the minimum allowable assets to end the +period with. If it is less than the natural borrowing constraint, +then it is irrelevant; BoroCnstArt=None indicates no artificial bor- +rowing constraint.

  • +
  • aXtraGrid (np.array) – Array of “extra” end-of-period asset values– assets above the +absolute minimum acceptable level.

  • +
  • BeqCRRA (float) – Coefficient of relative risk aversion for warm glow bequest motive.

  • +
  • BeqFac (float) – Multiplicative intensity factor for the warm glow bequest motive.

  • +
  • BeqShift (float) – Stone-Geary shifter in the warm glow bequest motive.

  • +
  • CubicBool (bool) – An indicator for whether the solver should use cubic or linear interpolation.

  • +
  • vFuncBool (boolean) – An indicator for whether the value function should be computed and +included in the reported solution.

  • +
+
+
Returns:
+

solution_now – Solution to this period’s consumption-saving problem with income risk.

+
+
Return type:
+

ConsumerSolution

+
+
+
+ +
+
+HARK.ConsumptionSaving.ConsBequestModel.solve_one_period_ConsPortfolioWarmGlow(solution_next, IncShkDstn, RiskyDstn, LivPrb, DiscFac, CRRA, Rfree, PermGroFac, BoroCnstArt, aXtraGrid, ShareGrid, AdjustPrb, ShareLimit, vFuncBool, DiscreteShareBool, BeqCRRA, BeqFac, BeqShift)#
+

Solve one period of a consumption-saving problem with portfolio allocation +between a riskless and risky asset. This function handles various sub-cases +or variations on the problem, including the possibility that the agent does +not necessarily get to update their portfolio share in every period, or that +they must choose a discrete rather than continuous risky share.

+
+
Parameters:
+
    +
  • solution_next (PortfolioSolution) – Solution to next period’s problem.

  • +
  • ShockDstn (Distribution) – Joint distribution of permanent income shocks, transitory income shocks, +and risky returns. This is only used if the input IndepDstnBool is False, +indicating that income and return distributions can’t be assumed to be +independent.

  • +
  • IncShkDstn (Distribution) – Discrete distribution of permanent income shocks and transitory income +shocks. This is only used if the input IndepDstnBool is True, indicating +that income and return distributions are independent.

  • +
  • RiskyDstn (Distribution) – Distribution of risky asset returns. This is only used if the input +IndepDstnBool is True, indicating that income and return distributions +are independent.

  • +
  • LivPrb (float) – Survival probability; likelihood of being alive at the beginning of +the succeeding period.

  • +
  • DiscFac (float) – Intertemporal discount factor for future utility.

  • +
  • CRRA (float) – Coefficient of relative risk aversion.

  • +
  • Rfree (float) – Risk free interest factor on end-of-period assets.

  • +
  • PermGroFac (float) – Expected permanent income growth factor at the end of this period.

  • +
  • BoroCnstArt (float or None) – Borrowing constraint for the minimum allowable assets to end the +period with. In this model, it is required to be zero.

  • +
  • aXtraGrid (np.array) – Array of “extra” end-of-period asset values– assets above the +absolute minimum acceptable level.

  • +
  • ShareGrid (np.array) – Array of risky portfolio shares on which to define the interpolation +of the consumption function when Share is fixed. Also used when the +risky share choice is specified as discrete rather than continuous.

  • +
  • AdjustPrb (float) – Probability that the agent will be able to update his portfolio share.

  • +
  • ShareLimit (float) – Limiting lower bound of risky portfolio share as mNrm approaches infinity.

  • +
  • vFuncBool (boolean) – An indicator for whether the value function should be computed and +included in the reported solution.

  • +
  • DiscreteShareBool (bool) – Indicator for whether risky portfolio share should be optimized on the +continuous [0,1] interval using the FOC (False), or instead only selected +from the discrete set of values in ShareGrid (True). If True, then +vFuncBool must also be True.

  • +
  • IndepDstnBool (bool) – Indicator for whether the income and risky return distributions are in- +dependent of each other, which can speed up the expectations step.

  • +
  • BeqCRRA (float) – Coefficient of relative risk aversion for warm glow bequest motive.

  • +
  • BeqFac (float) – Multiplicative intensity factor for the warm glow bequest motive.

  • +
  • BeqShift (float) – Stone-Geary shifter in the warm glow bequest motive.

  • +
+
+
Returns:
+

solution_now – Solution to this period’s problem.

+
+
Return type:
+

PortfolioSolution

+
+
+
+ +
+
+class HARK.ConsumptionSaving.ConsBequestModel.BequestWarmGlowPortfolioType(**kwds)#
+

Bases: PortfolioConsumerType

+

A consumer type with based on PortfolioConsumerType, with an additional bequest motive. +They gain utility for any wealth they leave when they die, according to a Stone-Geary utility.

+
+\[\begin{split}\newcommand{\CRRA}{\rho} +\newcommand{\DiePrb}{\mathsf{D}} +\newcommand{\PermGroFac}{\Gamma} +\newcommand{\Rfree}{\mathsf{R}} +\newcommand{\DiscFac}{\beta} +\begin{align*} +v_t(m_t,S_t) &= \max_{c_t,S^{*}_t} u(c_t) + \DiePrb_{t+1} u_{Beq}(a_t)+ \DiscFac (1-\DiePrb_{t+1}) \mathbb{E}_{t} \left[(\PermGroFac_{t+1}\psi_{t+1})^{1-\CRRA} v_{t+1}(m_{t+1},S_{t+1}) \right], \\ +& \text{s.t.} \\ +a_t &= m_t - c_t, \\ +a_t &\geq \underline{a}, \\ +m_{t+1} &= \mathsf{R}_{t+1}/(\PermGroFac_{t+1} \psi_{t+1}) a_t + \theta_{t+1}, \\ +\mathsf{R}_{t+1} &=S_t\phi_{t+1}\mathbf{R}_{t+1}+ (1-S_t)\mathsf{R}_{t+1}, \\ +S_{t+1} &= \begin{cases} +S^{*}_t & \text{if } p_t < \wp\\ +S_t & \text{if } p_t \geq \wp, +\end{cases}\\ +(\psi_{t+1},\theta_{t+1},\phi_{t+1},p_t) &\sim F_{t+1}, \\ +\mathbb{E}[\psi]=\mathbb{E}[\theta] &= 1. \\ +u(c) &= \frac{c^{1-\CRRA}}{1-\CRRA} \\ +u_{Beq} (a) &= \textbf{BeqFac} \frac{(a+\textbf{BeqShift})^{1-\CRRA_{Beq}}}{1-\CRRA_{Beq}} \\ +\end{align*}\end{split}\]
+
+
Constructors:
+
+
+
Solving Parameters:
+
    +
  • cycles (int) – 0 specifies an infinite horizon model, 1 specifies a finite model.

  • +
  • T_cycle (int) – Number of periods in the cycle for this agent type.

  • +
  • CRRA (float, \(\rho\)) – Coefficient of Relative Risk Aversion.

  • +
  • BeqCRRA (float, \(\rho_{Beq}\)) – Coefficient of Relative Risk Aversion for the bequest motive. +If this value isn’t the same as CRRA, then the model can only be represented as a Bellman equation. +This may cause unintented behavior.

  • +
  • BeqCRRATerm (float, \(\rho_{Beq}\)) – The Coefficient of Relative Risk Aversion for the bequest motive, but only in the terminal period. +In most cases this should be the same as beqCRRA.

  • +
  • BeqShift (float, \(\textbf{BeqShift}\)) – The Shift term from the bequest motive’s utility function. +If this value isn’t 0, then the model can only be represented as a Bellman equation. +This may cause unintented behavior.

  • +
  • BeqShiftTerm (float, \(\textbf{BeqShift}\)) – The shift term from the bequest motive’s utility function, in the terminal period. +In most cases this should be the same as beqShift

  • +
  • BeqFac (float, \(\textbf{BeqFac}\)) – The weight for the bequest’s utility function.

  • +
  • Rfree (float or list[float], time varying, \(\mathsf{R}\)) – Risk Free interest rate. Pass a list of floats to make Rfree time varying.

  • +
  • DiscFac (float, \(\beta\)) – Intertemporal discount factor.

  • +
  • LivPrb (list[float], time varying, \(1-\mathsf{D}\)) – Survival probability after each period.

  • +
  • PermGroFac (list[float], time varying, \(\Gamma\)) – Permanent income growth factor.

  • +
  • BoroCnstArt (float, default=0.0, \(\underline{a}\)) – The minimum Asset/Perminant Income ratio. for this agent, BoroCnstArt must be 0.

  • +
  • vFuncBool (bool) – Whether to calculate the value function during solution.

  • +
  • CubicBool (bool) – Whether to use cubic spline interpoliation.

  • +
  • AdjustPrb (float or list[float], time varying) – Must be between 0 and 1. Probability that the agent can update their risky portfolio share each period. Pass a list of floats to make AdjustPrb time varying.

  • +
+
+
Simulation Parameters:
+
    +
  • sim_common_Rrisky (Boolean) – Whether risky returns have a shared/common value across agents. If True, Risky return’s can’t be time varying.

  • +
  • AgentCount (int) – Number of agents of this kind that are created during simulations.

  • +
  • T_age (int) – Age after which to automatically kill agents, None to ignore.

  • +
  • T_sim (int, required for simulation) – Number of periods to simulate.

  • +
  • track_vars (list[strings]) – List of variables that should be tracked when running the simulation. +For this agent, the options are ‘Adjust’, ‘PermShk’, ‘Risky’, ‘TranShk’, ‘aLvl’, ‘aNrm’, ‘bNrm’, ‘cNrm’, ‘mNrm’, ‘pLvl’, and ‘who_dies’.

    +

    Adjust is the array of which agents can adjust

    +

    PermShk is the agent’s permanent income shock

    +

    Risky is the agent’s risky asset shock

    +

    TranShk is the agent’s transitory income shock

    +

    aLvl is the nominal asset level

    +

    aNrm is the normalized assets

    +

    bNrm is the normalized resources without this period’s labor income

    +

    cNrm is the normalized consumption

    +

    mNrm is the normalized market resources

    +

    pLvl is the permanent income level

    +

    who_dies is the array of which agents died

    +
  • +
  • aNrmInitMean (float) – Mean of Log initial Normalized Assets.

  • +
  • aNrmInitStd (float) – Std of Log initial Normalized Assets.

  • +
  • pLvlInitMean (float) – Mean of Log initial permanent income.

  • +
  • pLvlInitStd (float) – Std of Log initial permanent income.

  • +
  • PermGroFacAgg (float) – Aggregate permanent income growth factor (The portion of PermGroFac attributable to aggregate productivity growth).

  • +
  • PerfMITShk (boolean) – Do Perfect Foresight MIT Shock (Forces Newborns to follow solution path of the agent they replaced if True).

  • +
  • NewbornTransShk (boolean) – Whether Newborns have transitory shock.

  • +
+
+
Attributes:
+
    +
  • solution (list[Consumer solution object]) – Created by the solve() method. Finite horizon models create a list with T_cycle+1 elements, for each period in the solution. +Infinite horizon solutions return a list with T_cycle elements for each period in the cycle.

    +

    Visit HARK.ConsumptionSaving.ConsPortfolioModel.PortfolioSolution for more information about the solution.

    +
  • +
  • history (Dict[Array]) – Created by running the simulate() method. +Contains the variables in track_vars. Each item in the dictionary is an array with the shape (T_sim,AgentCount). +Visit HARK.core.AgentType.simulate for more information.

  • +
+
+
+
+
+time_inv_ = ['CRRA', 'DiscFac', 'BoroCnstArt', 'BoroCnstArt', 'vFuncBool', 'CubicBool', 'PortfolioBisect', 'AdjustPrb', 'DiscreteShareBool', 'BeqCRRA', 'BeqShift', 'BeqFac']#
+
+ +
+ +
+ + +
+ + + + + + + +
+ + + + + + + +
+ + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/Documentation/reference/ConsumptionSaving/ConsGenIncProcessModel.html b/Documentation/reference/ConsumptionSaving/ConsGenIncProcessModel.html new file mode 100644 index 000000000..06a10bb85 --- /dev/null +++ b/Documentation/reference/ConsumptionSaving/ConsGenIncProcessModel.html @@ -0,0 +1,1205 @@ + + + + + + + + + + + ConsGenIncProcessModel — HARK latest documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+
+ + + + +
+ + + + + + + + + + + + + +
+ +
+ + +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ +
+

ConsGenIncProcessModel#

+

Classes to solve consumption-saving models with idiosyncratic shocks to income +in which shocks are not necessarily fully transitory or fully permanent. Extends +ConsIndShockModel by explicitly tracking persistent income as a state variable, +and allows (log) persistent income to follow an AR1 process rather than random walk.

+
+
+class HARK.ConsumptionSaving.ConsGenIncProcessModel.pLvlFuncAR1(pLogMean, PermGroFac, Corr)#
+

Bases: MetricObject

+

A class for representing AR1-style persistent income growth functions.

+
+
Parameters:
+
    +
  • pLogMean (float) – Log persistent income level toward which we are drawn.

  • +
  • PermGroFac (float) – Autonomous (e.g. life cycle) pLvl growth (does not AR1 decay).

  • +
  • Corr (float) – Correlation coefficient on log income.

  • +
+
+
+
+ +
+
+class HARK.ConsumptionSaving.ConsGenIncProcessModel.GenIncProcessConsumerType(**kwds)#
+

Bases: IndShockConsumerType

+

A consumer type with idiosyncratic shocks to persistent and transitory income. +Their problem is defined by a sequence of income distributions, survival prob- +abilities, and persistent income growth functions, as well as time invariant +values for risk aversion, discount factor, the interest rate, the grid of +end-of-period assets, and an artificial borrowing constraint.

+
+\[\begin{split}\begin{eqnarray*} +V_t(M_t,P_t) &=& \max_{C_t} U(C_t) + \beta (1-\mathsf{D}_{t+1}) \mathbb{E} [V_{t+1}(M_{t+1}, P_{t+1}) ], \\ +A_t &=& M_t - C_t, \\ +A_t/P_t &\geq& \underline{a}, \\ +M_{t+1} &=& R A_t + \theta_{t+1}, \\ +P_{t+1} &=& G_{t+1}(P_t)\psi_{t+1}, \\ +(\psi_{t+1},\theta_{t+1}) &\sim& F_{t+1}, \\ +\mathbb{E} [F_{t+1}] &=& 1, \\ +U(C) &=& \frac{C^{1-\rho}}{1-\rho}. \\ +\end{eqnarray*}\end{split}\]
+
+
Constructors:
+
+
+
Solving Parameters:
+
    +
  • cycles (int) – 0 specifies an infinite horizon model, 1 specifies a finite model.

  • +
  • T_cycle (int) – Number of periods in the cycle for this agent type.

  • +
  • CRRA (float, \(\rho\)) – Coefficient of Relative Risk Aversion.

  • +
  • Rfree (float or list[float], time varying, \(\mathsf{R}\)) – Risk Free interest rate. Pass a list of floats to make Rfree time varying.

  • +
  • DiscFac (float, \(\beta\)) – Intertemporal discount factor.

  • +
  • LivPrb (list[float], time varying, \(1-\mathsf{D}\)) – Survival probability after each period.

  • +
  • BoroCnstArt (float, \(\underline{a}\)) – The minimum Asset/Perminant Income ratio, None to ignore.

  • +
  • vFuncBool (bool) – Whether to calculate the value function during solution.

  • +
  • CubicBool (bool) – Whether to use cubic spline interpoliation.

  • +
+
+
Simulation Parameters:
+
    +
  • AgentCount (int) – Number of agents of this kind that are created during simulations.

  • +
  • T_age (int) – Age after which to automatically kill agents, None to ignore.

  • +
  • T_sim (int, required for simulation) – Number of periods to simulate.

  • +
  • track_vars (list[strings]) – List of variables that should be tracked when running the simulation. +For this agent, the options are ‘PermShk’, ‘TranShk’, ‘aLvl’, ‘cLvl’, ‘mLvl’, ‘pLvl’, and ‘who_dies’.

    +

    PermShk is the agent’s permanent income shock

    +

    TranShk is the agent’s transitory income shock

    +

    aLvl is the nominal asset level

    +

    cLvl is the nominal consumption level

    +

    mLvl is the nominal market resources

    +

    pLvl is the permanent income level

    +

    who_dies is the array of which agents died

    +
  • +
  • aNrmInitMean (float) – Mean of Log initial Normalized Assets.

  • +
  • aNrmInitStd (float) – Std of Log initial Normalized Assets.

  • +
  • pLvlInitMean (float) – Mean of Log initial permanent income.

  • +
  • pLvlInitStd (float) – Std of Log initial permanent income.

  • +
  • PermGroFacAgg (float) – Aggregate permanent income growth factor (The portion of PermGroFac attributable to aggregate productivity growth).

  • +
  • PerfMITShk (boolean) – Do Perfect Foresight MIT Shock (Forces Newborns to follow solution path of the agent they replaced if True).

  • +
  • NewbornTransShk (boolean) – Whether Newborns have transitory shock.

  • +
+
+
Attributes:
+
    +
  • solution (list[Consumer solution object]) – Created by the solve() method. Finite horizon models create a list with T_cycle+1 elements, for each period in the solution. +Infinite horizon solutions return a list with T_cycle elements for each period in the cycle.

    +

    Unlike other models with this solution type, this model’s variables are NOT normalized. +The solution functions also depend on the permanent income level. For example, \(C=\text{cFunc}(M,P)\). +hNrm has been replaced by hLvl which is a function of permanent income. +MPC max has not yet been implemented for this class. It will be a function of permanent income.

    +

    Visit HARK.ConsumptionSaving.ConsIndShockModel.ConsumerSolution for more information about the solution.

    +
  • +
  • history (Dict[Array]) – Created by running the simulate() method. +Contains the variables in track_vars. Each item in the dictionary is an array with the shape (T_sim,AgentCount). +Visit HARK.core.AgentType.simulate for more information.

  • +
+
+
+
+
+IncShkDstn_default = {'IncUnemp': 0.3, 'IncUnempRet': 0.0, 'PermShkCount': 7, 'PermShkStd': [0.1], 'T_retire': 0, 'TranShkCount': 7, 'TranShkStd': [0.1], 'UnempPrb': 0.05, 'UnempPrbRet': 0.005}#
+
+ +
+
+aXtraGrid_default = {'aXtraCount': 48, 'aXtraExtra': [0.005, 0.01], 'aXtraMax': 30, 'aXtraMin': 0.001, 'aXtraNestFac': 3}#
+
+ +
+
+pLvlNextFunc_default = {}#
+
+ +
+
+pLvlGrid_default = {'pLvlExtra': None, 'pLvlInitMean': 0.0, 'pLvlInitStd': 0.4}#
+
+ +
+
+pLvlPctiles_default = {'pLvlPctiles_bound': [0.05, 0.95], 'pLvlPctiles_count': 19, 'pLvlPctiles_tail_count': 4, 'pLvlPctiles_tail_order': 2.718281828459045}#
+
+ +
+
+solving_default = {'BoroCnstArt': 0.0, 'CRRA': 2.0, 'CubicBool': False, 'DiscFac': 0.96, 'LivPrb': [0.98], 'Rfree': 1.03, 'T_cycle': 1, 'constructors': {'IncShkDstn': <function construct_lognormal_income_process_unemployment>, 'PermShkDstn': <function get_PermShkDstn_from_IncShkDstn>, 'TranShkDstn': <function get_TranShkDstn_from_IncShkDstn>, 'aXtraGrid': <function make_assets_grid>, 'pLvlGrid': <function make_pLvlGrid_by_simulation>, 'pLvlNextFunc': <function make_trivial_pLvlNextFunc>, 'pLvlPctiles': <function make_basic_pLvlPctiles>, 'solution_terminal': <function make_2D_CRRA_solution_terminal>}, 'cycles': 1, 'vFuncBool': False}#
+
+ +
+
+simulation_default = {'AgentCount': 10000, 'NewbornTransShk': False, 'PerfMITShk': False, 'PermGroFacAgg': 1.0, 'T_age': None, 'aNrmInitMean': 0.0, 'aNrmInitStd': 1.0, 'neutral_measure': False, 'pLvlInitMean': 0.0, 'pLvlInitStd': 0.0}#
+
+ +
+
+state_vars = ['pLvl', 'mLvl', 'aLvl']#
+
+ +
+
+default_params_ = {'AgentCount': 10000, 'BoroCnstArt': 0.0, 'CRRA': 2.0, 'CubicBool': False, 'DiscFac': 0.96, 'IncUnemp': 0.3, 'IncUnempRet': 0.0, 'LivPrb': [0.98], 'NewbornTransShk': False, 'PerfMITShk': False, 'PermGroFacAgg': 1.0, 'PermShkCount': 7, 'PermShkStd': [0.1], 'Rfree': 1.03, 'T_age': None, 'T_cycle': 1, 'T_retire': 0, 'TranShkCount': 7, 'TranShkStd': [0.1], 'UnempPrb': 0.05, 'UnempPrbRet': 0.005, 'aNrmInitMean': 0.0, 'aNrmInitStd': 1.0, 'aXtraCount': 48, 'aXtraExtra': [0.005, 0.01], 'aXtraMax': 30, 'aXtraMin': 0.001, 'aXtraNestFac': 3, 'constructors': {'IncShkDstn': <function construct_lognormal_income_process_unemployment>, 'PermShkDstn': <function get_PermShkDstn_from_IncShkDstn>, 'TranShkDstn': <function get_TranShkDstn_from_IncShkDstn>, 'aXtraGrid': <function make_assets_grid>, 'pLvlGrid': <function make_pLvlGrid_by_simulation>, 'pLvlNextFunc': <function make_trivial_pLvlNextFunc>, 'pLvlPctiles': <function make_basic_pLvlPctiles>, 'solution_terminal': <function make_2D_CRRA_solution_terminal>}, 'cycles': 1, 'neutral_measure': False, 'pLvlExtra': None, 'pLvlInitMean': 0.0, 'pLvlInitStd': 0.0, 'pLvlPctiles_bound': [0.05, 0.95], 'pLvlPctiles_count': 19, 'pLvlPctiles_tail_count': 4, 'pLvlPctiles_tail_order': 2.718281828459045, 'vFuncBool': False}#
+
+ +
+
+pre_solve()#
+

Method that is run automatically just before solution by backward iteration. +Solves the (trivial) terminal period and does a quick check on the borrowing +constraint and MaxKinks attribute (only relevant in constrained, infinite +horizon problems).

+
+ +
+
+update()#
+

Update the income process, the assets grid, the persistent income grid, +and the terminal solution.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+update_pLvlNextFunc()#
+

Update the function that maps this period’s permanent income level to next +period’s expected permanent income level.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+install_retirement_func()#
+

Installs a special pLvlNextFunc representing retirement in the correct +element of self.pLvlNextFunc. Draws on the attributes T_retire and +pLvlNextFuncRet. If T_retire is zero or pLvlNextFuncRet does not +exist, this method does nothing. Should only be called from within the +method update_pLvlNextFunc, which ensures that time is flowing forward.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+update_pLvlGrid()#
+

Update the grid of persistent income levels.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+sim_birth(which_agents)#
+

Makes new consumers for the given indices. Initialized variables include aNrm and pLvl, as +well as time variables t_age and t_cycle. Normalized assets and persistent income levels +are drawn from lognormal distributions given by aNrmInitMean and aNrmInitStd (etc).

+
+
Parameters:
+

which_agents (np.array(Bool)) – Boolean array of size self.AgentCount indicating which agents should be “born”.

+
+
Return type:
+

None

+
+
+
+ +
+
+transition()#
+

Calculates updated values of normalized market resources +and persistent income level for each +agent. Uses pLvlNow, aLvlNow, PermShkNow, TranShkNow.

+
+
Parameters:
+

None

+
+
Returns:
+

    +
  • pLvlNow

  • +
  • mLvlNow

  • +
+

+
+
+
+ +
+
+get_controls()#
+

Calculates consumption for each consumer of this type using the consumption functions.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+get_poststates()#
+

Calculates end-of-period assets for each consumer of this type. +Identical to version in IndShockConsumerType but uses Lvl rather than Nrm variables.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+ +
+
+class HARK.ConsumptionSaving.ConsGenIncProcessModel.IndShockExplicitPermIncConsumerType(**kwds)#
+

Bases: GenIncProcessConsumerType

+

A consumer type based on GenIncProcessModel, where the general function +describing the path of permanent income multiplies the current permanent +income by the PermGroFac (\(\Gamma\)). It’s behavior is the same as +HARK.ConsumptionSaving.ConsIndShockModel.IndShockConsumerType, except +that the variables aren’t normalized. This makes the result less +accurate. This Model uses a lognormal random walk income process. +If you would like to use a different income process, use +HARK.ConsumptionSaving.ConsGenIncProcessModel.GenIncProcessConsumerType

+
+\[\begin{split}\begin{eqnarray*} +V_t(M_t,P_t) &=& \max_{C_t} U(C_t) + \beta (1-\mathsf{D}_{t+1}) \mathbb{E} [V_{t+1}(M_{t+1}, P_{t+1}) ], \\ +A_t &=& M_t - C_t, \\ +A_t/P_t &\geq& \underline{a}, \\ +M_{t+1} &=& R A_t + \theta_{t+1}, \\ +P_{t+1} &=& G_{t+1}(P_t)\psi_{t+1}, \\ +(\psi_{t+1},\theta_{t+1}) &\sim& F_{t+1}, \\ +\mathbb{E} [F_{t+1}] &=& 1, \\ +U(C) &=& \frac{C^{1-\rho}}{1-\rho}. \\ +G_{t+1} (x) &=&\Gamma_{t+1} x +\end{eqnarray*}\end{split}\]
+
+
Constructors:
+
+
+
Solving Parameters:
+
    +
  • cycles (int) – 0 specifies an infinite horizon model, 1 specifies a finite model.

  • +
  • T_cycle (int) – Number of periods in the cycle for this agent type.

  • +
  • CRRA (float, \(\rho\)) – Coefficient of Relative Risk Aversion.

  • +
  • Rfree (float or list[float], time varying, \(\mathsf{R}\)) – Risk Free interest rate. Pass a list of floats to make Rfree time varying.

  • +
  • DiscFac (float, \(\beta\)) – Intertemporal discount factor.

  • +
  • LivPrb (list[float], time varying, \(1-\mathsf{D}\)) – Survival probability after each period.

  • +
  • PermGroFac (list[float], time varying, \(\Gamma\)) – Permanent income growth factor.

  • +
  • BoroCnstArt (float, \(\underline{a}\)) – The minimum Asset/Perminant Income ratio, None to ignore.

  • +
  • vFuncBool (bool) – Whether to calculate the value function during solution.

  • +
  • CubicBool (bool) – Whether to use cubic spline interpoliation.

  • +
+
+
Simulation Parameters:
+
    +
  • AgentCount (int) – Number of agents of this kind that are created during simulations.

  • +
  • T_age (int) – Age after which to automatically kill agents, None to ignore.

  • +
  • T_sim (int, required for simulation) – Number of periods to simulate.

  • +
  • track_vars (list[strings]) – List of variables that should be tracked when running the simulation. +For this agent, the options are ‘PermShk’, ‘TranShk’, ‘aLvl’, ‘cLvl’, ‘mLvl’, ‘pLvl’, and ‘who_dies’.

    +

    PermShk is the agent’s permanent income shock

    +

    TranShk is the agent’s transitory income shock

    +

    aLvl is the nominal asset level

    +

    cLvl is the nominal consumption level

    +

    mLvl is the nominal market resources

    +

    pLvl is the permanent income level

    +

    who_dies is the array of which agents died

    +
  • +
  • aNrmInitMean (float) – Mean of Log initial Normalized Assets.

  • +
  • aNrmInitStd (float) – Std of Log initial Normalized Assets.

  • +
  • pLvlInitMean (float) – Mean of Log initial permanent income.

  • +
  • pLvlInitStd (float) – Std of Log initial permanent income.

  • +
  • PermGroFacAgg (float) – Aggregate permanent income growth factor (The portion of PermGroFac attributable to aggregate productivity growth).

  • +
  • PerfMITShk (boolean) – Do Perfect Foresight MIT Shock (Forces Newborns to follow solution path of the agent they replaced if True).

  • +
  • NewbornTransShk (boolean) – Whether Newborns have transitory shock.

  • +
+
+
Attributes:
+
    +
  • solution (list[Consumer solution object]) – Created by the solve() method. Finite horizon models create a list with T_cycle+1 elements, for each period in the solution. +Infinite horizon solutions return a list with T_cycle elements for each period in the cycle.

    +

    Unlike other models with this solution type, this model’s variables are NOT normalized. +The solution functions also depend on the permanent income level. For example, \(C=\text{cFunc}(M,P)\). +hNrm has been replaced by hLvl which is a function of permanent income. +MPC max has not yet been implemented for this class. It will be a function of permanent income.

    +

    Visit HARK.ConsumptionSaving.ConsIndShockModel.ConsumerSolution for more information about the solution.

    +
  • +
  • history (Dict[Array]) – Created by running the simulate() method. +Contains the variables in track_vars. Each item in the dictionary is an array with the shape (T_sim,AgentCount). +Visit HARK.core.AgentType.simulate for more information.

  • +
+
+
+
+
+IncShkDstn_default = {'IncUnemp': 0.3, 'IncUnempRet': 0.0, 'PermShkCount': 7, 'PermShkStd': [0.1], 'T_retire': 0, 'TranShkCount': 7, 'TranShkStd': [0.1], 'UnempPrb': 0.05, 'UnempPrbRet': 0.005}#
+
+ +
+
+aXtraGrid_default = {'aXtraCount': 48, 'aXtraExtra': [0.005, 0.01], 'aXtraMax': 30, 'aXtraMin': 0.001, 'aXtraNestFac': 3}#
+
+ +
+
+pLvlNextFunc_default = {}#
+
+ +
+
+pLvlGrid_default = {'pLvlExtra': None, 'pLvlInitMean': 0.0, 'pLvlInitStd': 0.4}#
+
+ +
+
+pLvlPctiles_default = {'pLvlPctiles_bound': [0.05, 0.95], 'pLvlPctiles_count': 19, 'pLvlPctiles_tail_count': 4, 'pLvlPctiles_tail_order': 2.718281828459045}#
+
+ +
+
+solving_default = {'BoroCnstArt': 0.0, 'CRRA': 2.0, 'CubicBool': False, 'DiscFac': 0.96, 'LivPrb': [0.98], 'Rfree': 1.03, 'T_cycle': 1, 'constructors': {'IncShkDstn': <function construct_lognormal_income_process_unemployment>, 'PermShkDstn': <function get_PermShkDstn_from_IncShkDstn>, 'TranShkDstn': <function get_TranShkDstn_from_IncShkDstn>, 'aXtraGrid': <function make_assets_grid>, 'pLvlGrid': <function make_pLvlGrid_by_simulation>, 'pLvlNextFunc': <function make_trivial_pLvlNextFunc>, 'pLvlPctiles': <function make_basic_pLvlPctiles>, 'solution_terminal': <function make_2D_CRRA_solution_terminal>}, 'cycles': 1, 'vFuncBool': False}#
+
+ +
+
+simulation_default = {'AgentCount': 10000, 'NewbornTransShk': False, 'PerfMITShk': False, 'PermGroFacAgg': 1.0, 'T_age': None, 'aNrmInitMean': 0.0, 'aNrmInitStd': 1.0, 'neutral_measure': False, 'pLvlInitMean': 0.0, 'pLvlInitStd': 0.0}#
+
+ +
+
+default_params_ = {'AgentCount': 10000, 'BoroCnstArt': 0.0, 'CRRA': 2.0, 'CubicBool': False, 'DiscFac': 0.96, 'IncUnemp': 0.3, 'IncUnempRet': 0.0, 'LivPrb': [0.98], 'NewbornTransShk': False, 'PerfMITShk': False, 'PermGroFac': [1.0], 'PermGroFacAgg': 1.0, 'PermShkCount': 7, 'PermShkStd': [0.1], 'Rfree': 1.03, 'T_age': None, 'T_cycle': 1, 'T_retire': 0, 'TranShkCount': 7, 'TranShkStd': [0.1], 'UnempPrb': 0.05, 'UnempPrbRet': 0.005, 'aNrmInitMean': 0.0, 'aNrmInitStd': 1.0, 'aXtraCount': 48, 'aXtraExtra': [0.005, 0.01], 'aXtraMax': 30, 'aXtraMin': 0.001, 'aXtraNestFac': 3, 'constructors': {'IncShkDstn': <function construct_lognormal_income_process_unemployment>, 'PermShkDstn': <function get_PermShkDstn_from_IncShkDstn>, 'TranShkDstn': <function get_TranShkDstn_from_IncShkDstn>, 'aXtraGrid': <function make_assets_grid>, 'pLvlGrid': <function make_pLvlGrid_by_simulation>, 'pLvlNextFunc': <function make_explicit_perminc_pLvlNextFunc>, 'pLvlPctiles': <function make_basic_pLvlPctiles>, 'solution_terminal': <function make_2D_CRRA_solution_terminal>}, 'cycles': 1, 'neutral_measure': False, 'pLvlExtra': None, 'pLvlInitMean': 0.0, 'pLvlInitStd': 0.0, 'pLvlPctiles_bound': [0.05, 0.95], 'pLvlPctiles_count': 19, 'pLvlPctiles_tail_count': 4, 'pLvlPctiles_tail_order': 2.718281828459045, 'vFuncBool': False}#
+
+ +
+ +
+
+class HARK.ConsumptionSaving.ConsGenIncProcessModel.PersistentShockConsumerType(**kwds)#
+

Bases: GenIncProcessConsumerType

+

A consumer type based on GenIncProcessModel, where the log permanent income follows an AR1 process. +If you would like to use a different income process, use +HARK.ConsumptionSaving.ConsGenIncProcessModel.GenIncProcessConsumerType

+
+\[\begin{split}\begin{eqnarray*} +V_t(M_t,P_t) &=& \max_{C_t} U(C_t) + \beta (1-\mathsf{D}_{t+1}) \mathbb{E} [V_{t+1}(M_{t+1}, P_{t+1}) ], \\ +A_t &=& M_t - C_t, \\ +A_t/P_t &\geq& \underline{a}, \\ +M_{t+1} &=& R A_t + \theta_{t+1}, \\ +p_{t+1} &=& G_{t+1}(P_t)\psi_{t+1}, \\ +(\psi_{t+1},\theta_{t+1}) &\sim& F_{t+1}, \\ +\mathbb{E} [F_{t+1}] &=& 1, \\ +U(C) &=& \frac{C^{1-\rho}}{1-\rho}, \\ +log(G_{t+1} (x)) &=&\varphi log(x) + (1-\varphi) log(\overline{P}_{t})+log(\Gamma_{t+1}) + log(\psi_{t+1}), \\ +\overline{P}_{t+1} &=& \overline{P}_{t} \Gamma_{t+1} \\ +\end{eqnarray*}\end{split}\]
+
+
Constructors:
+
+
+
Solving Parameters:
+
    +
  • cycles (int) – 0 specifies an infinite horizon model, 1 specifies a finite model.

  • +
  • T_cycle (int) – Number of periods in the cycle for this agent type.

  • +
  • CRRA (float, \(\rho\)) – Coefficient of Relative Risk Aversion.

  • +
  • Rfree (float or list[float], time varying, \(\mathsf{R}\)) – Risk Free interest rate. Pass a list of floats to make Rfree time varying.

  • +
  • DiscFac (float, \(\beta\)) – Intertemporal discount factor.

  • +
  • LivPrb (list[float], time varying, \(1-\mathsf{D}\)) – Survival probability after each period.

  • +
  • PermGroFac (list[float], time varying, \(\Gamma\)) – Permanent income growth factor.

  • +
  • BoroCnstArt (float, \(\underline{a}\)) – The minimum Asset/Perminant Income ratio, None to ignore.

  • +
  • vFuncBool (bool) – Whether to calculate the value function during solution.

  • +
  • CubicBool (bool) – Whether to use cubic spline interpoliation.

  • +
+
+
Simulation Parameters:
+
    +
  • AgentCount (int) – Number of agents of this kind that are created during simulations.

  • +
  • T_age (int) – Age after which to automatically kill agents, None to ignore.

  • +
  • T_sim (int, required for simulation) – Number of periods to simulate.

  • +
  • track_vars (list[strings]) – List of variables that should be tracked when running the simulation. +For this agent, the options are ‘PermShk’, ‘TranShk’, ‘aLvl’, ‘cLvl’, ‘mLvl’, ‘pLvl’, and ‘who_dies’.

    +

    PermShk is the agent’s permanent income shock

    +

    TranShk is the agent’s transitory income shock

    +

    aLvl is the nominal asset level

    +

    cLvl is the nominal consumption level

    +

    mLvl is the nominal market resources

    +

    pLvl is the permanent income level

    +

    who_dies is the array of which agents died

    +
  • +
  • aNrmInitMean (float) – Mean of Log initial Normalized Assets.

  • +
  • aNrmInitStd (float) – Std of Log initial Normalized Assets.

  • +
  • pLvlInitMean (float) – Mean of Log initial permanent income.

  • +
  • pLvlInitStd (float) – Std of Log initial permanent income.

  • +
  • PermGroFacAgg (float) – Aggregate permanent income growth factor (The portion of PermGroFac attributable to aggregate productivity growth).

  • +
  • PerfMITShk (boolean) – Do Perfect Foresight MIT Shock (Forces Newborns to follow solution path of the agent they replaced if True).

  • +
  • NewbornTransShk (boolean) – Whether Newborns have transitory shock.

  • +
+
+
Attributes:
+
    +
  • solution (list[Consumer solution object]) – Created by the solve() method. Finite horizon models create a list with T_cycle+1 elements, for each period in the solution. +Infinite horizon solutions return a list with T_cycle elements for each period in the cycle.

    +

    Unlike other models with this solution type, this model’s variables are NOT normalized. +The solution functions also depend on the permanent income level. For example, \(C=\text{cFunc}(M,P)\). +hNrm has been replaced by hLvl which is a function of permanent income. +MPC max has not yet been implemented for this class. It will be a function of permanent income.

    +

    Visit HARK.ConsumptionSaving.ConsIndShockModel.ConsumerSolution for more information about the solution.

    +
  • +
  • history (Dict[Array]) – Created by running the simulate() method. +Contains the variables in track_vars. Each item in the dictionary is an array with the shape (T_sim,AgentCount). +Visit HARK.core.AgentType.simulate for more information.

  • +
+
+
+
+
+IncShkDstn_default = {'IncUnemp': 0.3, 'IncUnempRet': 0.0, 'PermShkCount': 7, 'PermShkStd': [0.1], 'T_retire': 0, 'TranShkCount': 7, 'TranShkStd': [0.1], 'UnempPrb': 0.05, 'UnempPrbRet': 0.005}#
+
+ +
+
+aXtraGrid_default = {'aXtraCount': 48, 'aXtraExtra': [0.005, 0.01], 'aXtraMax': 30, 'aXtraMin': 0.001, 'aXtraNestFac': 3}#
+
+ +
+
+pLvlNextFunc_default = {'PermGroFac': [1.0], 'PrstIncCorr': 0.98}#
+
+ +
+
+pLvlGrid_default = {'pLvlExtra': None, 'pLvlInitMean': 0.0, 'pLvlInitStd': 0.4}#
+
+ +
+
+pLvlPctiles_default = {'pLvlPctiles_bound': [0.05, 0.95], 'pLvlPctiles_count': 19, 'pLvlPctiles_tail_count': 4, 'pLvlPctiles_tail_order': 2.718281828459045}#
+
+ +
+
+solving_default = {'BoroCnstArt': 0.0, 'CRRA': 2.0, 'CubicBool': False, 'DiscFac': 0.96, 'LivPrb': [0.98], 'Rfree': 1.03, 'T_cycle': 1, 'constructors': {'IncShkDstn': <function construct_lognormal_income_process_unemployment>, 'PermShkDstn': <function get_PermShkDstn_from_IncShkDstn>, 'TranShkDstn': <function get_TranShkDstn_from_IncShkDstn>, 'aXtraGrid': <function make_assets_grid>, 'pLvlGrid': <function make_pLvlGrid_by_simulation>, 'pLvlNextFunc': <function make_AR1_style_pLvlNextFunc>, 'pLvlPctiles': <function make_basic_pLvlPctiles>, 'solution_terminal': <function make_2D_CRRA_solution_terminal>}, 'cycles': 1, 'vFuncBool': False}#
+
+ +
+
+simulation_default = {'AgentCount': 10000, 'NewbornTransShk': False, 'PerfMITShk': False, 'PermGroFacAgg': 1.0, 'T_age': None, 'aNrmInitMean': 0.0, 'aNrmInitStd': 1.0, 'neutral_measure': False, 'pLvlInitMean': 0.0, 'pLvlInitStd': 0.0}#
+
+ +
+
+default_params_ = {'AgentCount': 10000, 'BoroCnstArt': 0.0, 'CRRA': 2.0, 'CubicBool': False, 'DiscFac': 0.96, 'IncUnemp': 0.3, 'IncUnempRet': 0.0, 'LivPrb': [0.98], 'NewbornTransShk': False, 'PerfMITShk': False, 'PermGroFac': [1.0], 'PermGroFacAgg': 1.0, 'PermShkCount': 7, 'PermShkStd': [0.1], 'PrstIncCorr': 0.98, 'Rfree': 1.03, 'T_age': None, 'T_cycle': 1, 'T_retire': 0, 'TranShkCount': 7, 'TranShkStd': [0.1], 'UnempPrb': 0.05, 'UnempPrbRet': 0.005, 'aNrmInitMean': 0.0, 'aNrmInitStd': 1.0, 'aXtraCount': 48, 'aXtraExtra': [0.005, 0.01], 'aXtraMax': 30, 'aXtraMin': 0.001, 'aXtraNestFac': 3, 'constructors': {'IncShkDstn': <function construct_lognormal_income_process_unemployment>, 'PermShkDstn': <function get_PermShkDstn_from_IncShkDstn>, 'TranShkDstn': <function get_TranShkDstn_from_IncShkDstn>, 'aXtraGrid': <function make_assets_grid>, 'pLvlGrid': <function make_pLvlGrid_by_simulation>, 'pLvlNextFunc': <function make_AR1_style_pLvlNextFunc>, 'pLvlPctiles': <function make_basic_pLvlPctiles>, 'solution_terminal': <function make_2D_CRRA_solution_terminal>}, 'cycles': 1, 'neutral_measure': False, 'pLvlExtra': None, 'pLvlInitMean': 0.0, 'pLvlInitStd': 0.0, 'pLvlPctiles_bound': [0.05, 0.95], 'pLvlPctiles_count': 19, 'pLvlPctiles_tail_count': 4, 'pLvlPctiles_tail_order': 2.718281828459045, 'vFuncBool': False}#
+
+ +
+ +
+ + +
+ + + + + + + +
+ + + + +
+ + +
+ + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/Documentation/reference/ConsumptionSaving/ConsIndShockModel.html b/Documentation/reference/ConsumptionSaving/ConsIndShockModel.html new file mode 100644 index 000000000..58e31a309 --- /dev/null +++ b/Documentation/reference/ConsumptionSaving/ConsIndShockModel.html @@ -0,0 +1,1742 @@ + + + + + + + + + + + ConsIndShockModel — HARK latest documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+
+ + + + +
+ + + + + + + + + + + + + +
+ +
+ + +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ +
+

ConsIndShockModel#

+

Classes to solve canonical consumption-saving models with idiosyncratic shocks +to income. All models here assume CRRA utility with geometric discounting, no +bequest motive, and income shocks that are fully transitory or fully permanent.

+
+
It currently solves three types of models:
    +
  1. A very basic “perfect foresight” consumption-savings model with no uncertainty.

  2. +
  3. A consumption-savings model with risk over transitory and permanent income shocks.

  4. +
  5. The model described in (2), with an interest rate for debt that differs +from the interest rate for savings.

  6. +
+
+
+

See NARK econ-ark/HARK for information on variable naming conventions. +See HARK documentation for mathematical descriptions of the models being solved.

+
+
+class HARK.ConsumptionSaving.ConsIndShockModel.ConsumerSolution(cFunc=None, vFunc=None, vPfunc=None, vPPfunc=None, mNrmMin=None, hNrm=None, MPCmin=None, MPCmax=None)#
+

Bases: MetricObject

+

A class representing the solution of a single period of a consumption-saving +problem. The solution must include a consumption function and marginal +value function.

+

Here and elsewhere in the code, Nrm indicates that variables are normalized +by permanent income.

+
+
Parameters:
+
    +
  • cFunc (function) – The consumption function for this period, defined over normalized market +resources: cNrm = cFunc(mNrm).

  • +
  • vFunc (function) – The beginning-of-period value function for this period, defined over +normalized market resources: vNrm = vFunc(mNrm).

  • +
  • vPfunc (function) – The beginning-of-period marginal value function for this period, +defined over normalized market resources: vNrmP = vPfunc(mNrm).

  • +
  • vPPfunc (function) – The beginning-of-period marginal marginal value function for this +period, defined over normalized market resources: vNrmPP = vPPfunc(mNrm).

  • +
  • mNrmMin (float) – The minimum allowable normalized market resources for this period; the consump- +tion function (etc) are undefined for m < mNrmMin.

  • +
  • hNrm (float) – Normalized human wealth after receiving income this period: PDV of all future +income, ignoring mortality.

  • +
  • MPCmin (float) – Infimum of the marginal propensity to consume this period. +MPC –> MPCmin as m –> infinity.

  • +
  • MPCmax (float) – Supremum of the marginal propensity to consume this period. +MPC –> MPCmax as m –> mNrmMin.

  • +
+
+
+
+
+distance_criteria = ['vPfunc']#
+
+ +
+
+append_solution(new_solution)#
+

Appends one solution to another to create a ConsumerSolution whose +attributes are lists. Used in ConsMarkovModel, where we append solutions +conditional on a particular value of a Markov state to each other in +order to get the entire solution.

+
+
Parameters:
+

new_solution (ConsumerSolution) – The solution to a consumption-saving problem; each attribute is a +list representing state-conditional values or functions.

+
+
Return type:
+

None

+
+
+
+ +
+ +
+
+class HARK.ConsumptionSaving.ConsIndShockModel.PerfForesightConsumerType(verbose=1, quiet=False, **kwds)#
+

Bases: AgentType

+

A perfect foresight consumer type who has no uncertainty other than mortality. +Their problem is defined by a coefficient of relative risk aversion (\(\rho\)), intertemporal +discount factor (\(\beta\)), interest factor (\(\mathsf{R}\)), an optional artificial borrowing constraint (\(\underline{a}\)) +and time sequences of the permanent income growth rate (\(\Gamma\)) and survival probability (\(1-\mathsf{D}\)). +Their assets and income are normalized by permanent income.

+
+\[\begin{split}\newcommand{\CRRA}{\rho} +\newcommand{\DiePrb}{\mathsf{D}} +\newcommand{\PermGroFac}{\Gamma} +\newcommand{\Rfree}{\mathsf{R}} +\newcommand{\DiscFac}{\beta} +\begin{align*} +v_t(m_t) &= \max_{c_t}u(c_t) + \DiscFac (1 - \DiePrb_{t+1}) \PermGroFac_{t+1}^{1-\CRRA} v_{t+1}(m_{t+1}), \\ +& \text{s.t.} \\ +a_t &= m_t - c_t, \\ +a_t &\geq \underline{a}, \\ +m_{t+1} &= \Rfree_{t+1} a_t/\PermGroFac_{t+1} + 1, \\ +u(c) &= \frac{c^{1-\CRRA}}{1-\CRRA} +\end{align*}\end{split}\]
+
+
Solving Parameters:
+
    +
  • cycles (int) – 0 specifies an infinite horizon model, 1 specifies a finite model.

  • +
  • T_cycle (int) – Number of periods in the cycle for this agent type.

  • +
  • CRRA (float, \(\rho\)) – Coefficient of Relative Risk Aversion.

  • +
  • Rfree (float or list[float], time varying, \(\mathsf{R}\)) – Risk Free interest rate. Pass a list of floats to make Rfree time varying.

  • +
  • DiscFac (float, \(\beta\)) – Intertemporal discount factor.

  • +
  • LivPrb (list[float], time varying, \(1-\mathsf{D}\)) – Survival probability after each period.

  • +
  • PermGroFac (list[float], time varying, \(\Gamma\)) – Permanent income growth factor.

  • +
  • BoroCnstArt (float, \(\underline{a}\)) – The minimum Asset/Perminant Income ratio, None to ignore.

  • +
  • MaxKinks (int) – Maximum number of gridpoints to allow in cFunc.

  • +
+
+
Simulation Parameters:
+
    +
  • AgentCount (int) – Number of agents of this kind that are created during simulations.

  • +
  • T_age (int) – Age after which to automatically kill agents, None to ignore.

  • +
  • T_sim (int, required for simulation) – Number of periods to simulate.

  • +
  • track_vars (list[strings]) – List of variables that should be tracked when running the simulation. +For this agent, the options are ‘aLvl’, ‘aNrm’, ‘bNrm’, ‘cNrm’, ‘mNrm’, ‘pLvl’, and ‘who_dies’.

    +

    aLvl is the nominal asset level

    +

    aNrm is the normalized assets

    +

    bNrm is the normalized resources without this period’s labor income

    +

    cNrm is the normalized consumption

    +

    mNrm is the normalized market resources

    +

    pLvl is the permanent income level

    +

    who_dies is the array of which agents died

    +
  • +
  • aNrmInitMean (float) – Mean of Log initial Normalized Assets.

  • +
  • aNrmInitStd (float) – Std of Log initial Normalized Assets.

  • +
  • pLvlInitMean (float) – Mean of Log initial permanent income.

  • +
  • pLvlInitStd (float) – Std of Log initial permanent income.

  • +
  • PermGroFacAgg (float) – Aggregate permanent income growth factor (The portion of PermGroFac attributable to aggregate productivity growth).

  • +
  • PerfMITShk (boolean) – Do Perfect Foresight MIT Shock (Forces Newborns to follow solution path of the agent they replaced if True).

  • +
+
+
Attributes:
+
    +
  • solution (list[Consumer solution object]) – Created by the solve() method. Finite horizon models create a list with T_cycle+1 elements, for each period in the solution. +Infinite horizon solutions return a list with T_cycle elements for each period in the cycle.

    +

    Visit HARK.ConsumptionSaving.ConsIndShockModel.ConsumerSolution for more information about the solution.

    +
  • +
  • history (Dict[Array]) – Created by running the simulate() method. +Contains the variables in track_vars. Each item in the dictionary is an array with the shape (T_sim,AgentCount). +Visit HARK.core.AgentType.simulate for more information.

  • +
+
+
+
+
+solving_defaults = {'BoroCnstArt': None, 'CRRA': 2.0, 'DiscFac': 0.96, 'LivPrb': [0.98], 'MaxKinks': 400, 'PermGroFac': [1.01], 'Rfree': 1.03, 'T_cycle': 1, 'constructors': {'solution_terminal': <function make_basic_CRRA_solution_terminal>}, 'cycles': 1}#
+
+ +
+
+simulation_defaults = {'AgentCount': 10000, 'PerfMITShk': False, 'PermGroFacAgg': 1.0, 'T_age': None, 'aNrmInitMean': 0.0, 'aNrmInitStd': 1.0, 'pLvlInitMean': 0.0, 'pLvlInitStd': 0.0}#
+
+ +
+
+cFunc_terminal_ = <HARK.interpolation.LinearInterp object>#
+
+ +
+
+vFunc_terminal_ = <HARK.interpolation.LinearInterp object>#
+
+ +
+
+solution_terminal_ = <HARK.ConsumptionSaving.ConsIndShockModel.ConsumerSolution object>#
+
+ +
+
+time_vary_ = ['LivPrb', 'PermGroFac']#
+
+ +
+
+time_inv_ = ['CRRA', 'DiscFac', 'MaxKinks', 'BoroCnstArt']#
+
+ +
+
+state_vars = ['pLvl', 'PlvlAgg', 'bNrm', 'mNrm', 'aNrm', 'aLvl']#
+
+ +
+
+shock_vars_ = []#
+
+ +
+
+pre_solve()#
+

Method that is run automatically just before solution by backward iteration. +Solves the (trivial) terminal period and does a quick check on the borrowing +constraint and MaxKinks attribute (only relevant in constrained, infinite +horizon problems).

+
+ +
+
+post_solve()#
+

Method that is run automatically at the end of a call to solve. Here, it +simply calls calc_stable_points() if appropriate: an infinite horizon +problem with a single repeated period in its cycle.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+check_restrictions()#
+

A method to check that various restrictions are met for the model class.

+
+ +
+
+update_solution_terminal()#
+

Update the terminal period solution. This method should be run when a +new AgentType is created or when CRRA changes.

+
+
Parameters:
+

none

+
+
Return type:
+

none

+
+
+
+ +
+
+update_Rfree()#
+

Determines whether Rfree is time-varying or fixed.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+unpack_cFunc()#
+

DEPRECATED: Use solution.unpack(‘cFunc’) instead. +“Unpacks” the consumption functions into their own field for easier access. +After the model has been solved, the consumption functions reside in the +attribute cFunc of each element of ConsumerType.solution. This method +creates a (time varying) attribute cFunc that contains a list of consumption +functions. +:param none:

+
+
Return type:
+

none

+
+
+
+ +
+
+initialize_sim()#
+

Prepares this AgentType for a new simulation. Resets the internal random number generator, +makes initial states for all agents (using sim_birth), clears histories of tracked variables.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+sim_birth(which_agents)#
+

Makes new consumers for the given indices. Initialized variables include aNrm and pLvl, as +well as time variables t_age and t_cycle. Normalized assets and permanent income levels +are drawn from lognormal distributions given by aNrmInitMean and aNrmInitStd (etc).

+
+
Parameters:
+

which_agents (np.array(Bool)) – Boolean array of size self.AgentCount indicating which agents should be “born”.

+
+
Return type:
+

None

+
+
+
+ +
+
+sim_death()#
+

Determines which agents die this period and must be replaced. Uses the sequence in LivPrb +to determine survival probabilities for each agent.

+
+
Parameters:
+

None

+
+
Returns:
+

which_agents – Boolean array of size AgentCount indicating which agents die.

+
+
Return type:
+

np.array(bool)

+
+
+
+ +
+
+get_shocks()#
+

Finds permanent and transitory income “shocks” for each agent this period. As this is a +perfect foresight model, there are no stochastic shocks: PermShkNow = PermGroFac for each +agent (according to their t_cycle) and TranShkNow = 1.0 for all agents.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+get_Rfree()#
+

Returns an array of size self.AgentCount with self.Rfree in every entry.

+
+
Parameters:
+

None

+
+
Returns:
+

RfreeNow – Array of size self.AgentCount with risk free interest rate for each agent.

+
+
Return type:
+

np.array

+
+
+
+ +
+
+transition()#
+
+
Parameters:
+
    +
  • None

  • +
  • [Eventually

  • +
  • spec (to match dolo)

  • +
  • exogenous_prev

  • +
  • endogenous_prev

  • +
  • controls

  • +
  • exogenous

  • +
  • parameters]

  • +
+
+
Returns:
+

endogenous_state – Tuple with new values of the endogenous states

+
+
Return type:
+

()

+
+
+
+ +
+
+get_controls()#
+

Calculates consumption for each consumer of this type using the consumption functions.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+get_poststates()#
+

Calculates end-of-period assets for each consumer of this type.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+log_condition_result(name, result, message, verbose)#
+

Records the result of one condition check in the attribute condition_report +of the bilt dictionary, and in the message log.

+
+
Parameters:
+
    +
  • name (string or None) – Name for the condition; if None, no test result is added to conditions.

  • +
  • result (bool) – An indicator for whether the condition was passed.

  • +
  • message (str) – The messages to record about the condition check.

  • +
  • verbose (bool) – Indicator for whether verbose messages should be included in the report.

  • +
+
+
+
+ +
+
+check_AIC(verbose=None)#
+

Evaluate and report on the Absolute Impatience Condition.

+
+ +
+
+check_GICRaw(verbose=None)#
+

Evaluate and report on the Growth Impatience Condition for the Perfect Foresight model.

+
+ +
+
+check_RIC(verbose=None)#
+

Evaluate and report on the Return Impatience Condition.

+
+ +
+
+check_FHWC(verbose=None)#
+

Evaluate and report on the Finite Human Wealth Condition.

+
+ +
+
+check_FVAC(verbose=None)#
+

Evaluate and report on the Finite Value of Autarky Condition under perfect foresight.

+
+ +
+
+describe_parameters()#
+

Make a string describing this instance’s parameter values, including their +representation in code and symbolically.

+
+
Returns:
+

param_desc – Description of parameters as a unicode string.

+
+
Return type:
+

str

+
+
+
+ +
+
+calc_limiting_values()#
+

Compute various scalar values that are relevant to characterizing the +solution to an infinite horizon problem. This method should only be called +when T_cycle=1 and cycles=0, otherwise the values generated are meaningless. +This method adds the following values to the instance in the dictionary +attribute called bilt.

+

APFac : Absolute Patience Factor +GPFacRaw : Growth Patience Factor +FHWFac : Finite Human Wealth Factor +RPFac : Return Patience Factor +PFVAFac : Perfect Foresight Value of Autarky Factor +cNrmPDV : Present Discounted Value of Autarky Consumption +MPCmin : Limiting minimum MPC as market resources go to infinity +MPCmax : Limiting maximum MPC as market resources approach minimum level. +hNrm : Human wealth divided by permanent income. +Delta_mNrm_ZeroFunc : Linear consumption function where expected change in market resource ratio is zero +BalGroFunc : Linear consumption function where the level of market resources grows at the same rate as permanent income

+
+
Return type:
+

None

+
+
+
+ +
+
+check_conditions(verbose=None)#
+

This method checks whether the instance’s type satisfies the +Absolute Impatience Condition (AIC), the Return Impatience Condition (RIC), +the Finite Human Wealth Condition (FHWC), the perfect foresight model’s +Growth Impatience Condition (GICRaw) and Perfect Foresight Finite Value +of Autarky Condition (FVACPF). Depending on the configuration of parameter +values, somecombination of these conditions must be satisfied in order +for the problem to have a nondegenerate solution. To check which conditions +are required, in the verbose mode a reference to the relevant theoretical +literature is made.

+
+
Parameters:
+

verbose (boolean) – Specifies different levels of verbosity of feedback. When False, it +only reports whether the instance’s type fails to satisfy a particular +condition. When True, it reports all results, i.e. the factor values +for all conditions.

+
+
Return type:
+

None

+
+
+
+ +
+
+calc_stable_points()#
+

If the problem is one that satisfies the conditions required for target ratios of different +variables to permanent income to exist, and has been solved to within the self-defined +tolerance, this method calculates the target values of market resources.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+ +
+
+class HARK.ConsumptionSaving.ConsIndShockModel.IndShockConsumerType(verbose=1, quiet=False, **kwds)#
+

Bases: PerfForesightConsumerType

+

A consumer type with idiosyncratic shocks to permanent and transitory income. +Their problem is defined by a sequence of income distributions, survival probabilities +(\(1-\mathsf{D}\)), and permanent income growth rates (\(\Gamma\)), as well +as time invariant values for risk aversion (\(\rho\)), discount factor (\(\beta\)), +the interest rate (\(\mathsf{R}\)), the grid of end-of-period assets, and an artificial +borrowing constraint (\(\underline{a}\)).

+
+\[\begin{split}\newcommand{\CRRA}{\rho} +\newcommand{\DiePrb}{\mathsf{D}} +\newcommand{\PermGroFac}{\Gamma} +\newcommand{\Rfree}{\mathsf{R}} +\newcommand{\DiscFac}{\beta} +\begin{align*} +v_t(m_t) &= \max_{c_t}u(c_t) + \DiscFac (1 - \DiePrb_{t+1}) \mathbb{E}_{t} \left[ (\PermGroFac_{t+1} \psi_{t+1})^{1-\CRRA} v_{t+1}(m_{t+1}) \right], \\ +& \text{s.t.} \\ +a_t &= m_t - c_t, \\ +a_t &\geq \underline{a}, \\ +m_{t+1} &= a_t \Rfree_{t+1}/(\PermGroFac_{t+1} \psi_{t+1}) + \theta_{t+1}, \\ +(\psi_{t+1},\theta_{t+1}) &\sim F_{t+1}, \\ +\mathbb{E}[\psi]=\mathbb{E}[\theta] &= 1, \\ +u(c) &= \frac{c^{1-\CRRA}}{1-\CRRA} +\end{align*}\end{split}\]
+
+
Constructors:
+
+
+
Solving Parameters:
+
    +
  • cycles (int) – 0 specifies an infinite horizon model, 1 specifies a finite model.

  • +
  • T_cycle (int) – Number of periods in the cycle for this agent type.

  • +
  • CRRA (float, \(\rho\)) – Coefficient of Relative Risk Aversion.

  • +
  • Rfree (float or list[float], time varying, \(\mathsf{R}\)) – Risk Free interest rate. Pass a list of floats to make Rfree time varying.

  • +
  • DiscFac (float, \(\beta\)) – Intertemporal discount factor.

  • +
  • LivPrb (list[float], time varying, \(1-\mathsf{D}\)) – Survival probability after each period.

  • +
  • PermGroFac (list[float], time varying, \(\Gamma\)) – Permanent income growth factor.

  • +
  • BoroCnstArt (float, \(\underline{a}\)) – The minimum Asset/Perminant Income ratio, None to ignore.

  • +
  • vFuncBool (bool) – Whether to calculate the value function during solution.

  • +
  • CubicBool (bool) – Whether to use cubic spline interpoliation.

  • +
+
+
Simulation Parameters:
+
    +
  • AgentCount (int) – Number of agents of this kind that are created during simulations.

  • +
  • T_age (int) – Age after which to automatically kill agents, None to ignore.

  • +
  • T_sim (int, required for simulation) – Number of periods to simulate.

  • +
  • track_vars (list[strings]) – List of variables that should be tracked when running the simulation. +For this agent, the options are ‘PermShk’, ‘TranShk’, ‘aLvl’, ‘aNrm’, ‘bNrm’, ‘cNrm’, ‘mNrm’, ‘pLvl’, and ‘who_dies’.

    +

    PermShk is the agent’s permanent income shock

    +

    TranShk is the agent’s transitory income shock

    +

    aLvl is the nominal asset level

    +

    aNrm is the normalized assets

    +

    bNrm is the normalized resources without this period’s labor income

    +

    cNrm is the normalized consumption

    +

    mNrm is the normalized market resources

    +

    pLvl is the permanent income level

    +

    who_dies is the array of which agents died

    +
  • +
  • aNrmInitMean (float) – Mean of Log initial Normalized Assets.

  • +
  • aNrmInitStd (float) – Std of Log initial Normalized Assets.

  • +
  • pLvlInitMean (float) – Mean of Log initial permanent income.

  • +
  • pLvlInitStd (float) – Std of Log initial permanent income.

  • +
  • PermGroFacAgg (float) – Aggregate permanent income growth factor (The portion of PermGroFac attributable to aggregate productivity growth).

  • +
  • PerfMITShk (boolean) – Do Perfect Foresight MIT Shock (Forces Newborns to follow solution path of the agent they replaced if True).

  • +
  • NewbornTransShk (boolean) – Whether Newborns have transitory shock.

  • +
+
+
Attributes:
+
    +
  • solution (list[Consumer solution object]) – Created by the solve() method. Finite horizon models create a list with T_cycle+1 elements, for each period in the solution. +Infinite horizon solutions return a list with T_cycle elements for each period in the cycle.

    +

    Visit HARK.ConsumptionSaving.ConsIndShockModel.ConsumerSolution for more information about the solution.

    +
  • +
  • history (Dict[Array]) – Created by running the simulate() method. +Contains the variables in track_vars. Each item in the dictionary is an array with the shape (T_sim,AgentCount). +Visit HARK.core.AgentType.simulate for more information.

  • +
+
+
+
+
+IncShkDstn_defaults = {'IncUnemp': 0.3, 'IncUnempRet': 0.0, 'PermShkCount': 7, 'PermShkStd': [0.1], 'T_retire': 0, 'TranShkCount': 7, 'TranShkStd': [0.1], 'UnempPrb': 0.05, 'UnempPrbRet': 0.005}#
+
+ +
+
+aXtraGrid_defaults = {'aXtraCount': 48, 'aXtraExtra': None, 'aXtraMax': 20, 'aXtraMin': 0.001, 'aXtraNestFac': 3}#
+
+ +
+
+solving_defaults = {'BoroCnstArt': 0.0, 'CRRA': 2.0, 'CubicBool': False, 'DiscFac': 0.96, 'LivPrb': [0.98], 'PermGroFac': [1.01], 'Rfree': 1.03, 'T_cycle': 1, 'constructors': {'IncShkDstn': <function construct_lognormal_income_process_unemployment>, 'PermShkDstn': <function get_PermShkDstn_from_IncShkDstn>, 'TranShkDstn': <function get_TranShkDstn_from_IncShkDstn>, 'aXtraGrid': <function make_assets_grid>, 'solution_terminal': <function make_basic_CRRA_solution_terminal>}, 'cycles': 1, 'vFuncBool': False}#
+
+ +
+
+simulation_defaults = {'AgentCount': 10000, 'NewbornTransShk': False, 'PerfMITShk': False, 'PermGroFacAgg': 1.0, 'T_age': None, 'aNrmInitMean': 0.0, 'aNrmInitStd': 1.0, 'neutral_measure': False, 'pLvlInitMean': 0.0, 'pLvlInitStd': 0.0}#
+
+ +
+
+time_inv_ = ['CRRA', 'DiscFac', 'BoroCnstArt', 'BoroCnstArt', 'vFuncBool', 'CubicBool']#
+
+ +
+
+shock_vars_ = ['PermShk', 'TranShk']#
+
+ +
+
+update_income_process()#
+

Updates this agent’s income process based on his own attributes.

+
+
Parameters:
+
    +
  • none

  • +
  • Returns

  • +
  • -----------

  • +
  • none

  • +
+
+
+
+ +
+
+update_assets_grid()#
+

Updates this agent’s end-of-period assets grid by constructing a multi- +exponentially spaced grid of aXtra values.

+
+
Parameters:
+

none

+
+
Return type:
+

none

+
+
+
+ +
+
+update()#
+

Update the income process, the assets grid, and the terminal solution.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+reset_rng()#
+

Reset the RNG behavior of this type. This method is called automatically +by initialize_sim(), ensuring that each simulation run uses the same sequence +of random shocks; this is necessary for structural estimation to work. +This method extends AgentType.reset_rng() to also reset elements of IncShkDstn.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+get_shocks()#
+

Gets permanent and transitory income shocks for this period. Samples from IncShkDstn for +each period in the cycle.

+
+
Parameters:
+

NewbornTransShk (boolean, optional) – Whether Newborns have transitory shock. The default is False.

+
+
Return type:
+

None

+
+
+
+ +
+
+make_euler_error_func(mMax=100, approx_inc_dstn=True)#
+

Creates a “normalized Euler error” function for this instance, mapping +from market resources to “consumption error per dollar of consumption.” +Stores result in attribute eulerErrorFunc as an interpolated function. +Has option to use approximate income distribution stored in self.IncShkDstn +or to use a (temporary) very dense approximation.

+

Only works on (one period) infinite horizon models at this time, will +be generalized later.

+
+
Parameters:
+
    +
  • mMax (float) – Maximum normalized market resources for the Euler error function.

  • +
  • approx_inc_dstn (Boolean) – Indicator for whether to use the approximate discrete income distri- +bution stored in self.IncShkDstn[0], or to use a very accurate +discrete approximation instead. When True, uses approximation in +IncShkDstn; when False, makes and uses a very dense approximation.

  • +
+
+
Return type:
+

None

+
+
+

Notes

+

This method is not used by any other code in the library. Rather, it is here +for expository and benchmarking purposes.

+
+ +
+
+pre_solve()#
+

Method that is run automatically just before solution by backward iteration. +Solves the (trivial) terminal period and does a quick check on the borrowing +constraint and MaxKinks attribute (only relevant in constrained, infinite +horizon problems).

+
+ +
+
+describe_parameters()#
+

Generate a string describing the primitive model parameters that will +be used to calculating limiting values and factors.

+
+
Parameters:
+

None

+
+
Returns:
+

param_desc – Description of primitive parameters.

+
+
Return type:
+

str

+
+
+
+ +
+
+calc_limiting_values()#
+

Compute various scalar values that are relevant to characterizing the +solution to an infinite horizon problem. This method should only be called +when T_cycle=1 and cycles=0, otherwise the values generated are meaningless. +This method adds the following values to this instance in the dictionary +attribute called bilt.

+

APFac : Absolute Patience Factor +GPFacRaw : Growth Patience Factor +GPFacMod : Risk-Modified Growth Patience Factor +GPFacLiv : Mortality-Adjusted Growth Patience Factor +GPFacLivMod : Modigliani Mortality-Adjusted Growth Patience Factor +GPFacSdl : Szeidl Growth Patience Factor +FHWFac : Finite Human Wealth Factor +RPFac : Return Patience Factor +WRPFac : Weak Return Patience Factor +PFVAFac : Perfect Foresight Value of Autarky Factor +VAFac : Value of Autarky Factor +cNrmPDV : Present Discounted Value of Autarky Consumption +MPCmin : Limiting minimum MPC as market resources go to infinity +MPCmax : Limiting maximum MPC as market resources approach minimum level +hNrm : Human wealth divided by permanent income. +ELogPermShk : Expected log permanent income shock +WorstPrb : Probability of worst income shock realization +Delta_mNrm_ZeroFunc : Linear locus where expected change in market resource ratio is zero +BalGroFunc : Linear consumption function where the level of market resources grows at the same rate as permanent income

+
+
Return type:
+

None

+
+
+
+ +
+
+check_GICMod(verbose=None)#
+

Evaluate and report on the Risk-Modified Growth Impatience Condition.

+
+ +
+
+check_GICSdl(verbose=None)#
+

Evaluate and report on the Szeidl variation of the Growth Impatience Condition.

+
+ +
+
+check_GICHrm(verbose=None)#
+

Evaluate and report on the Harmenberg variation of the Growth Impatience Condition.

+
+ +
+
+check_GICLiv(verbose=None)#
+

Evaluate and report on the Mortality-Adjusted Growth Impatience Condition.

+
+ +
+
+check_FVAC(verbose=None)#
+

Evaluate and report on the Finite Value of Autarky condition in the presence of income risk.

+
+ +
+
+check_WRIC(verbose=None)#
+

Evaluate and report on the Weak Return Impatience Condition.

+
+ +
+
+check_conditions(verbose=None)#
+

This method checks whether the instance’s type satisfies various conditions. +When combinations of these conditions are satisfied, the solution to the +problem exhibits different characteristics. (For an exposition of the +conditions, see https://econ-ark.github.io/BufferStockTheory/)

+
+
Parameters:
+

verbose (boolean) – Specifies different levels of verbosity of feedback. When False, it only reports whether the +instance’s type fails to satisfy a particular condition. When True, it reports all results, i.e. +the factor values for all conditions.

+
+
Return type:
+

None

+
+
+
+ +
+ +
+
+class HARK.ConsumptionSaving.ConsIndShockModel.KinkedRconsumerType(**kwds)#
+

Bases: IndShockConsumerType

+

A consumer type based on IndShockConsumerType, with different +interest rates for saving (\(\mathsf{R}_{save}\)) and borrowing +(\(\mathsf{R}_{boro}\)).

+

Solver for this class is currently only compatible with linear spline interpolation.

+
+\[\begin{split}\newcommand{\CRRA}{\rho} +\newcommand{\DiePrb}{\mathsf{D}} +\newcommand{\PermGroFac}{\Gamma} +\newcommand{\Rfree}{\mathsf{R}} +\newcommand{\DiscFac}{\beta} +\begin{align*} +v_t(m_t) &= \max_{c_t} u(c_t) + \DiscFac (1-\DiePrb_{t+1}) \mathbb{E}_{t} \left[(\PermGroFac_{t+1}\psi_{t+1})^{1-\CRRA} v_{t+1}(m_{t+1}) \right], \\ +& \text{s.t.} \\ +a_t &= m_t - c_t, \\ +a_t &\geq \underline{a}, \\ +m_{t+1} &= \Rfree_t/(\PermGroFac_{t+1} \psi_{t+1}) a_t + \theta_{t+1}, \\ +\Rfree_t &= \begin{cases} +\Rfree_{boro} & \text{if } a_t < 0\\ +\Rfree_{save} & \text{if } a_t \geq 0, +\end{cases}\\ +\Rfree_{boro} &> \Rfree_{save}, \\ +(\psi_{t+1},\theta_{t+1}) &\sim F_{t+1}, \\ +\mathbb{E}[\psi]=\mathbb{E}[\theta] &= 1.\\ +u(c) &= \frac{c^{1-\CRRA}}{1-\CRRA} \\ +\end{align*}\end{split}\]
+
+
Constructors:
+
+
+
Solving Parameters:
+
    +
  • cycles (int) – 0 specifies an infinite horizon model, 1 specifies a finite model.

  • +
  • T_cycle (int) – Number of periods in the cycle for this agent type.

  • +
  • CRRA (float, \(\rho\)) – Coefficient of Relative Risk Aversion.

  • +
  • Rboro (float, \(\mathsf{R}_{boro}\)) – Risk Free interest rate when assets are negative.

  • +
  • Rsave (float, \(\mathsf{R}_{save}\)) – Risk Free interest rate when assets are positive.

  • +
  • DiscFac (float, \(\beta\)) – Intertemporal discount factor.

  • +
  • LivPrb (list[float], time varying, \(1-\mathsf{D}\)) – Survival probability after each period.

  • +
  • PermGroFac (list[float], time varying, \(\Gamma\)) – Permanent income growth factor.

  • +
  • BoroCnstArt (float, \(\underline{a}\)) – The minimum Asset/Perminant Income ratio, None to ignore.

  • +
  • vFuncBool (bool) – Whether to calculate the value function during solution.

  • +
  • CubicBool (bool) – Whether to use cubic spline interpoliation.

  • +
+
+
Simulation Parameters:
+
    +
  • AgentCount (int) – Number of agents of this kind that are created during simulations.

  • +
  • T_age (int) – Age after which to automatically kill agents, None to ignore.

  • +
  • T_sim (int, required for simulation) – Number of periods to simulate.

  • +
  • track_vars (list[strings]) – List of variables that should be tracked when running the simulation. +For this agent, the options are ‘PermShk’, ‘TranShk’, ‘aLvl’, ‘aNrm’, ‘bNrm’, ‘cNrm’, ‘mNrm’, ‘pLvl’, and ‘who_dies’.

    +

    PermShk is the agent’s permanent income shock

    +

    TranShk is the agent’s transitory income shock

    +

    aLvl is the nominal asset level

    +

    aNrm is the normalized assets

    +

    bNrm is the normalized resources without this period’s labor income

    +

    cNrm is the normalized consumption

    +

    mNrm is the normalized market resources

    +

    pLvl is the permanent income level

    +

    who_dies is the array of which agents died

    +
  • +
  • aNrmInitMean (float) – Mean of Log initial Normalized Assets.

  • +
  • aNrmInitStd (float) – Std of Log initial Normalized Assets.

  • +
  • pLvlInitMean (float) – Mean of Log initial permanent income.

  • +
  • pLvlInitStd (float) – Std of Log initial permanent income.

  • +
  • PermGroFacAgg (float) – Aggregate permanent income growth factor (The portion of PermGroFac attributable to aggregate productivity growth).

  • +
  • PerfMITShk (boolean) – Do Perfect Foresight MIT Shock (Forces Newborns to follow solution path of the agent they replaced if True).

  • +
  • NewbornTransShk (boolean) – Whether Newborns have transitory shock.

  • +
+
+
Attributes:
+
    +
  • solution (list[Consumer solution object]) – Created by the solve() method. Finite horizon models create a list with T_cycle+1 elements, for each period in the solution. +Infinite horizon solutions return a list with T_cycle elements for each period in the cycle.

    +

    Visit HARK.ConsumptionSaving.ConsIndShockModel.ConsumerSolution for more information about the solution.

    +
  • +
  • history (Dict[Array]) – Created by running the simulate() method. +Contains the variables in track_vars. Each item in the dictionary is an array with the shape (T_sim,AgentCount). +Visit HARK.core.AgentType.simulate for more information.

  • +
+
+
+
+
+IncShkDstn_defaults = {'IncUnemp': 0.3, 'IncUnempRet': 0.0, 'PermShkCount': 7, 'PermShkStd': [0.1], 'T_retire': 0, 'TranShkCount': 7, 'TranShkStd': [0.1], 'UnempPrb': 0.05, 'UnempPrbRet': 0.005}#
+
+ +
+
+aXtraGrid_defualts = {'aXtraCount': 48, 'aXtraExtra': None, 'aXtraMax': 20, 'aXtraMin': 0.001, 'aXtraNestFac': 3}#
+
+ +
+
+solving_defaults = {'BoroCnstArt': None, 'CRRA': 2.0, 'CubicBool': False, 'DiscFac': 0.96, 'LivPrb': [0.98], 'PermGroFac': [1.01], 'Rboro': 1.2, 'Rsave': 1.02, 'T_cycle': 1, 'constructors': {'IncShkDstn': <function construct_lognormal_income_process_unemployment>, 'PermShkDstn': <function get_PermShkDstn_from_IncShkDstn>, 'TranShkDstn': <function get_TranShkDstn_from_IncShkDstn>, 'aXtraGrid': <function make_assets_grid>, 'solution_terminal': <function make_basic_CRRA_solution_terminal>}, 'cycles': 1, 'vFuncBool': False}#
+
+ +
+
+simulation_defualts = {'AgentCount': 10000, 'NewbornTransShk': False, 'PerfMITShk': False, 'PermGroFacAgg': 1.0, 'T_age': None, 'aNrmInitMean': 0.0, 'aNrmInitStd': 1.0, 'neutral_measure': False, 'pLvlInitMean': 0.0, 'pLvlInitStd': 0.0}#
+
+ +
+
+time_inv_ = ['CRRA', 'DiscFac', 'BoroCnstArt', 'BoroCnstArt', 'vFuncBool', 'CubicBool', 'Rboro', 'Rsave']#
+
+ +
+
+calc_bounding_values()#
+

Calculate human wealth plus minimum and maximum MPC in an infinite +horizon model with only one period repeated indefinitely. Store results +as attributes of self. Human wealth is the present discounted value of +expected future income after receiving income this period, ignoring mort- +ality. The maximum MPC is the limit of the MPC as m –> mNrmMin. The +minimum MPC is the limit of the MPC as m –> infty. This version deals +with the different interest rates on borrowing vs saving.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+make_euler_error_func(mMax=100, approx_inc_dstn=True)#
+

Creates a “normalized Euler error” function for this instance, mapping +from market resources to “consumption error per dollar of consumption.” +Stores result in attribute eulerErrorFunc as an interpolated function. +Has option to use approximate income distribution stored in self.IncShkDstn +or to use a (temporary) very dense approximation.

+

SHOULD BE INHERITED FROM ConsIndShockModel

+
+
Parameters:
+
    +
  • mMax (float) – Maximum normalized market resources for the Euler error function.

  • +
  • approx_inc_dstn (Boolean) – Indicator for whether to use the approximate discrete income distri- +bution stored in self.IncShkDstn[0], or to use a very accurate +discrete approximation instead. When True, uses approximation in +IncShkDstn; when False, makes and uses a very dense approximation.

  • +
+
+
Return type:
+

None

+
+
+

Notes

+

This method is not used by any other code in the library. Rather, it is here +for expository and benchmarking purposes.

+
+ +
+
+get_Rfree()#
+

Returns an array of size self.AgentCount with self.Rboro or self.Rsave in each entry, based +on whether self.aNrmNow >< 0.

+
+
Parameters:
+

None

+
+
Returns:
+

RfreeNow – Array of size self.AgentCount with risk free interest rate for each agent.

+
+
Return type:
+

np.array

+
+
+
+ +
+
+check_conditions(verbose)#
+

This empty method overwrites the version inherited from its parent class, +IndShockConsumerType. The condition checks are not appropriate when Rfree +has multiple values.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+ +
+ + +
+ + + + + + + +
+ + + + +
+ + +
+ + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/Documentation/reference/ConsumptionSaving/ConsIndShockModelFast.html b/Documentation/reference/ConsumptionSaving/ConsIndShockModelFast.html new file mode 100644 index 000000000..2cc273d67 --- /dev/null +++ b/Documentation/reference/ConsumptionSaving/ConsIndShockModelFast.html @@ -0,0 +1,776 @@ + + + + + + + + + + + ConsIndShockModelFast — HARK latest documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+
+ + + + +
+ + + + + + + + + + + + + +
+ +
+ + +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ +
+

ConsIndShockModelFast#

+

Classes to solve canonical consumption-savings models with idiosyncratic shocks +to income. All models here assume CRRA utility with geometric discounting, no +bequest motive, and income shocks are fully transitory or fully permanent.

+
+
It currently solves three types of models:
    +
  1. A very basic “perfect foresight” consumption-savings model with no uncertainty.

  2. +
  3. A consumption-savings model with risk over transitory and permanent income shocks.

  4. +
  5. The model described in (2), with an interest rate for debt that differs +from the interest rate for savings. #todo

  6. +
+
+
+

See NARK econ-ark/HARK for information on variable naming conventions. +See HARK documentation for mathematical descriptions of the models being solved.

+
+
+class HARK.ConsumptionSaving.ConsIndShockModelFast.PerfForesightSolution(mNrm=array([0., 1.]), cNrm=array([0., 1.]), vFuncNvrsSlope=0.0, mNrmMin=0.0, hNrm=0.0, MPCmin=1.0, MPCmax=1.0)#
+

Bases: MetricObject

+

A class representing the solution of a single period of a consumption-saving +perfect foresight problem.

+

Here and elsewhere in the code, Nrm indicates that variables are normalized +by permanent income.

+
+
Parameters:
+
    +
  • mNrm (np.array) – (Normalized) corresponding market resource points for interpolation.

  • +
  • cNrm (np.array) – (Normalized) consumption points for interpolation.

  • +
  • vFuncNvrsSlope (float) – Constant slope of inverse value vFuncNvrs

  • +
  • mNrmMin (float) – The minimum allowable market resources for this period; the consump- +tion function (etc) are undefined for m < mNrmMin.

  • +
  • hNrm (float) – Human wealth after receiving income this period: PDV of all future +income, ignoring mortality.

  • +
  • MPCmin (float) – Infimum of the marginal propensity to consume this period. +MPC –> MPCmin as m –> infinity.

  • +
  • MPCmax (float) – Supremum of the marginal propensity to consume this period. +MPC –> MPCmax as m –> mNrmMin.

  • +
+
+
+
+
+distance_criteria = ['cNrm', 'mNrm']#
+
+ +
+ +
+
+class HARK.ConsumptionSaving.ConsIndShockModelFast.IndShockSolution(mNrm=array([0., 0.02040816, 0.04081633, 0.06122449, 0.08163265, 0.10204082, 0.12244898, 0.14285714, 0.16326531, 0.18367347, 0.20408163, 0.2244898, 0.24489796, 0.26530612, 0.28571429, 0.30612245, 0.32653061, 0.34693878, 0.36734694, 0.3877551, 0.40816327, 0.42857143, 0.44897959, 0.46938776, 0.48979592, 0.51020408, 0.53061224, 0.55102041, 0.57142857, 0.59183673, 0.6122449, 0.63265306, 0.65306122, 0.67346939, 0.69387755, 0.71428571, 0.73469388, 0.75510204, 0.7755102, 0.79591837, 0.81632653, 0.83673469, 0.85714286, 0.87755102, 0.89795918, 0.91836735, 0.93877551, 0.95918367, 0.97959184, 1.]), cNrm=array([0., 0.02040816, 0.04081633, 0.06122449, 0.08163265, 0.10204082, 0.12244898, 0.14285714, 0.16326531, 0.18367347, 0.20408163, 0.2244898, 0.24489796, 0.26530612, 0.28571429, 0.30612245, 0.32653061, 0.34693878, 0.36734694, 0.3877551, 0.40816327, 0.42857143, 0.44897959, 0.46938776, 0.48979592, 0.51020408, 0.53061224, 0.55102041, 0.57142857, 0.59183673, 0.6122449, 0.63265306, 0.65306122, 0.67346939, 0.69387755, 0.71428571, 0.73469388, 0.75510204, 0.7755102, 0.79591837, 0.81632653, 0.83673469, 0.85714286, 0.87755102, 0.89795918, 0.91836735, 0.93877551, 0.95918367, 0.97959184, 1.]), cFuncLimitIntercept=None, cFuncLimitSlope=None, mNrmMin=0.0, hNrm=0.0, MPCmin=1.0, MPCmax=1.0, Ex_IncNext=0.0, MPC=None, mNrmGrid=None, vNvrs=None, vNvrsP=None, MPCminNvrs=None)#
+

Bases: MetricObject

+

A class representing the solution of a single period of a consumption-saving +idiosyncratic shocks to permanent and transitory income problem.

+
+
Parameters:
+
    +
  • mNrm (np.array) – (Normalized) corresponding market resource points for interpolation.

  • +
  • cNrm (np.array) – (Normalized) consumption points for interpolation.

  • +
  • vFuncNvrsSlope (float) – Constant slope of inverse value vFuncNvrs

  • +
  • mNrmMin (float) – The minimum allowable market resources for this period; the consump- +tion function (etc) are undefined for m < mNrmMin.

  • +
  • hNrm (float) – Human wealth after receiving income this period: PDV of all future +income, ignoring mortality.

  • +
  • MPCmin (float) – Infimum of the marginal propensity to consume this period. +MPC –> MPCmin as m –> infinity.

  • +
  • MPCmax (float) – Supremum of the marginal propensity to consume this period. +MPC –> MPCmax as m –> mNrmMin.

  • +
+
+
+
+
+distance_criteria = ['cNrm', 'mNrm', 'mNrmMin']#
+
+ +
+ +
+
+class HARK.ConsumptionSaving.ConsIndShockModelFast.PerfForesightConsumerTypeFast(**kwargs)#
+

Bases: PerfForesightConsumerType

+

A version of the perfect foresight consumer type speed up by numba.

+
+
+solution_terminal_ = <HARK.ConsumptionSaving.ConsIndShockModelFast.PerfForesightSolution object>#
+
+ +
+
+solution_terminal_class#
+

alias of PerfForesightSolution

+
+ +
+
+update_solution_terminal()#
+

Update the terminal period solution. This method should be run when a +new AgentType is created or when CRRA changes.

+
+ +
+
+post_solve()#
+

Method that is run automatically at the end of a call to solve. Here, it +simply calls calc_stable_points() if appropriate: an infinite horizon +problem with a single repeated period in its cycle.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+ +
+
+class HARK.ConsumptionSaving.ConsIndShockModelFast.IndShockConsumerTypeFast(**kwargs)#
+

Bases: IndShockConsumerType, PerfForesightConsumerTypeFast

+

A version of the idiosyncratic shock consumer type speed up by numba.

+

If CubicBool and vFuncBool are both set to false it’s further optimized.

+
+
+solution_terminal_ = <HARK.ConsumptionSaving.ConsIndShockModelFast.IndShockSolution object>#
+
+ +
+
+solution_terminal_class#
+

alias of IndShockSolution

+
+ +
+
+update_solution_terminal()#
+

Update the terminal period solution. This method should be run when a +new AgentType is created or when CRRA changes.

+
+
Parameters:
+

none

+
+
Return type:
+

none

+
+
+
+ +
+
+post_solve()#
+

Method that is run automatically at the end of a call to solve. Here, it +simply calls calc_stable_points() if appropriate: an infinite horizon +problem with a single repeated period in its cycle.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+ +
+ + +
+ + + + + + + +
+ + + + + + + +
+ + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/Documentation/reference/ConsumptionSaving/ConsLaborModel.html b/Documentation/reference/ConsumptionSaving/ConsLaborModel.html new file mode 100644 index 000000000..94db25e39 --- /dev/null +++ b/Documentation/reference/ConsumptionSaving/ConsLaborModel.html @@ -0,0 +1,978 @@ + + + + + + + + + + + ConsLaborModel — HARK latest documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+
+ + + + +
+ + + + + + + + + + + + + +
+ +
+ + +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ +
+

ConsLaborModel#

+

Subclasses of AgentType representing consumers who make decisions about how much +labor to supply, as well as a consumption-saving decision.

+

It currently only has +one model: labor supply on the intensive margin (unit interval) with CRRA utility +from a composite good (of consumption and leisure), with transitory and permanent +productivity shocks. Agents choose their quantities of labor and consumption after +observing both of these shocks, so the transitory shock is a state variable.

+
+
+class HARK.ConsumptionSaving.ConsLaborModel.ConsumerLaborSolution(cFunc=None, LbrFunc=None, vFunc=None, vPfunc=None, bNrmMin=None)#
+

Bases: MetricObject

+

A class for representing one period of the solution to a Consumer Labor problem.

+
+
Parameters:
+
    +
  • cFunc (function) – The consumption function for this period, defined over normalized +bank balances and the transitory productivity shock: cNrm = cFunc(bNrm,TranShk).

  • +
  • LbrFunc (function) – The labor supply function for this period, defined over normalized +bank balances: Lbr = LbrFunc(bNrm,TranShk).

  • +
  • vFunc (function) – The beginning-of-period value function for this period, defined over +normalized bank balances: v = vFunc(bNrm,TranShk).

  • +
  • vPfunc (function) – The beginning-of-period marginal value (of bank balances) function for +this period, defined over normalized bank balances: vP = vPfunc(bNrm,TranShk).

  • +
  • bNrmMin (float) – The minimum allowable bank balances for this period, as a function of +the transitory shock. cFunc, LbrFunc, etc are undefined for bNrm < bNrmMin(TranShk).

  • +
+
+
+
+
+distance_criteria = ['cFunc', 'LbrFunc']#
+
+ +
+ +
+
+HARK.ConsumptionSaving.ConsLaborModel.make_log_polynomial_LbrCost(T_cycle, LbrCostCoeffs)#
+

Construct the age-varying cost of working LbrCost using polynomial coefficients +(over t_cycle) for (log) LbrCost.

+
+\[\text{LbrCost}_{t}=\exp(\sum \text{LbrCostCoeffs}_n t^{n})\]
+
+
Parameters:
+
    +
  • T_cycle (int) – Number of non-terminal period’s in the agent’s problem.

  • +
  • LbrCostCoeffs ([float]) – List or array of arbitrary length, representing polynomial coefficients +of t = 0,…,T_cycle, which determine (log) LbrCost.

  • +
+
+
Returns:
+

LbrCost – List of age-dependent labor utility cost parameters.

+
+
Return type:
+

[float]

+
+
+
+ +
+
+HARK.ConsumptionSaving.ConsLaborModel.make_labor_intmarg_solution_terminal(CRRA, aXtraGrid, LbrCost, WageRte, TranShkGrid)#
+

Constructs the terminal period solution and solves for optimal consumption +and labor when there is no future.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+HARK.ConsumptionSaving.ConsLaborModel.solve_ConsLaborIntMarg(solution_next, PermShkDstn, TranShkDstn, LivPrb, DiscFac, CRRA, Rfree, PermGroFac, BoroCnstArt, aXtraGrid, TranShkGrid, vFuncBool, CubicBool, WageRte, LbrCost)#
+

Solves one period of the consumption-saving model with endogenous labor supply +on the intensive margin by using the endogenous grid method to invert the first +order conditions for optimal composite consumption and between consumption and +leisure, obviating any search for optimal controls.

+
+
Parameters:
+
    +
  • solution_next (ConsumerLaborSolution) – The solution to the next period’s problem; must have the attributes +vPfunc and bNrmMinFunc representing marginal value of bank balances and +minimum (normalized) bank balances as a function of the transitory shock.

  • +
  • PermShkDstn ([np.array]) – Discrete distribution of permanent productivity shocks.

  • +
  • TranShkDstn ([np.array]) – Discrete distribution of transitory productivity shocks.

  • +
  • LivPrb (float) – Survival probability; likelihood of being alive at the beginning of +the succeeding period.

  • +
  • DiscFac (float) – Intertemporal discount factor.

  • +
  • CRRA (float) – Coefficient of relative risk aversion over the composite good.

  • +
  • Rfree (float) – Risk free interest rate on assets retained at the end of the period.

  • +
  • PermGroFac (float) – Expected permanent income growth factor for next period.

  • +
  • BoroCnstArt (float or None) – Borrowing constraint for the minimum allowable assets to end the +period with. Currently not handled, must be None.

  • +
  • aXtraGrid (np.array) – Array of “extra” end-of-period asset values– assets above the +absolute minimum acceptable level.

  • +
  • TranShkGrid (np.array) – Grid of transitory shock values to use as a state grid for interpolation.

  • +
  • vFuncBool (boolean) – An indicator for whether the value function should be computed and +included in the reported solution. Not yet handled, must be False.

  • +
  • CubicBool (boolean) – An indicator for whether the solver should use cubic or linear interpolation. +Cubic interpolation is not yet handled, must be False.

  • +
  • WageRte (float) – Wage rate per unit of labor supplied.

  • +
  • LbrCost (float) – Cost parameter for supplying labor: \(u_t = U(x_t)\), \(x_t = c_t z_t^{LbrCost}\), +where \(z_t\) is leisure \(= 1 - Lbr_t\).

  • +
+
+
Returns:
+

solution_now – The solution to this period’s problem, including a consumption function +cFunc, a labor supply function LbrFunc, and a marginal value function vPfunc; +each are defined over normalized bank balances and transitory prod shock. +Also includes bNrmMinNow, the minimum permissible bank balances as a function +of the transitory productivity shock.

+
+
Return type:
+

ConsumerLaborSolution

+
+
+
+ +
+
+class HARK.ConsumptionSaving.ConsLaborModel.LaborIntMargConsumerType(**kwds)#
+

Bases: IndShockConsumerType

+

A class representing agents who make a decision each period about how much +to consume vs save and how much labor to supply (as a fraction of their time). +They get CRRA utility from a composite good \(x_t = c_t*z_t^alpha\), and discount +future utility flows at a constant factor.

+
+\[\begin{split}\newcommand{\CRRA}{\rho} +\newcommand{\DiePrb}{\mathsf{D}} +\newcommand{\PermGroFac}{\Gamma} +\newcommand{\Rfree}{\mathsf{R}} +\newcommand{\DiscFac}{\beta} +\begin{align*} +v_t(b_t,\theta_{t}) &= \max_{c_t,L_{t}}u_{t}(c_t,L_t) + \DiscFac (1 - \DiePrb_{t+1}) \mathbb{E}_{t} \left[ (\PermGroFac_{t+1} \psi_{t+1})^{1-\CRRA} v_{t+1}(b_{t+1},\theta_{t+1}) \right], \\ +& \text{s.t.} \\ +a_t &= m_t - c_t, \\ +m_{t+1} &= b_{t+1} + L_{t}\theta_{t} \text{WageRte}_{t}, \\ +b_{t+1} &= a_t \Rfree_{t+1}/(\PermGroFac_{t+1} \psi_{t+1}), \\ +(\psi_{t+1},\theta_{t+1}) &\sim F_{t+1}, \\ +\mathbb{E}[\psi]=\mathbb{E}[\theta] &= 1, \\ +u_{t}(c,L) &= \frac{(c (1-L)^{\alpha_t})^{1-\CRRA}}{1-\CRRA} \\ +\end{align*}\end{split}\]
+
+
Constructors:
+
+
+
Solving Parameters:
+
    +
  • cycles (int) – 0 specifies an infinite horizon model, 1 specifies a finite model.

  • +
  • T_cycle (int) – Number of periods in the cycle for this agent type.

  • +
  • CRRA (float, default=2.0, \(\rho\)) – Coefficient of Relative Risk Aversion. Must be greater than \(\max_{t}({\frac{\alpha_t}{\alpha_t+1}})\)

  • +
  • Rfree (float or list[float], time varying, \(\mathsf{R}\)) – Risk Free interest rate. Pass a list of floats to make Rfree time varying.

  • +
  • DiscFac (float, \(\beta\)) – Intertemporal discount factor.

  • +
  • LivPrb (list[float], time varying, \(1-\mathsf{D}\)) – Survival probability after each period.

  • +
  • WageRte (list[float], time varying) – Wage rate paid on labor income.

  • +
  • PermGroFac (list[float], time varying, \(\Gamma\)) – Permanent income growth factor.

  • +
+
+
Simulation Parameters:
+
    +
  • AgentCount (int) – Number of agents of this kind that are created during simulations.

  • +
  • T_age (int) – Age after which to automatically kill agents, None to ignore.

  • +
  • T_sim (int, required for simulation) – Number of periods to simulate.

  • +
  • track_vars (list[strings]) – List of variables that should be tracked when running the simulation. +For this agent, the options are ‘Lbr’, ‘PermShk’, ‘TranShk’, ‘aLvl’, ‘aNrm’, ‘bNrm’, ‘cNrm’, ‘mNrm’, ‘pLvl’, and ‘who_dies’.

    +

    PermShk is the agent’s permanent income shock

    +

    TranShk is the agent’s transitory income shock

    +

    aLvl is the nominal asset level

    +

    aNrm is the normalized assets

    +

    bNrm is the normalized resources without this period’s labor income

    +

    cNrm is the normalized consumption

    +

    mNrm is the normalized market resources

    +

    pLvl is the permanent income level

    +

    Lbr is the share of the agent’s time spent working

    +

    who_dies is the array of which agents died

    +
  • +
  • aNrmInitMean (float) – Mean of Log initial Normalized Assets.

  • +
  • aNrmInitStd (float) – Std of Log initial Normalized Assets.

  • +
  • pLvlInitMean (float) – Mean of Log initial permanent income.

  • +
  • pLvlInitStd (float) – Std of Log initial permanent income.

  • +
  • PermGroFacAgg (float) – Aggregate permanent income growth factor (The portion of PermGroFac attributable to aggregate productivity growth).

  • +
  • PerfMITShk (boolean) – Do Perfect Foresight MIT Shock (Forces Newborns to follow solution path of the agent they replaced if True).

  • +
  • NewbornTransShk (boolean) – Whether Newborns have transitory shock.

  • +
+
+
Attributes:
+
    +
  • solution (list[Consumer solution object]) – Created by the solve() method. Finite horizon models create a list with T_cycle+1 elements, for each period in the solution. +Infinite horizon solutions return a list with T_cycle elements for each period in the cycle.

    +

    Visit HARK.ConsumptionSaving.ConsLaborModel.ConsumerLaborSolution for more information about the solution.

    +
  • +
  • history (Dict[Array]) – Created by running the simulate() method. +Contains the variables in track_vars. Each item in the dictionary is an array with the shape (T_sim,AgentCount). +Visit HARK.core.AgentType.simulate for more information.

  • +
+
+
+
+
+IncShkDstn_default = {'IncUnemp': 0.0, 'IncUnempRet': 0.0, 'PermShkCount': 16, 'PermShkStd': [0.1], 'T_retire': 0, 'TranShkCount': 15, 'TranShkStd': [0.1], 'UnempPrb': 0.05, 'UnempPrbRet': 0.005}#
+
+ +
+
+aXtraGrid_default = {'aXtraCount': 200, 'aXtraExtra': None, 'aXtraMax': 80.0, 'aXtraMin': 0.001, 'aXtraNestFac': 3}#
+
+ +
+
+LbrCost_default = {'LbrCostCoeffs': [-1.0]}#
+
+ +
+
+solving_default = {'BoroCnstArt': None, 'CRRA': 2.0, 'CubicBool': False, 'DiscFac': 0.96, 'LivPrb': [0.98], 'PermGroFac': [1.01], 'Rfree': 1.03, 'T_cycle': 1, 'WageRte': [1.0], 'constructors': {'IncShkDstn': <function construct_lognormal_income_process_unemployment>, 'LbrCost': <function make_log_polynomial_LbrCost>, 'PermShkDstn': <function get_PermShkDstn_from_IncShkDstn>, 'TranShkDstn': <function get_TranShkDstn_from_IncShkDstn>, 'TranShkGrid': <function get_TranShkGrid_from_TranShkDstn>, 'aXtraGrid': <function make_assets_grid>, 'solution_terminal': <function make_labor_intmarg_solution_terminal>}, 'cycles': 1, 'vFuncBool': False}#
+
+ +
+
+simulation_default = {'AgentCount': 10000, 'NewbornTransShk': False, 'PerfMITShk': False, 'PermGroFacAgg': 1.0, 'T_age': None, 'aNrmInitMean': 0.0, 'aNrmInitStd': 1.0, 'neutral_measure': False, 'pLvlInitMean': 0.0, 'pLvlInitStd': 0.0}#
+
+ +
+
+time_vary_ = ['LivPrb', 'PermGroFac', 'WageRte']#
+
+ +
+
+time_inv_ = ['CRRA', 'DiscFac', 'BoroCnstArt', 'BoroCnstArt', 'vFuncBool', 'CubicBool']#
+
+ +
+
+update()#
+

Update the income process, the assets grid, and the terminal solution.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+calc_bounding_values()#
+

NOT YET IMPLEMENTED FOR THIS CLASS

+
+ +
+
+make_euler_error_func(mMax=100, approx_inc_dstn=True)#
+

NOT YET IMPLEMENTED FOR THIS CLASS

+
+ +
+
+get_states()#
+

Calculates updated values of normalized bank balances and permanent income +level for each agent. Uses pLvlNow, aNrmNow, PermShkNow. Calls the get_states +method for the parent class, then erases mNrmNow, which cannot be calculated +until after get_controls in this model.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+get_controls()#
+

Calculates consumption and labor supply for each consumer of this type +using the consumption and labor functions in each period of the cycle.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+get_poststates()#
+

Calculates end-of-period assets for each consumer of this type.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+plot_cFunc(t, bMin=None, bMax=None, ShkSet=None)#
+

Plot the consumption function by bank balances at a given set of transitory shocks.

+
+
Parameters:
+
    +
  • t (int) – Time index of the solution for which to plot the consumption function.

  • +
  • bMin (float or None) – Minimum value of bNrm at which to begin the plot. If None, defaults +to the minimum allowable value of bNrm for each transitory shock.

  • +
  • bMax (float or None) – Maximum value of bNrm at which to end the plot. If None, defaults +to bMin + 20.

  • +
  • ShkSet ([float] or None) – Array or list of transitory shocks at which to plot the consumption +function. If None, defaults to the TranShkGrid for this time period.

  • +
+
+
Return type:
+

None

+
+
+
+ +
+
+plot_LbrFunc(t, bMin=None, bMax=None, ShkSet=None)#
+

Plot the labor supply function by bank balances at a given set of transitory shocks.

+
+
Parameters:
+
    +
  • t (int) – Time index of the solution for which to plot the labor supply function.

  • +
  • bMin (float or None) – Minimum value of bNrm at which to begin the plot. If None, defaults +to the minimum allowable value of bNrm for each transitory shock.

  • +
  • bMax (float or None) – Maximum value of bNrm at which to end the plot. If None, defaults +to bMin + 20.

  • +
  • ShkSet ([float] or None) – Array or list of transitory shocks at which to plot the labor supply +function. If None, defaults to the TranShkGrid for this time period.

  • +
+
+
Return type:
+

None

+
+
+
+ +
+ +
+ + +
+ + + + + + + +
+ + + + + + + +
+ + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/Documentation/reference/ConsumptionSaving/ConsMarkovModel.html b/Documentation/reference/ConsumptionSaving/ConsMarkovModel.html new file mode 100644 index 000000000..4d03087d1 --- /dev/null +++ b/Documentation/reference/ConsumptionSaving/ConsMarkovModel.html @@ -0,0 +1,869 @@ + + + + + + + + + + + ConsMarkovModel — HARK latest documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+
+ + + + +
+ + + + + + + + + + + + + +
+ +
+ + +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ +
+

ConsMarkovModel#

+

Classes to solve and simulate consumption-savings model with a discrete, exogenous, +stochastic Markov state. The only solver here extends ConsIndShockModel to +include a Markov state; the interest factor, permanent growth factor, and income +distribution can vary with the discrete state.

+
+
+class HARK.ConsumptionSaving.ConsMarkovModel.MarkovConsumerType(**kwds)#
+

Bases: IndShockConsumerType

+

An agent in the Markov consumption-saving model. His problem is defined by a sequence +of income distributions, survival probabilities, discount factors, and permanent +income growth rates, as well as time invariant values for risk aversion, the +interest rate, the grid of end-of-period assets, and how he is borrowing constrained.

+
+
+time_vary_ = ['LivPrb', 'PermGroFac', 'MrkvArray']#
+
+ +
+
+shock_vars_ = ['PermShk', 'TranShk', 'Mrkv']#
+
+ +
+
+state_vars = ['pLvl', 'PlvlAgg', 'bNrm', 'mNrm', 'aNrm', 'aLvl', 'Mrkv']#
+
+ +
+
+update()#
+

Update the Markov array, the income process, the assets grid, and +the terminal solution.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+check_markov_inputs()#
+

Many parameters used by MarkovConsumerType are arrays. Make sure those arrays are the +right shape.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+pre_solve()#
+

Check to make sure that the inputs that are specific to MarkovConsumerType +are of the right shape (if arrays) or length (if lists).

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+initialize_sim()#
+

Prepares this AgentType for a new simulation. Resets the internal random number generator, +makes initial states for all agents (using sim_birth), clears histories of tracked variables.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+reset_rng()#
+

Extended method that ensures random shocks are drawn from the same sequence +on each simulation, which is important for structural estimation. This +method is called automatically by initialize_sim().

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+sim_death()#
+

Determines which agents die this period and must be replaced. Uses the sequence in LivPrb +to determine survival probabilities for each agent.

+
+
Parameters:
+

None

+
+
Returns:
+

which_agents – Boolean array of size AgentCount indicating which agents die.

+
+
Return type:
+

np.array(bool)

+
+
+
+ +
+
+sim_birth(which_agents)#
+

Makes new Markov consumer by drawing initial normalized assets, permanent income levels, and +discrete states. Calls IndShockConsumerType.sim_birth, then draws from initial Markov distribution.

+
+
Parameters:
+

which_agents (np.array(Bool)) – Boolean array of size self.AgentCount indicating which agents should be “born”.

+
+
Return type:
+

None

+
+
+
+ +
+
+get_markov_states()#
+

Draw new Markov states for each agent in the simulated population, using +the attribute MrkvArray to determine transition probabilities.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+get_shocks()#
+

Gets new Markov states and permanent and transitory income shocks for this period. Samples +from IncShkDstn for each period-state in the cycle.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+read_shocks_from_history()#
+

A slight modification of AgentType.read_shocks that makes sure that MrkvNow is int, not float.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+get_Rfree()#
+

Returns an array of size self.AgentCount with interest factor that varies with discrete state.

+
+
Parameters:
+

None

+
+
Returns:
+

RfreeNow – Array of size self.AgentCount with risk free interest rate for each agent.

+
+
Return type:
+

np.array

+
+
+
+ +
+
+get_controls()#
+

Calculates consumption for each consumer of this type using the consumption functions.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+calc_bounding_values()#
+

Calculate human wealth plus minimum and maximum MPC in an infinite +horizon model with only one period repeated indefinitely. Store results +as attributes of self. Human wealth is the present discounted value of +expected future income after receiving income this period, ignoring mort- +ality. The maximum MPC is the limit of the MPC as m –> mNrmMin. The +minimum MPC is the limit of the MPC as m –> infty. Results are all +np.array with elements corresponding to each Markov state.

+

NOT YET IMPLEMENTED FOR THIS CLASS

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+make_euler_error_func(mMax=100, approx_inc_dstn=True)#
+

Creates a “normalized Euler error” function for this instance, mapping +from market resources to “consumption error per dollar of consumption.” +Stores result in attribute eulerErrorFunc as an interpolated function. +Has option to use approximate income distribution stored in self.IncShkDstn +or to use a (temporary) very dense approximation.

+

NOT YET IMPLEMENTED FOR THIS CLASS

+
+
Parameters:
+
    +
  • mMax (float) – Maximum normalized market resources for the Euler error function.

  • +
  • approx_inc_dstn (Boolean) – Indicator for whether to use the approximate discrete income distri- +bution stored in self.IncShkDstn[0], or to use a very accurate +discrete approximation instead. When True, uses approximation in +IncShkDstn; when False, makes and uses a very dense approximation.

  • +
+
+
Return type:
+

None

+
+
+

Notes

+

This method is not used by any other code in the library. Rather, it is here +for expository and benchmarking purposes.

+
+ +
+ +
+ + +
+ + + + + + + +
+ + + + + + + +
+ + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/Documentation/reference/ConsumptionSaving/ConsMedModel.html b/Documentation/reference/ConsumptionSaving/ConsMedModel.html new file mode 100644 index 000000000..9f78431ef --- /dev/null +++ b/Documentation/reference/ConsumptionSaving/ConsMedModel.html @@ -0,0 +1,1175 @@ + + + + + + + + + + + ConsMedModel — HARK latest documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+
+ + + + +
+ + + + + + + + + + + + + +
+ +
+ + +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ +
+

ConsMedModel#

+

Consumption-saving models that also include medical spending.

+
+
+class HARK.ConsumptionSaving.ConsMedModel.MedShockPolicyFunc(xFunc, xLvlGrid, MedShkGrid, MedPrice, CRRAcon, CRRAmed, xLvlCubicBool=False, MedShkCubicBool=False)#
+

Bases: MetricObject

+

Class for representing the policy function in the medical shocks model: opt- +imal consumption and medical care for given market resources, permanent income, +and medical need shock. Always obeys Con + MedPrice*Med = optimal spending.

+
+
Parameters:
+
    +
  • xFunc (function) – Optimal total spending as a function of market resources, permanent +income, and the medical need shock.

  • +
  • xLvlGrid (np.array) – 1D array of total expenditure levels.

  • +
  • MedShkGrid (np.array) – 1D array of medical shocks.

  • +
  • MedPrice (float) – Relative price of a unit of medical care.

  • +
  • CRRAcon (float) – Coefficient of relative risk aversion for consumption.

  • +
  • CRRAmed (float) – Coefficient of relative risk aversion for medical care.

  • +
  • xLvlCubicBool (boolean) – Indicator for whether cubic spline interpolation (rather than linear) +should be used in the xLvl dimension.

  • +
  • MedShkCubicBool (boolean) – Indicator for whether bicubic interpolation should be used; only +operative when xLvlCubicBool=True.

  • +
+
+
+
+
+distance_criteria = ['xFunc', 'cFunc', 'MedPrice']#
+
+ +
+
+derivativeX(mLvl, pLvl, MedShk)#
+

Evaluate the derivative of consumption and medical care with respect to +market resources at given levels of market resources, permanent income, +and medical need shocks.

+
+
Parameters:
+
    +
  • mLvl (np.array) – Market resource levels.

  • +
  • pLvl (np.array) – Permanent income levels; should be same size as mLvl.

  • +
  • MedShk (np.array) – Medical need shocks; should be same size as mLvl.

  • +
+
+
Returns:
+

    +
  • dcdm (np.array) – Derivative of consumption with respect to market resources for each +point in (xLvl,MedShk).

  • +
  • dMeddm (np.array) – Derivative of medical care with respect to market resources for each +point in (xLvl,MedShk).

  • +
+

+
+
+
+ +
+
+derivativeY(mLvl, pLvl, MedShk)#
+

Evaluate the derivative of consumption and medical care with respect to +permanent income at given levels of market resources, permanent income, +and medical need shocks.

+
+
Parameters:
+
    +
  • mLvl (np.array) – Market resource levels.

  • +
  • pLvl (np.array) – Permanent income levels; should be same size as mLvl.

  • +
  • MedShk (np.array) – Medical need shocks; should be same size as mLvl.

  • +
+
+
Returns:
+

    +
  • dcdp (np.array) – Derivative of consumption with respect to permanent income for each +point in (xLvl,MedShk).

  • +
  • dMeddp (np.array) – Derivative of medical care with respect to permanent income for each +point in (xLvl,MedShk).

  • +
+

+
+
+
+ +
+
+derivativeZ(mLvl, pLvl, MedShk)#
+

Evaluate the derivative of consumption and medical care with respect to +medical need shock at given levels of market resources, permanent income, +and medical need shocks.

+
+
Parameters:
+
    +
  • mLvl (np.array) – Market resource levels.

  • +
  • pLvl (np.array) – Permanent income levels; should be same size as mLvl.

  • +
  • MedShk (np.array) – Medical need shocks; should be same size as mLvl.

  • +
+
+
Returns:
+

    +
  • dcdShk (np.array) – Derivative of consumption with respect to medical need for each +point in (xLvl,MedShk).

  • +
  • dMeddShk (np.array) – Derivative of medical care with respect to medical need for each +point in (xLvl,MedShk).

  • +
+

+
+
+
+ +
+ +
+
+class HARK.ConsumptionSaving.ConsMedModel.cThruXfunc(xFunc, cFunc)#
+

Bases: MetricObject

+

Class for representing consumption function derived from total expenditure +and consumption.

+
+
Parameters:
+
    +
  • xFunc (function) – Optimal total spending as a function of market resources, permanent +income, and the medical need shock.

  • +
  • cFunc (function) – Optimal consumption as a function of total spending and the medical +need shock.

  • +
+
+
+
+
+distance_criteria = ['xFunc', 'cFunc']#
+
+ +
+
+derivativeX(mLvl, pLvl, MedShk)#
+

Evaluate the derivative of consumption with respect to market resources +at given levels of market resources, permanent income, and medical need +shocks.

+
+
Parameters:
+
    +
  • mLvl (np.array) – Market resource levels.

  • +
  • pLvl (np.array) – Permanent income levels; should be same size as mLvl.

  • +
  • MedShk (np.array) – Medical need shocks; should be same size as mLvl.

  • +
+
+
Returns:
+

dcdm – Derivative of consumption with respect to market resources for each +point in (xLvl,MedShk).

+
+
Return type:
+

np.array

+
+
+
+ +
+
+derivativeY(mLvl, pLvl, MedShk)#
+

Evaluate the derivative of consumption and medical care with respect to +permanent income at given levels of market resources, permanent income, +and medical need shocks.

+
+
Parameters:
+
    +
  • mLvl (np.array) – Market resource levels.

  • +
  • pLvl (np.array) – Permanent income levels; should be same size as mLvl.

  • +
  • MedShk (np.array) – Medical need shocks; should be same size as mLvl.

  • +
+
+
Returns:
+

dcdp – Derivative of consumption with respect to permanent income for each +point in (xLvl,MedShk).

+
+
Return type:
+

np.array

+
+
+
+ +
+
+derivativeZ(mLvl, pLvl, MedShk)#
+

Evaluate the derivative of consumption and medical care with respect to +medical need shock at given levels of market resources, permanent income, +and medical need shocks.

+
+
Parameters:
+
    +
  • mLvl (np.array) – Market resource levels.

  • +
  • pLvl (np.array) – Permanent income levels; should be same size as mLvl.

  • +
  • MedShk (np.array) – Medical need shocks; should be same size as mLvl.

  • +
+
+
Returns:
+

dcdShk – Derivative of consumption with respect to medical need for each +point in (xLvl,MedShk).

+
+
Return type:
+

np.array

+
+
+
+ +
+ +
+
+class HARK.ConsumptionSaving.ConsMedModel.MedThruXfunc(xFunc, cFunc, MedPrice)#
+

Bases: MetricObject

+

Class for representing medical care function derived from total expenditure +and consumption.

+
+
Parameters:
+
    +
  • xFunc (function) – Optimal total spending as a function of market resources, permanent +income, and the medical need shock.

  • +
  • cFunc (function) – Optimal consumption as a function of total spending and the medical +need shock.

  • +
  • MedPrice (float) – Relative price of a unit of medical care.

  • +
+
+
+
+
+distance_criteria = ['xFunc', 'cFunc', 'MedPrice']#
+
+ +
+
+derivativeX(mLvl, pLvl, MedShk)#
+

Evaluate the derivative of consumption and medical care with respect to +market resources at given levels of market resources, permanent income, +and medical need shocks.

+
+
Parameters:
+
    +
  • mLvl (np.array) – Market resource levels.

  • +
  • pLvl (np.array) – Permanent income levels; should be same size as mLvl.

  • +
  • MedShk (np.array) – Medical need shocks; should be same size as mLvl.

  • +
+
+
Returns:
+

    +
  • dcdm (np.array) – Derivative of consumption with respect to market resources for each +point in (xLvl,MedShk).

  • +
  • dMeddm (np.array) – Derivative of medical care with respect to market resources for each +point in (xLvl,MedShk).

  • +
+

+
+
+
+ +
+
+derivativeY(mLvl, pLvl, MedShk)#
+

Evaluate the derivative of medical care with respect to permanent income +at given levels of market resources, permanent income, and medical need +shocks.

+
+
Parameters:
+
    +
  • mLvl (np.array) – Market resource levels.

  • +
  • pLvl (np.array) – Permanent income levels; should be same size as mLvl.

  • +
  • MedShk (np.array) – Medical need shocks; should be same size as mLvl.

  • +
+
+
Returns:
+

dMeddp – Derivative of medical care with respect to permanent income for each +point in (xLvl,MedShk).

+
+
Return type:
+

np.array

+
+
+
+ +
+
+derivativeZ(mLvl, pLvl, MedShk)#
+

Evaluate the derivative of medical care with respect to medical need +shock at given levels of market resources, permanent income, and medical +need shocks.

+
+
Parameters:
+
    +
  • mLvl (np.array) – Market resource levels.

  • +
  • pLvl (np.array) – Permanent income levels; should be same size as mLvl.

  • +
  • MedShk (np.array) – Medical need shocks; should be same size as mLvl.

  • +
+
+
Returns:
+

dMeddShk – Derivative of medical care with respect to medical need for each +point in (xLvl,MedShk).

+
+
Return type:
+

np.array

+
+
+
+ +
+ +
+
+class HARK.ConsumptionSaving.ConsMedModel.MedShockConsumerType(**kwds)#
+

Bases: PersistentShockConsumerType

+

A consumer type based on GenIncShockConsumerType, with two types of consumption goods (medical and nonmedical) and random shocks to medical utility.

+
+\[\begin{split}\begin{eqnarray*} +V_t(M_t,P_t, \text{medShk}_t) &=& \max_{C_t, med_t} U_t(C_t, med_t) + \beta (1-\mathsf{D}_{t+1}) \mathbb{E} [V_{t+1}(M_{t+1}, P_{t+1}, \text{medShk}_{t+1})], \\ +A_t &=& M_t - X_t, \\ +X_t &=& C_t +med_t \textbf{ medPrice}_t,\\ +A_t/P_t &\geq& \underline{a}, \\ +M_{t+1} &=& R A_t + \theta_{t+1}, \\ +P_{t+1} &=& G_{t+1}(P_t)\psi_{t+1}, \\ +(\psi_{t+1},\theta_{t+1},\text{medShk}_{t+1}) &\sim& F_{t+1}\\ +U_t(C, med) &=& \frac{C^{1-\rho}}{1-\rho}+\text{ medShk}_t \frac{med^{1-\rho_{med}}}{1-\rho_{med}}. +\end{eqnarray*}\end{split}\]
+
+
Constructors:
+
+
+
Solving Parameters:
+
    +
  • cycles (int) – 0 specifies an infinite horizon model, 1 specifies a finite model.

  • +
  • T_cycle (int) – Number of periods in the cycle for this agent type.

  • +
  • CRRA (float, \(\rho\)) – Coefficient of Relative Risk Aversion.

  • +
  • CRRAmed (float, \(\rho_{med}\)) – Coefficient of Relative Risk Aversion on Medical Care

  • +
  • Rfree (float or list[float], time varying, \(\mathsf{R}\)) – Risk Free interest rate. Pass a list of floats to make Rfree time varying.

  • +
  • DiscFac (float, \(\beta\)) – Intertemporal discount factor.

  • +
  • LivPrb (list[float], time varying, \(1-\mathsf{D}\)) – Survival probability after each period.

  • +
  • PermGroFac (list[float], time varying, \(\Gamma\)) – Permanent income growth factor.

  • +
  • BoroCnstArt (float, \(\underline{a}\)) – The minimum Asset/Perminant Income ratio, None to ignore.

  • +
  • vFuncBool (bool) – Whether to calculate the value function during solution.

  • +
  • CubicBool (bool) – Whether to use cubic spline interpoliation.

  • +
+
+
Simulation Parameters:
+
    +
  • AgentCount (int) – Number of agents of this kind that are created during simulations.

  • +
  • T_age (int) – Age after which to automatically kill agents, None to ignore.

  • +
  • T_sim (int, required for simulation) – Number of periods to simulate.

  • +
  • track_vars (list[strings]) – List of variables that should be tracked when running the simulation. +For this agent, the options are ‘Med’, ‘MedShk’, ‘PermShk’, ‘TranShk’, ‘aLvl’, ‘cLvl’, ‘mLvl’, ‘pLvl’, and ‘who_dies’.

    +

    PermShk is the agent’s permanent income shock

    +

    MedShk is the agent’s medical utility shock

    +

    TranShk is the agent’s transitory income shock

    +

    aLvl is the nominal asset level

    +

    cLvl is the nominal consumption level

    +

    Med is the nominal medical spending level

    +

    mLvl is the nominal market resources

    +

    pLvl is the permanent income level

    +

    who_dies is the array of which agents died

    +
  • +
  • aNrmInitMean (float) – Mean of Log initial Normalized Assets.

  • +
  • aNrmInitStd (float) – Std of Log initial Normalized Assets.

  • +
  • pLvlInitMean (float) – Mean of Log initial permanent income.

  • +
  • pLvlInitStd (float) – Std of Log initial permanent income.

  • +
  • PermGroFacAgg (float) – Aggregate permanent income growth factor (The portion of PermGroFac attributable to aggregate productivity growth).

  • +
  • PerfMITShk (boolean) – Do Perfect Foresight MIT Shock (Forces Newborns to follow solution path of the agent they replaced if True).

  • +
  • NewbornTransShk (boolean) – Whether Newborns have transitory shock.

  • +
+
+
Attributes:
+
    +
  • solution (list[Consumer solution object]) – Created by the solve() method. Finite horizon models create a list with T_cycle+1 elements, for each period in the solution. +Infinite horizon solutions return a list with T_cycle elements for each period in the cycle.

    +

    Unlike other models with this solution type, this model’s variables are NOT normalized. +The solution functions additionally depend on the permanent income level and the medical shock. +For example, \(C=\text{cFunc}(M,P,MedShk)\). +hNrm has been replaced by hLvl which is a function of permanent income. +MPC max has not yet been implemented for this class. It will be a function of permanent income.

    +

    This solution has two additional functions +\(\text{Med}=\text{MedFunc}(M,P,\text{MedShk})\): returns the agent’s spending on Medical care

    +

    \([C,Med]=\text{policyFunc}(M,P,\text{MedShk})\): returns the agent’s spending on consumption and Medical care as numpy arrays

    +

    Visit HARK.ConsumptionSaving.ConsIndShockModel.ConsumerSolution for more information about the solution.

    +
  • +
  • history (Dict[Array]) – Created by running the simulate() method. +Contains the variables in track_vars. Each item in the dictionary is an array with the shape (T_sim,AgentCount). +Visit HARK.core.AgentType.simulate for more information.

  • +
+
+
+
+
+default_params_ = {'AgentCount': 10000, 'BoroCnstArt': 0.0, 'CRRA': 2.0, 'CRRAmed': 3.0, 'CubicBool': False, 'DiscFac': 0.96, 'IncUnemp': 0.3, 'IncUnempRet': 0.0, 'LivPrb': [0.98], 'MedPrice': [1.5], 'MedShkAvg': [0.001], 'MedShkCount': 5, 'MedShkCountTail': 15, 'MedShkStd': [5.0], 'NewbornTransShk': False, 'PerfMITShk': False, 'PermGroFac': [1.0], 'PermGroFacAgg': 1.0, 'PermShkCount': 7, 'PermShkStd': [0.1], 'PrstIncCorr': 0.98, 'Rfree': 1.03, 'T_age': None, 'T_cycle': 1, 'T_retire': 0, 'TranShkCount': 7, 'TranShkStd': [0.1], 'UnempPrb': 0.05, 'UnempPrbRet': 0.005, 'aNrmInitMean': 0.0, 'aNrmInitStd': 1.0, 'aXtraCount': 32, 'aXtraExtra': [0.005, 0.01], 'aXtraMax': 30, 'aXtraMin': 0.001, 'aXtraNestFac': 3, 'constructors': {'IncShkDstn': <function construct_lognormal_income_process_unemployment>, 'MedShkDstn': <function make_lognormal_MedShkDstn>, 'PermShkDstn': <function get_PermShkDstn_from_IncShkDstn>, 'TranShkDstn': <function get_TranShkDstn_from_IncShkDstn>, 'aXtraGrid': <function make_assets_grid>, 'pLvlGrid': <function make_pLvlGrid_by_simulation>, 'pLvlNextFunc': <function make_AR1_style_pLvlNextFunc>, 'pLvlPctiles': <function make_basic_pLvlPctiles>, 'solution_terminal': <function make_MedShock_solution_terminal>}, 'cycles': 1, 'neutral_measure': False, 'pLvlExtra': [0.0001], 'pLvlInitMean': 0.0, 'pLvlInitStd': 0.4, 'pLvlPctiles_bound': [0.05, 0.95], 'pLvlPctiles_count': 19, 'pLvlPctiles_tail_count': 4, 'pLvlPctiles_tail_order': 2.718281828459045, 'vFuncBool': False}#
+
+ +
+
+shock_vars_ = ['PermShk', 'TranShk', 'MedShk']#
+
+ +
+
+state_vars = ['pLvl', 'mLvl', 'aLvl', 'mLvl']#
+
+ +
+
+pre_solve()#
+

Method that is run automatically just before solution by backward iteration. +Solves the (trivial) terminal period and does a quick check on the borrowing +constraint and MaxKinks attribute (only relevant in constrained, infinite +horizon problems).

+
+ +
+
+update()#
+

Update the income process, the assets grid, the permanent income grid, +the medical shock distribution, and the terminal solution.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+update_med_shock_process()#
+

Constructs discrete distributions of medical preference shocks for each +period in the cycle. Distributions are saved as attribute MedShkDstn, +which is added to time_vary.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+reset_rng()#
+

Reset the RNG behavior of this type. This method is called automatically +by initialize_sim(), ensuring that each simulation run uses the same sequence +of random shocks; this is necessary for structural estimation to work. +This method extends PersistentShockConsumerType.reset_rng() to also reset +elements of MedShkDstn.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+get_shocks()#
+

Gets permanent and transitory income shocks for this period as well as medical need shocks +and the price of medical care.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+get_controls()#
+

Calculates consumption and medical care for each consumer of this type using the consumption +and medical care functions.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+get_poststates()#
+

Calculates end-of-period assets for each consumer of this type.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+ +
+
+HARK.ConsumptionSaving.ConsMedModel.make_lognormal_MedShkDstn(T_cycle, MedShkAvg, MedShkStd, MedShkCount, MedShkCountTail, RNG, MedShkTailBound=[0.0, 0.9])#
+

Constructs discretized lognormal distributions of medical preference shocks +for each period in the cycle.

+
+\[\begin{split}\text{ medShk}_t \sim \exp(\mathcal{N}(\textbf{MedShkStd}^2)) \\ +\mathbb{E}[\text{medShk}_t]=\textbf{MedShkAvg}\end{split}\]
+
+
Parameters:
+
    +
  • T_cycle (int) – Number of non-terminal periods in the agent’s cycle.

  • +
  • MedShkAvg ([float]) – Mean of medical needs shock in each period of the problem.

  • +
  • MedShkStd ([float]) – Standard deviation of log medical needs shock in each period of the problem.

  • +
  • MedShkCount (int) – Number of equiprobable nodes in the “body” of the discretization.

  • +
  • MedShkCountTail (int) – Number of nodes in each “tail” of the discretization.

  • +
  • RNG (RandomState) – The AgentType’s internal random number generator.

  • +
  • MedShkTailBound ([float,float]) – CDF bounds for the tail of the discretization.

  • +
+
+
Returns:
+

MedShkDstn

+
+
Return type:
+

[DiscreteDistribuion]

+
+
+
+ +
+ + +
+ + + + + + + +
+ + + + + + + +
+ + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/Documentation/reference/ConsumptionSaving/ConsPortfolioModel.html b/Documentation/reference/ConsumptionSaving/ConsPortfolioModel.html new file mode 100644 index 000000000..84e6984c9 --- /dev/null +++ b/Documentation/reference/ConsumptionSaving/ConsPortfolioModel.html @@ -0,0 +1,842 @@ + + + + + + + + + + + ConsPortfolioModel — HARK latest documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+
+ + + + +
+ + + + + + + + + + + + + +
+ +
+ + +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ +
+

ConsPortfolioModel#

+

This file contains classes and functions for representing, solving, and simulating +agents who must allocate their resources among consumption, saving in a risk-free +asset (with a low return), and saving in a risky asset (with higher average return).

+
+
+class HARK.ConsumptionSaving.ConsPortfolioModel.PortfolioSolution(cFuncAdj=None, ShareFuncAdj=None, vFuncAdj=None, vPfuncAdj=None, cFuncFxd=None, ShareFuncFxd=None, vFuncFxd=None, dvdmFuncFxd=None, dvdsFuncFxd=None, aGrid=None, Share_adj=None, EndOfPrddvda_adj=None, ShareGrid=None, EndOfPrddvda_fxd=None, EndOfPrddvds_fxd=None, AdjPrb=None)#
+

Bases: MetricObject

+

A class for representing the single period solution of the portfolio choice model.

+
+
Parameters:
+
    +
  • cFuncAdj (Interp1D) – Consumption function over normalized market resources when the agent is able +to adjust their portfolio shares: \(c_t=\text{cFuncAdj} (m_t)\).

  • +
  • ShareFuncAdj (Interp1D) – Risky share function over normalized market resources when the agent is able +to adjust their portfolio shares: \(S_t=\text{ShareFuncAdj} (m_t)\).

  • +
  • vFuncAdj (ValueFuncCRRA) – Value function over normalized market resources when the agent is able to +adjust their portfolio shares: \(v_t=\text{vFuncAdj} (m_t)\).

  • +
  • vPfuncAdj (MargValueFuncCRRA) – Marginal value function over normalized market resources when the agent is able +to adjust their portfolio shares: \(v'_t=\text{vPFuncAdj} (m_t)\).

  • +
  • cFuncFxd (Interp2D) – Consumption function over normalized market resources and risky portfolio share +when the agent is NOT able to adjust their portfolio shares, so they are fixed: +\(c_t=\text{cFuncFxd} (m_t,S_t)\).

  • +
  • ShareFuncFxd (Interp2D) – Risky share function over normalized market resources and risky portfolio share +when the agent is NOT able to adjust their portfolio shares, so they are fixed. +This should always be an IdentityFunc, by definition.

  • +
  • vFuncFxd (ValueFuncCRRA) – Value function over normalized market resources and risky portfolio share when +the agent is NOT able to adjust their portfolio shares, so they are fixed: +\(v_t=\text{vFuncFxd}(m_t,S_t)\).

  • +
  • dvdmFuncFxd (MargValueFuncCRRA) – The derivative of the value function with respect to normalized market +resources when the agent is Not able to adjust their portfolio shares, +so they are fixed: \(\frac{dv_t}{dm_t}=\text{vFuncFxd}(m_t,S_t)\).

  • +
  • dvdsFuncFxd (MargValueFuncCRRA) – The derivative of the value function with respect to risky asset share +when the agent is Not able to adjust their portfolio shares,so they are +fixed: \(\frac{dv_t}{dS_t}=\text{vFuncFxd}(m_t,S_t)\).

  • +
  • aGrid (np.array) – End-of-period-assets grid used to find the solution.

  • +
  • Share_adj (np.array) – Optimal portfolio share associated with each aGrid point: \(S^{*}_t=\text{vFuncFxd}(m_t)\).

  • +
  • EndOfPrddvda_adj (np.array) – Marginal value of end-of-period resources associated with each aGrid +point.

  • +
  • ShareGrid (np.array) – Grid for the portfolio share that is used to solve the model.

  • +
  • EndOfPrddvda_fxd (np.array) – Marginal value of end-of-period resources associated with each +(aGrid x sharegrid) combination, for the agent who can not adjust his +portfolio.

  • +
  • AdjustPrb (float) – Probability that the agent will be able to adjust his portfolio +next period.

  • +
+
+
+
+
+distance_criteria = ['vPfuncAdj']#
+
+ +
+ +
+
+class HARK.ConsumptionSaving.ConsPortfolioModel.PortfolioConsumerType(verbose=False, quiet=False, **kwds)#
+

Bases: IndShockRiskyAssetConsumerType

+

A consumer type based on IndShockRiskyAssetConsumerType, with portfolio optimization. +The agent is only able to change their risky asset share with a certain probability.

+
+\[\begin{split}\newcommand{\CRRA}{\rho} +\newcommand{\DiePrb}{\mathsf{D}} +\newcommand{\PermGroFac}{\Gamma} +\newcommand{\Rfree}{\mathsf{R}} +\newcommand{\DiscFac}{\beta} +\begin{align*} +v_t(m_t,S_t) &= \max_{c_t,S^{*}_t} u(c_t) + \DiscFac (1-\DiePrb_{t+1}) \mathbb{E}_{t} \left[(\PermGroFac_{t+1}\psi_{t+1})^{1-\CRRA} v_{t+1}(m_{t+1},S_{t+1}) \right], \\ +& \text{s.t.} \\ +a_t &= m_t - c_t, \\ +a_t &\geq \underline{a}, \\ +m_{t+1} &= \mathsf{R}_{t+1}/(\PermGroFac_{t+1} \psi_{t+1}) a_t + \theta_{t+1}, \\ +\mathsf{R}_{t+1} &=S_t\phi_{t+1}\mathbf{R}_{t+1}+ (1-S_t)\mathsf{R}_{t+1}, \\ +S_{t+1} &= \begin{cases} +S^{*}_t & \text{if } p_t < \wp\\ +S_t & \text{if } p_t \geq \wp, +\end{cases}\\ +(\psi_{t+1},\theta_{t+1},\phi_{t+1},p_t) &\sim F_{t+1}, \\ +\mathbb{E}[\psi]=\mathbb{E}[\theta] &= 1.\\ +u(c) &= \frac{c^{1-\CRRA}}{1-\CRRA} \\ +\end{align*}\end{split}\]
+
+
Constructors:
+
+
+
Solving Parameters:
+
    +
  • cycles (int) – 0 specifies an infinite horizon model, 1 specifies a finite model.

  • +
  • T_cycle (int) – Number of periods in the cycle for this agent type.

  • +
  • CRRA (float, \(\rho\)) – Coefficient of Relative Risk Aversion.

  • +
  • Rfree (float or list[float], time varying, \(\mathsf{R}\)) – Risk Free interest rate. Pass a list of floats to make Rfree time varying.

  • +
  • DiscFac (float, \(\beta\)) – Intertemporal discount factor.

  • +
  • LivPrb (list[float], time varying, \(1-\mathsf{D}\)) – Survival probability after each period.

  • +
  • PermGroFac (list[float], time varying, \(\Gamma\)) – Permanent income growth factor.

  • +
  • BoroCnstArt (float, default=0.0, \(\underline{a}\)) – The minimum Asset/Perminant Income ratio. for this agent, BoroCnstArt must be 0.

  • +
  • vFuncBool (bool) – Whether to calculate the value function during solution.

  • +
  • CubicBool (bool) – Whether to use cubic spline interpoliation.

  • +
  • AdjustPrb (float or list[float], time varying) – Must be between 0 and 1. Probability that the agent can update their risky portfolio share each period. Pass a list of floats to make AdjustPrb time varying.

  • +
+
+
Simulation Parameters:
+
    +
  • sim_common_Rrisky (Boolean) – Whether risky returns have a shared/common value across agents. If True, Risky return’s can’t be time varying.

  • +
  • AgentCount (int) – Number of agents of this kind that are created during simulations.

  • +
  • T_age (int) – Age after which to automatically kill agents, None to ignore.

  • +
  • T_sim (int, required for simulation) – Number of periods to simulate.

  • +
  • track_vars (list[strings]) – List of variables that should be tracked when running the simulation. +For this agent, the options are ‘Adjust’, ‘PermShk’, ‘Risky’, ‘TranShk’, ‘aLvl’, ‘aNrm’, ‘bNrm’, ‘cNrm’, ‘mNrm’, ‘pLvl’, and ‘who_dies’.

    +

    Adjust is the array of which agents can adjust

    +

    PermShk is the agent’s permanent income shock

    +

    Risky is the agent’s risky asset shock

    +

    TranShk is the agent’s transitory income shock

    +

    aLvl is the nominal asset level

    +

    aNrm is the normalized assets

    +

    bNrm is the normalized resources without this period’s labor income

    +

    cNrm is the normalized consumption

    +

    mNrm is the normalized market resources

    +

    pLvl is the permanent income level

    +

    who_dies is the array of which agents died

    +
  • +
  • aNrmInitMean (float) – Mean of Log initial Normalized Assets.

  • +
  • aNrmInitStd (float) – Std of Log initial Normalized Assets.

  • +
  • pLvlInitMean (float) – Mean of Log initial permanent income.

  • +
  • pLvlInitStd (float) – Std of Log initial permanent income.

  • +
  • PermGroFacAgg (float) – Aggregate permanent income growth factor (The portion of PermGroFac attributable to aggregate productivity growth).

  • +
  • PerfMITShk (boolean) – Do Perfect Foresight MIT Shock (Forces Newborns to follow solution path of the agent they replaced if True).

  • +
  • NewbornTransShk (boolean) – Whether Newborns have transitory shock.

  • +
+
+
Attributes:
+
    +
  • solution (list[Consumer solution object]) – Created by the solve() method. Finite horizon models create a list with T_cycle+1 elements, for each period in the solution. +Infinite horizon solutions return a list with T_cycle elements for each period in the cycle.

    +

    Visit HARK.ConsumptionSaving.ConsPortfolioModel.PortfolioSolution for more information about the solution.

    +
  • +
  • history (Dict[Array]) – Created by running the simulate() method. +Contains the variables in track_vars. Each item in the dictionary is an array with the shape (T_sim,AgentCount). +Visit HARK.core.AgentType.simulate for more information.

  • +
+
+
+
+
+IncShkDstn_default = {'IncUnemp': 0.3, 'IncUnempRet': 0.0, 'PermShkCount': 7, 'PermShkStd': [0.1], 'T_retire': 0, 'TranShkCount': 7, 'TranShkStd': [0.1], 'UnempPrb': 0.05, 'UnempPrbRet': 0.005}#
+
+ +
+
+aXtraGrid_default = {'aXtraCount': 200, 'aXtraExtra': None, 'aXtraMax': 100, 'aXtraMin': 0.001, 'aXtraNestFac': 1}#
+
+ +
+
+ShareGrid_default = {'ShareCount': 25}#
+
+ +
+
+RiskyDstn_default = {'RiskyAvg': 1.08, 'RiskyCount': 5, 'RiskyStd': 0.18362634887}#
+
+ +
+
+solving_default = {'AdjustPrb': 1.0, 'BoroCnstArt': 0.0, 'CRRA': 5.0, 'CubicBool': False, 'DiscFac': 0.9, 'DiscreteShareBool': False, 'LivPrb': [0.98], 'PermGroFac': [1.01], 'Rfree': 1.03, 'T_cycle': 1, 'constructors': {'IncShkDstn': <function construct_lognormal_income_process_unemployment>, 'PermShkDstn': <function get_PermShkDstn_from_IncShkDstn>, 'RiskyDstn': <function make_lognormal_RiskyDstn>, 'ShareGrid': <function make_simple_ShareGrid>, 'ShareLimit': <function calc_ShareLimit_for_CRRA>, 'ShockDstn': <function combine_IncShkDstn_and_RiskyDstn>, 'TranShkDstn': <function get_TranShkDstn_from_IncShkDstn>, 'aXtraGrid': <function make_assets_grid>, 'solution_terminal': <function make_portfolio_solution_terminal>}, 'cycles': 1, 'sim_common_Rrisky': True, 'vFuncBool': False}#
+
+ +
+
+simulation_default = {'AgentCount': 10000, 'NewbornTransShk': False, 'PerfMITShk': False, 'PermGroFacAgg': 1.0, 'T_age': None, 'aNrmInitMean': 0.0, 'aNrmInitStd': 1.0, 'neutral_measure': False, 'pLvlInitMean': 0.0, 'pLvlInitStd': 0.0}#
+
+ +
+
+time_inv_ = ['CRRA', 'DiscFac', 'BoroCnstArt', 'BoroCnstArt', 'vFuncBool', 'CubicBool', 'PortfolioBisect', 'AdjustPrb', 'DiscreteShareBool']#
+
+ +
+
+initialize_sim()#
+

Initialize the state of simulation attributes. Simply calls the same method +for IndShockConsumerType, then sets the type of AdjustNow to bool.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+sim_birth(which_agents)#
+

Create new agents to replace ones who have recently died; takes draws of +initial aNrm and pLvl, as in ConsIndShockModel, then sets Share and Adjust +to zero as initial values. +:param which_agents: Boolean array of size AgentCount indicating which agents should be “born”. +:type which_agents: np.array

+
+
Return type:
+

None

+
+
+
+ +
+
+get_controls()#
+

Calculates consumption cNrmNow and risky portfolio share ShareNow using +the policy functions in the attribute solution. These are stored as attributes.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+ +
+ + +
+ + + + + + + +
+ + + + + + + +
+ + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/Documentation/reference/ConsumptionSaving/ConsPrefShochModel.html b/Documentation/reference/ConsumptionSaving/ConsPrefShochModel.html new file mode 100644 index 000000000..05e5017ee --- /dev/null +++ b/Documentation/reference/ConsumptionSaving/ConsPrefShochModel.html @@ -0,0 +1,1059 @@ + + + + + + + + + + + ConsPrefShockModel — HARK latest documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+
+ + + + +
+ + + + + + + + + + + + + +
+ +
+ + +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ +
+

ConsPrefShockModel#

+

Extensions to ConsIndShockModel concerning models with preference shocks. +It currently only two models:

+
    +
  1. An extension of ConsIndShock, but with an iid lognormal multiplicative shock each period.

  2. +
  3. A combination of (1) and ConsKinkedR, demonstrating how to construct a new model +by inheriting from multiple classes.

  4. +
+
+
+class HARK.ConsumptionSaving.ConsPrefShockModel.PrefShockConsumerType(**kwds)#
+

Bases: IndShockConsumerType

+

A consumer type based on IndShockConsumerType, with multiplicative shocks to utility each period.

+
+\[\begin{split}\newcommand{\CRRA}{\rho} +\newcommand{\DiePrb}{\mathsf{D}} +\newcommand{\PermGroFac}{\Gamma} +\newcommand{\Rfree}{\mathsf{R}} +\newcommand{\DiscFac}{\beta} +\begin{align*} +v_t(m_t,\eta_t) &=\max_{c_t} \eta_{t} u(c_t) + \DiscFac (1 - \DiePrb_{t+1}) \mathbb{E}_{t} \left[ (\PermGroFac_{t+1} \psi_{t+1})^{1-\CRRA} v_{t+1}(m_{t+1},\eta_{t+1}) \right], \\ +& \text{s.t.} \\ +a_t &= m_t - c_t, \\ +a_t &\geq \underline{a}, \\ +m_{t+1} &= a_t \Rfree_{t+1}/(\PermGroFac_{t+1} \psi_{t+1}) + \theta_{t+1}, \\ +(\psi_{t+1},\theta_{t+1},\eta_{t+1}) &\sim F_{t+1}, \\ +\mathbb{E}[\psi]=\mathbb{E}[\theta] &= 1, \\ +u(c) &= \frac{c^{1-\CRRA}}{1-\CRRA} \\ +\end{align*}\end{split}\]
+
+
Constructors:
+
+
+
Solving Parameters:
+
    +
  • cycles (int) – 0 specifies an infinite horizon model, 1 specifies a finite model.

  • +
  • T_cycle (int) – Number of periods in the cycle for this agent type.

  • +
  • CRRA (float, \(\rho\)) – Coefficient of Relative Risk Aversion.

  • +
  • Rfree (float or list[float], time varying, \(\mathsf{R}\)) – Risk Free interest rate. Pass a list of floats to make Rfree time varying.

  • +
  • DiscFac (float, \(\beta\)) – Intertemporal discount factor.

  • +
  • LivPrb (list[float], time varying, \(1-\mathsf{D}\)) – Survival probability after each period.

  • +
  • PermGroFac (list[float], time varying, \(\Gamma\)) – Permanent income growth factor.

  • +
  • BoroCnstArt (float, \(\underline{a}\)) – The minimum Asset/Perminant Income ratio, None to ignore.

  • +
  • vFuncBool (bool) – Whether to calculate the value function during solution.

  • +
  • CubicBool (bool) – Whether to use cubic spline interpoliation.

  • +
+
+
Simulation Parameters:
+
    +
  • AgentCount (int) – Number of agents of this kind that are created during simulations.

  • +
  • T_age (int) – Age after which to automatically kill agents, None to ignore.

  • +
  • T_sim (int, required for simulation) – Number of periods to simulate.

  • +
  • track_vars (list[strings]) – List of variables that should be tracked when running the simulation. +For this agent, the options are ‘PermShk’, ‘PrefShk’, ‘TranShk’, ‘aLvl’, ‘aNrm’, ‘bNrm’, ‘cNrm’, ‘mNrm’, ‘pLvl’, and ‘who_dies’.

    +

    PermShk is the agent’s permanent income shock

    +

    PrefShk is the agent’s preference shock

    +

    TranShk is the agent’s transitory income shock

    +

    aLvl is the nominal asset level

    +

    aNrm is the normalized assets

    +

    bNrm is the normalized resources without this period’s labor income

    +

    cNrm is the normalized consumption

    +

    mNrm is the normalized market resources

    +

    pLvl is the permanent income level

    +

    who_dies is the array of which agents died

    +
  • +
  • aNrmInitMean (float) – Mean of Log initial Normalized Assets.

  • +
  • aNrmInitStd (float) – Std of Log initial Normalized Assets.

  • +
  • pLvlInitMean (float) – Mean of Log initial permanent income.

  • +
  • pLvlInitStd (float) – Std of Log initial permanent income.

  • +
  • PermGroFacAgg (float) – Aggregate permanent income growth factor (The portion of PermGroFac attributable to aggregate productivity growth).

  • +
  • PerfMITShk (boolean) – Do Perfect Foresight MIT Shock (Forces Newborns to follow solution path of the agent they replaced if True).

  • +
  • NewbornTransShk (boolean) – Whether Newborns have transitory shock.

  • +
+
+
Attributes:
+
    +
  • solution (list[Consumer solution object]) – Created by the solve() method. Finite horizon models create a list with T_cycle+1 elements, for each period in the solution. +Infinite horizon solutions return a list with T_cycle elements for each period in the cycle.

    +

    For this model, cFunc is defined over normalized market resources and \(\eta\), cNrm = cFunc(mNrm, \(\eta\)).

    +

    Visit HARK.ConsumptionSaving.ConsIndShockModel.ConsumerSolution for more information about the solution.

    +
  • +
  • history (Dict[Array]) – Created by running the simulate() method. +Contains the variables in track_vars. Each item in the dictionary is an array with the shape (T_sim,AgentCount). +Visit HARK.core.AgentType.simulate for more information.

  • +
+
+
+
+
+IncShkDstn_defaults = {'IncUnemp': 0.3, 'IncUnempRet': 0.0, 'PermShkCount': 7, 'PermShkStd': [0.1], 'T_retire': 0, 'TranShkCount': 7, 'TranShkStd': [0.1], 'UnempPrb': 0.05, 'UnempPrbRet': 0.005}#
+
+ +
+
+aXtraGrid_defaults = {'aXtraCount': 48, 'aXtraExtra': None, 'aXtraMax': 20, 'aXtraMin': 0.001, 'aXtraNestFac': 3}#
+
+ +
+
+PrefShkDstn_defaults = {'PrefShkCount': 12, 'PrefShkStd': [0.3], 'PrefShk_tail_N': 4}#
+
+ +
+
+solving_defaults = {'BoroCnstArt': 0.0, 'CRRA': 2.0, 'CubicBool': False, 'DiscFac': 0.96, 'LivPrb': [0.98], 'PermGroFac': [1.01], 'Rfree': 1.03, 'T_cycle': 1, 'constructors': {'IncShkDstn': <function construct_lognormal_income_process_unemployment>, 'PermShkDstn': <function get_PermShkDstn_from_IncShkDstn>, 'PrefShkDstn': <function make_lognormal_PrefShkDstn>, 'TranShkDstn': <function get_TranShkDstn_from_IncShkDstn>, 'aXtraGrid': <function make_assets_grid>, 'solution_terminal': <function make_basic_CRRA_solution_terminal>}, 'cycles': 1, 'vFuncBool': False}#
+
+ +
+
+simulation_defaults = {'AgentCount': 10000, 'NewbornTransShk': False, 'PerfMITShk': False, 'PermGroFacAgg': 1.0, 'T_age': None, 'aNrmInitMean': 0.0, 'aNrmInitStd': 1.0, 'neutral_measure': False, 'pLvlInitMean': 0.0, 'pLvlInitStd': 0.0}#
+
+ +
+
+shock_vars_ = ['PermShk', 'TranShk', 'PrefShk']#
+
+ +
+
+pre_solve()#
+

Method that is run automatically just before solution by backward iteration. +Solves the (trivial) terminal period and does a quick check on the borrowing +constraint and MaxKinks attribute (only relevant in constrained, infinite +horizon problems).

+
+ +
+
+update()#
+

Updates the assets grid, income process, terminal period solution, and +preference shock process. A very slight extension of IndShockConsumerType.update() +for the preference shock model.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+update_pref_shock_process()#
+

Make a discrete preference shock structure for each period in the cycle +for this agent type, storing them as attributes of self for use in the +solution (and other methods).

+
+
Parameters:
+

none

+
+
Return type:
+

none

+
+
+
+ +
+
+reset_rng()#
+

Reset the RNG behavior of this type. This method is called automatically +by initialize_sim(), ensuring that each simulation run uses the same sequence +of random shocks; this is necessary for structural estimation to work. +This method extends IndShockConsumerType.reset_rng() to also reset elements +of PrefShkDstn.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+get_shocks()#
+

Gets permanent and transitory income shocks for this period as well as preference shocks.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+get_controls()#
+

Calculates consumption for each consumer of this type using the consumption functions.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+calc_bounding_values()#
+

Calculate human wealth plus minimum and maximum MPC in an infinite +horizon model with only one period repeated indefinitely. Store results +as attributes of self. Human wealth is the present discounted value of +expected future income after receiving income this period, ignoring mort- +ality. The maximum MPC is the limit of the MPC as m –> mNrmMin. The +minimum MPC is the limit of the MPC as m –> infty.

+

NOT YET IMPLEMENTED FOR THIS CLASS

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+make_euler_error_func(mMax=100, approx_inc_dstn=True)#
+

Creates a “normalized Euler error” function for this instance, mapping +from market resources to “consumption error per dollar of consumption.” +Stores result in attribute eulerErrorFunc as an interpolated function. +Has option to use approximate income distribution stored in self.IncShkDstn +or to use a (temporary) very dense approximation.

+

NOT YET IMPLEMENTED FOR THIS CLASS

+
+
Parameters:
+
    +
  • mMax (float) – Maximum normalized market resources for the Euler error function.

  • +
  • approx_inc_dstn (Boolean) – Indicator for whether to use the approximate discrete income distri- +bution stored in self.IncShkDstn[0], or to use a very accurate +discrete approximation instead. When True, uses approximation in +IncShkDstn; when False, makes and uses a very dense approximation.

  • +
+
+
Return type:
+

None

+
+
+

Notes

+

This method is not used by any other code in the library. Rather, it is here +for expository and benchmarking purposes.

+
+ +
+ +
+
+class HARK.ConsumptionSaving.ConsPrefShockModel.KinkyPrefConsumerType(**kwds)#
+

Bases: PrefShockConsumerType, KinkedRconsumerType

+

A consumer type based on PrefShockConsumerType, with different +interest rates for saving (\(\mathsf{R}_{save}\)) and borrowing +(\(\mathsf{R}_{boro}\)).

+

Solver for this class is currently only compatible with linear spline interpolation.

+
+\[\begin{split}\newcommand{\CRRA}{\rho} +\newcommand{\DiePrb}{\mathsf{D}} +\newcommand{\PermGroFac}{\Gamma} +\newcommand{\Rfree}{\mathsf{R}} +\newcommand{\DiscFac}{\beta} +\begin{align*} +v_t(m_t,\eta_t) &= \max_{c_t} \eta_{t} u(c_t) + \DiscFac (1-\DiePrb_{t+1}) \mathbb{E}_{t} \left[(\PermGroFac_{t+1}\psi_{t+1})^{1-\CRRA} v_{t+1}(m_{t+1},\eta_{t+1}) \right], \\ +a_t &= m_t - c_t, \\ +a_t &\geq \underline{a}, \\ +m_{t+1} &= \Rfree_t/(\PermGroFac_{t+1} \psi_{t+1}) a_t + \theta_{t+1}, \\ +\Rfree_t &= \begin{cases} +\Rfree_{boro} & \text{if } a_t < 0\\ +\Rfree_{save} & \text{if } a_t \geq 0, +\end{cases}\\ +\Rfree_{boro} &> \Rfree_{save}, \\ +(\psi_{t+1},\theta_{t+1},\eta_{t+1}) &\sim F_{t+1}, \\ +\mathbb{E}[\psi]=\mathbb{E}[\theta] &= 1. \\ +u(c) &= \frac{c^{1-\CRRA}}{1-\CRRA} \\ +\end{align*}\end{split}\]
+
+
Constructors:
+
+
+
Solving Parameters:
+
    +
  • cycles (int) – 0 specifies an infinite horizon model, 1 specifies a finite model.

  • +
  • T_cycle (int) – Number of periods in the cycle for this agent type.

  • +
  • CRRA (float, \(\rho\)) – Coefficient of Relative Risk Aversion.

  • +
  • Rfree (float or list[float], time varying, \(\mathsf{R}\)) – Risk Free interest rate. Pass a list of floats to make Rfree time varying.

  • +
  • Rboro (float, \(\mathsf{R}_{boro}\)) – Risk Free interest rate when assets are negative.

  • +
  • Rsave (float, \(\mathsf{R}_{save}\)) – Risk Free interest rate when assets are positive.

  • +
  • DiscFac (float, \(\beta\)) – Intertemporal discount factor.

  • +
  • LivPrb (list[float], time varying, \(1-\mathsf{D}\)) – Survival probability after each period.

  • +
  • PermGroFac (list[float], time varying, \(\Gamma\)) – Permanent income growth factor.

  • +
  • BoroCnstArt (float, \(\underline{a}\)) – The minimum Asset/Perminant Income ratio, None to ignore.

  • +
  • vFuncBool (bool) – Whether to calculate the value function during solution.

  • +
  • CubicBool (bool) – Whether to use cubic spline interpoliation.

  • +
+
+
Simulation Parameters:
+
    +
  • AgentCount (int) – Number of agents of this kind that are created during simulations.

  • +
  • T_age (int) – Age after which to automatically kill agents, None to ignore.

  • +
  • T_sim (int, required for simulation) – Number of periods to simulate.

  • +
  • track_vars (list[strings]) – List of variables that should be tracked when running the simulation. +For this agent, the options are ‘PermShk’, ‘PrefShk’, ‘TranShk’, ‘aLvl’, ‘aNrm’, ‘bNrm’, ‘cNrm’, ‘mNrm’, ‘pLvl’, and ‘who_dies’.

    +

    PermShk is the agent’s permanent income shock

    +

    PrefShk is the agent’s preference shock

    +

    TranShk is the agent’s transitory income shock

    +

    aLvl is the nominal asset level

    +

    aNrm is the normalized assets

    +

    bNrm is the normalized resources without this period’s labor income

    +

    cNrm is the normalized consumption

    +

    mNrm is the normalized market resources

    +

    pLvl is the permanent income level

    +

    who_dies is the array of which agents died

    +
  • +
  • aNrmInitMean (float) – Mean of Log initial Normalized Assets.

  • +
  • aNrmInitStd (float) – Std of Log initial Normalized Assets.

  • +
  • pLvlInitMean (float) – Mean of Log initial permanent income.

  • +
  • pLvlInitStd (float) – Std of Log initial permanent income.

  • +
  • PermGroFacAgg (float) – Aggregate permanent income growth factor (The portion of PermGroFac attributable to aggregate productivity growth).

  • +
  • PerfMITShk (boolean) – Do Perfect Foresight MIT Shock (Forces Newborns to follow solution path of the agent they replaced if True).

  • +
  • NewbornTransShk (boolean) – Whether Newborns have transitory shock.

  • +
+
+
Attributes:
+
    +
  • solution (list[Consumer solution object]) – Created by the solve() method. Finite horizon models create a list with T_cycle+1 elements, for each period in the solution. +Infinite horizon solutions return a list with T_cycle elements for each period in the cycle.

    +

    For this model, cFunc is defined over normalized market resources and \(\eta\), cNrm = cFunc(mNrm, \(\eta\)).

    +

    Visit HARK.ConsumptionSaving.ConsIndShockModel.ConsumerSolution for more information about the solution.

    +
  • +
  • history (Dict[Array]) – Created by running the simulate() method. +Contains the variables in track_vars. Each item in the dictionary is an array with the shape (T_sim,AgentCount). +Visit HARK.core.AgentType.simulate for more information.

  • +
+
+
+
+
+IncShkDstn_defaults = {'IncUnemp': 0.3, 'IncUnempRet': 0.0, 'PermShkCount': 7, 'PermShkStd': [0.1], 'T_retire': 0, 'TranShkCount': 7, 'TranShkStd': [0.1], 'UnempPrb': 0.05, 'UnempPrbRet': 0.005}#
+
+ +
+
+aXtraGrid_defaults = {'aXtraCount': 48, 'aXtraExtra': None, 'aXtraMax': 20, 'aXtraMin': 0.001, 'aXtraNestFac': 3}#
+
+ +
+
+PrefShkDstn_defaults = {'PrefShkCount': 12, 'PrefShkStd': [0.3], 'PrefShk_tail_N': 4}#
+
+ +
+
+solving_defaults = {'BoroCnstArt': None, 'CRRA': 2.0, 'CubicBool': False, 'DiscFac': 0.96, 'LivPrb': [0.98], 'PermGroFac': [1.01], 'Rboro': 1.2, 'Rfree': 1.03, 'Rsave': 1.02, 'T_cycle': 1, 'constructors': {'IncShkDstn': <function construct_lognormal_income_process_unemployment>, 'PermShkDstn': <function get_PermShkDstn_from_IncShkDstn>, 'PrefShkDstn': <function make_lognormal_PrefShkDstn>, 'TranShkDstn': <function get_TranShkDstn_from_IncShkDstn>, 'aXtraGrid': <function make_assets_grid>, 'solution_terminal': <function make_basic_CRRA_solution_terminal>}, 'cycles': 1, 'vFuncBool': False}#
+
+ +
+
+simulation_defaults = {'AgentCount': 10000, 'NewbornTransShk': False, 'PerfMITShk': False, 'PermGroFacAgg': 1.0, 'T_age': None, 'aNrmInitMean': 0.0, 'aNrmInitStd': 1.0, 'neutral_measure': False, 'pLvlInitMean': 0.0, 'pLvlInitStd': 0.0}#
+
+ +
+
+pre_solve()#
+

Method that is run automatically just before solution by backward iteration. +Solves the (trivial) terminal period and does a quick check on the borrowing +constraint and MaxKinks attribute (only relevant in constrained, infinite +horizon problems).

+
+ +
+
+get_Rfree()#
+

Returns an array of size self.AgentCount with self.Rfree in every entry.

+
+
Parameters:
+

None

+
+
Returns:
+

RfreeNow – Array of size self.AgentCount with risk free interest rate for each agent.

+
+
Return type:
+

np.array

+
+
+
+ +
+ +
+
+HARK.ConsumptionSaving.ConsPrefShockModel.make_lognormal_PrefShkDstn(T_cycle, PrefShkStd, PrefShkCount, RNG, PrefShk_tail_N=0, PrefShk_tail_order=2.718281828459045, PrefShk_tail_bound=[0.02, 0.98])#
+

Make a discretized mean one lognormal preference shock distribution for each +period of the agent’s problem.

+
+\[\eta_t \sim \mathcal{N}(-\textbf{PrefShkStd}_{t}^{2}/2,\textbf{PrefShkStd}_{t}^2)\]
+
+
Parameters:
+
    +
  • T_cycle (int) – Number of non-terminal periods in the agent’s cycle.

  • +
  • PrefShkStd ([float]) – Standard deviation of log preference shocks in each period.

  • +
  • PrefShkCount (int) – Number of equiprobable preference shock nodes in the “body” of the distribution.

  • +
  • RNG (RandomState) – The AgentType’s internal random number generator.

  • +
  • PrefShk_tail_N (int) – Number of shock nodes in each “tail” of the distribution (optional).

  • +
  • PrefShk_tail_order (float) – Scaling factor for tail nodes (optional).

  • +
  • PrefShk_tail_bound ([float,float]) – CDF bounds for tail nodes (optional).

  • +
+
+
Returns:
+

PrefShkDstn – List of discretized lognormal distributions for shocks.

+
+
Return type:
+

[DiscreteDistribution]

+
+
+
+ +
+ + +
+ + + + + + + +
+ + + + + + + +
+ + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/Documentation/reference/ConsumptionSaving/ConsRepAgentModel.html b/Documentation/reference/ConsumptionSaving/ConsRepAgentModel.html new file mode 100644 index 000000000..bf538e3fc --- /dev/null +++ b/Documentation/reference/ConsumptionSaving/ConsRepAgentModel.html @@ -0,0 +1,741 @@ + + + + + + + + + + + ConsRepAgentModel — HARK latest documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+
+ + + + +
+ + + + + + + + + + + + + +
+ +
+ + +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ +
+

ConsRepAgentModel#

+

This module contains models for solving representative agent macroeconomic models. +This stands in contrast to all other model modules in HARK, which (unsurprisingly) +take a heterogeneous agents approach. In RA models, all attributes are either +time invariant or exist on a short cycle; models must be infinite horizon.

+
+
+class HARK.ConsumptionSaving.ConsRepAgentModel.RepAgentConsumerType(**kwds)#
+

Bases: IndShockConsumerType

+

A class for representing representative agents with inelastic labor supply.

+
+
+time_inv_ = ['CRRA', 'DiscFac', 'BoroCnstArt', 'BoroCnstArt', 'vFuncBool', 'CubicBool', 'CapShare', 'DeprFac']#
+
+ +
+
+pre_solve()#
+

Method that is run automatically just before solution by backward iteration. +Solves the (trivial) terminal period and does a quick check on the borrowing +constraint and MaxKinks attribute (only relevant in constrained, infinite +horizon problems).

+
+ +
+
+get_states()#
+

TODO: replace with call to transition

+

Calculates updated values of normalized market resources and permanent income level. +Uses pLvlNow, aNrmNow, PermShkNow, TranShkNow.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+ +
+
+class HARK.ConsumptionSaving.ConsRepAgentModel.RepAgentMarkovConsumerType(**kwds)#
+

Bases: RepAgentConsumerType

+

A class for representing representative agents with inelastic labor supply +and a discrete MarkovState

+
+
+time_inv_ = ['CRRA', 'DiscFac', 'BoroCnstArt', 'BoroCnstArt', 'vFuncBool', 'CubicBool', 'CapShare', 'DeprFac', 'MrkvArray']#
+
+ +
+
+pre_solve()#
+

Method that is run automatically just before solution by backward iteration. +Solves the (trivial) terminal period and does a quick check on the borrowing +constraint and MaxKinks attribute (only relevant in constrained, infinite +horizon problems).

+
+ +
+
+initialize_sim()#
+

Prepares this AgentType for a new simulation. Resets the internal random number generator, +makes initial states for all agents (using sim_birth), clears histories of tracked variables.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+update_solution_terminal()#
+

Update the terminal period solution. This method should be run when a +new AgentType is created or when CRRA changes.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+reset_rng()#
+

Reset the RNG behavior of this type. This method is called automatically +by initialize_sim(), ensuring that each simulation run uses the same sequence +of random shocks; this is necessary for structural estimation to work. +This method extends AgentType.reset_rng() to also reset elements of IncShkDstn.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+get_shocks()#
+

Draws a new Markov state and income shocks for the representative agent.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+get_controls()#
+

Calculates consumption for the representative agent using the consumption functions.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+ +
+ + +
+ + + + + + + +
+ + + + + + + +
+ + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/Documentation/reference/ConsumptionSaving/ConsRiskyAssetModel.html b/Documentation/reference/ConsumptionSaving/ConsRiskyAssetModel.html new file mode 100644 index 000000000..7c5b8061d --- /dev/null +++ b/Documentation/reference/ConsumptionSaving/ConsRiskyAssetModel.html @@ -0,0 +1,1109 @@ + + + + + + + + + + + ConsRiskyAssetModel — HARK latest documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+
+ + + + +
+ + + + + + + + + + + + + +
+ +
+ + +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ +
+

ConsRiskyAssetModel#

+

This file contains a class that adds a risky asset with a log-normal return +factor to IndShockConsumerType. It is meant as a container of methods for dealing +with risky assets that will be useful to models what will inherit from it.

+
+
+HARK.ConsumptionSaving.ConsRiskyAssetModel.make_simple_ShareGrid(ShareCount)#
+

Make a uniformly spaced grid on the unit interval, representing risky asset shares.

+
+
Parameters:
+

ShareCount (int) – Number of points in the grid.

+
+
Returns:
+

ShareGrid

+
+
Return type:
+

np.array

+
+
+
+ +
+
+class HARK.ConsumptionSaving.ConsRiskyAssetModel.IndShockRiskyAssetConsumerType(verbose=False, quiet=False, **kwds)#
+

Bases: IndShockConsumerType

+

A consumer type based on IndShockConsumerType, that has access to a risky asset for their savings. The +risky asset has lognormal returns that are possibly correlated with his +income shocks.

+

If PortfolioBool is False, then the risky asset share is always one. +Otherwise the agent can optimize their risky asset share.

+
+\[\begin{split}\newcommand{\CRRA}{\rho} +\newcommand{\DiePrb}{\mathsf{D}} +\newcommand{\PermGroFac}{\Gamma} +\newcommand{\Rfree}{\mathsf{R}} +\newcommand{\DiscFac}{\beta} +\begin{align*} +v_t(m_t) &= \max_{c_t,S_t} u(c_t) + \DiscFac (1-\DiePrb_{t+1}) \mathbb{E}_{t} \left[(\PermGroFac_{t+1}\psi_{t+1})^{1-\CRRA} v_{t+1}(m_{t+1}) \right], \\ +& \text{s.t.} \\ +a_t &= m_t - c_t, \\ +a_t &\geq \underline{a}, \\ +m_{t+1} &= \mathsf{R}_{t+1}/(\PermGroFac_{t+1} \psi_{t+1}) a_t + \theta_{t+1}, \\ +\mathsf{R}_{t+1} &=S_t\phi_{t+1}\mathbf{R}_{t+1}+ (1-S_t)\mathsf{R}_{t+1}, \\ +(\psi_{t+1},\theta_{t+1},\phi_{t+1}) &\sim F_{t+1}, \\ +\mathbb{E}[\psi]=\mathbb{E}[\theta] &= 1. \\ +u(c) &= \frac{c^{1-\CRRA}}{1-\CRRA} \\ +\end{align*}\end{split}\]
+
+
Constructors:
+
+
+
Solving Parameters:
+
    +
  • cycles (int) – 0 specifies an infinite horizon model, 1 specifies a finite model.

  • +
  • T_cycle (int) – Number of periods in the cycle for this agent type.

  • +
  • CRRA (float, \(\rho\)) – Coefficient of Relative Risk Aversion.

  • +
  • Rfree (float or list[float], time varying, \(\mathsf{R}\)) – Risk Free interest rate. Pass a list of floats to make Rfree time varying.

  • +
  • DiscFac (float, \(\beta\)) – Intertemporal discount factor.

  • +
  • LivPrb (list[float], time varying, \(1-\mathsf{D}\)) – Survival probability after each period.

  • +
  • PermGroFac (list[float], time varying, \(\Gamma\)) – Permanent income growth factor.

  • +
  • BoroCnstArt (float, default=0.0, \(\underline{a}\)) – The minimum Asset/Perminant Income ratio. for this agent, BoroCnstArt must be 0.

  • +
  • vFuncBool (bool) – Whether to calculate the value function during solution.

  • +
  • CubicBool (bool) – Whether to use cubic spline interpoliation.

  • +
  • PortfolioBool (Boolean) – Determines whether agent will use portfolio optimization or they only have access to risky assets. If false, the risky share is always one.

  • +
+
+
Simulation Parameters:
+
    +
  • sim_common_Rrisky (Boolean) – Whether risky returns have a shared/common value across agents. If True, Risky return’s can’t be time varying.

  • +
  • AgentCount (int) – Number of agents of this kind that are created during simulations.

  • +
  • T_age (int) – Age after which to automatically kill agents, None to ignore.

  • +
  • T_sim (int, required for simulation) – Number of periods to simulate.

  • +
  • track_vars (list[strings]) – List of variables that should be tracked when running the simulation. +For this agent, the options are ‘Adjust’, ‘PermShk’, ‘Risky’, ‘TranShk’, ‘aLvl’, ‘aNrm’, ‘bNrm’, ‘cNrm’, ‘mNrm’, ‘pLvl’, and ‘who_dies’.

    +

    Adjust is the array of which agents can adjust

    +

    PermShk is the agent’s permanent income shock

    +

    Risky is the agent’s risky asset shock

    +

    TranShk is the agent’s transitory income shock

    +

    aLvl is the nominal asset level

    +

    aNrm is the normalized assets

    +

    bNrm is the normalized resources without this period’s labor income

    +

    cNrm is the normalized consumption

    +

    mNrm is the normalized market resources

    +

    pLvl is the permanent income level

    +

    who_dies is the array of which agents died

    +
  • +
  • aNrmInitMean (float) – Mean of Log initial Normalized Assets.

  • +
  • aNrmInitStd (float) – Std of Log initial Normalized Assets.

  • +
  • pLvlInitMean (float) – Mean of Log initial permanent income.

  • +
  • pLvlInitStd (float) – Std of Log initial permanent income.

  • +
  • PermGroFacAgg (float) – Aggregate permanent income growth factor (The portion of PermGroFac attributable to aggregate productivity growth).

  • +
  • PerfMITShk (boolean) – Do Perfect Foresight MIT Shock (Forces Newborns to follow solution path of the agent they replaced if True).

  • +
  • NewbornTransShk (boolean) – Whether Newborns have transitory shock.

  • +
+
+
Attributes:
+
    +
  • solution (list[Consumer solution object]) – Created by the solve() method. Finite horizon models create a list with T_cycle+1 elements, for each period in the solution. +Infinite horizon solutions return a list with T_cycle elements for each period in the cycle. If PortfolioBool is True, the solution also contains ShareFunc.

    +

    If PortfolioBool is True, the solution also contains: +ShareFunc - The asset share function for this period, defined over normalized market resources \(S=ShareFunc(mNrm)\).

    +

    Visit HARK.ConsumptionSaving.ConsIndShockModel.ConsumerSolution for more information about the solution.

    +
  • +
  • history (Dict[Array]) – Created by running the simulate() method. +Contains the variables in track_vars. Each item in the dictionary is an array with the shape (T_sim,AgentCount). +Visit HARK.core.AgentType.simulate for more information.

  • +
+
+
+
+
+IncShkDstn_default = {'IncUnemp': 0.3, 'IncUnempRet': 0.0, 'PermShkCount': 7, 'PermShkStd': [0.1], 'T_retire': 0, 'TranShkCount': 7, 'TranShkStd': [0.1], 'UnempPrb': 0.05, 'UnempPrbRet': 0.005}#
+
+ +
+
+RiskyDstn_default = {'RiskyAvg': 1.0803701891, 'RiskyCount': 5, 'RiskyStd': 0.162927447983}#
+
+ +
+
+aXtraGrid_default = {'aXtraCount': 48, 'aXtraExtra': None, 'aXtraMax': 20, 'aXtraMin': 0.001, 'aXtraNestFac': 3}#
+
+ +
+
+ShareGrid_default = {'ShareCount': 25}#
+
+ +
+
+solving_default = {'AdjustPrb': 1.0, 'BoroCnstArt': 0.0, 'CRRA': 2.0, 'CubicBool': False, 'DiscFac': 0.96, 'LivPrb': [0.98], 'PermGroFac': [1.01], 'Rfree': 1.03, 'T_cycle': 1, 'constructors': {'IncShkDstn': <function construct_lognormal_income_process_unemployment>, 'PermShkDstn': <function get_PermShkDstn_from_IncShkDstn>, 'RiskyDstn': <function make_lognormal_RiskyDstn>, 'ShareGrid': <function make_simple_ShareGrid>, 'ShareLimit': <function calc_ShareLimit_for_CRRA>, 'ShockDstn': <function combine_IncShkDstn_and_RiskyDstn>, 'TranShkDstn': <function get_TranShkDstn_from_IncShkDstn>, 'aXtraGrid': <function make_assets_grid>, 'solution_terminal': <function make_basic_CRRA_solution_terminal>}, 'cycles': 1, 'sim_common_Rrisky': True, 'vFuncBool': False}#
+
+ +
+
+simulation_default = {'AgentCount': 10000, 'NewbornTransShk': False, 'PerfMITShk': False, 'PermGroFacAgg': 1.0, 'T_age': None, 'aNrmInitMean': 0.0, 'aNrmInitStd': 1.0, 'neutral_measure': False, 'pLvlInitMean': 0.0, 'pLvlInitStd': 0.0}#
+
+ +
+
+time_inv_ = ['CRRA', 'DiscFac', 'BoroCnstArt', 'BoroCnstArt', 'vFuncBool', 'CubicBool', 'PortfolioBisect']#
+
+ +
+
+shock_vars_ = ['PermShk', 'TranShk', 'Adjust', 'Risky']#
+
+ +
+
+pre_solve()#
+

Method that is run automatically just before solution by backward iteration. +Solves the (trivial) terminal period and does a quick check on the borrowing +constraint and MaxKinks attribute (only relevant in constrained, infinite +horizon problems).

+
+ +
+
+update()#
+

Update the income process, the assets grid, and the terminal solution.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+update_RiskyDstn()#
+

Updates the attribute RiskyDstn, approximating the (perceived) distribution of +returns in each period of the cycle.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+update_ShockDstn()#
+

Combine the income shock distribution (over PermShk and TranShk) with the +risky return distribution (RiskyDstn) to make a new attribute called ShockDstn.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+update_AdjustDstn()#
+

Checks and updates the exogenous probability of the agent being allowed +to rebalance his portfolio/contribution scheme. It can be time varying.

+
+
Parameters:
+

None.

+
+
Return type:
+

None.

+
+
+
+ +
+
+update_ShareLimit()#
+

Creates the attribute ShareLimit, representing the limiting lower bound of +risky portfolio share as mNrm goes to infinity, if it is allowed to adjust.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+update_ShareGrid()#
+

Creates the attribute ShareGrid.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+get_Rfree()#
+

Calculates realized return factor for each agent, using the attributes Rfree, +RiskyNow, and ShareNow. This method is a bit of a misnomer, as the return +factor is not riskless, but would more accurately be labeled as Rport. However, +this method makes the portfolio model compatible with its parent class.

+
+
Parameters:
+

None

+
+
Returns:
+

Rport – Array of size AgentCount with each simulated agent’s realized portfolio +return factor. Will be used by get_states() to calculate mNrmNow, where it +will be mislabeled as “Rfree”.

+
+
Return type:
+

np.array

+
+
+
+ +
+
+get_Risky()#
+

Draws a new risky return factor.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+get_Adjust()#
+

Sets the attribute Adjust as a boolean array of size AgentCount, indicating +whether each agent is able to adjust their risky portfolio share this period. +Uses the attribute AdjustPrb to draw from a Bernoulli distribution.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+initialize_sim()#
+

Initialize the state of simulation attributes. Simply calls the same +method for IndShockConsumerType, then initializes the new states/shocks +Adjust and Share.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+get_shocks()#
+

Draw idiosyncratic income shocks, just as for IndShockConsumerType, then draw +a single common value for the risky asset return. Also draws whether each +agent is able to adjust their portfolio this period.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+ +
+
+HARK.ConsumptionSaving.ConsRiskyAssetModel.RiskyAssetConsumerType#
+

alias of IndShockRiskyAssetConsumerType

+
+ +
+
+class HARK.ConsumptionSaving.ConsRiskyAssetModel.FixedPortfolioShareRiskyAssetConsumerType(verbose=False, quiet=False, **kwds)#
+

Bases: IndShockRiskyAssetConsumerType

+

A consumer type that has access to a risky asset for their savings. The +risky asset has lognormal returns that are possibly correlated with their +income shocks. A fixed portion of their savings are invested in those risky assets.

+
+\[\begin{split}\newcommand{\CRRA}{\rho} +\newcommand{\DiePrb}{\mathsf{D}} +\newcommand{\PermGroFac}{\Gamma} +\newcommand{\Rfree}{\mathsf{R}} +\newcommand{\DiscFac}{\beta} +\begin{align*} +v_t(m_t) &= \max_{c_t} u(c_t) + \DiscFac (1-\DiePrb_{t+1}) \mathbb{E}_{t} \left[(\PermGroFac_{t+1}\psi_{t+1})^{1-\CRRA} v_{t+1}(m_{t+1}) \right], \\ +& \text{s.t.} \\ +a_t &= m_t - c_t, \\ +a_t &\geq \underline{a}, \\ +m_{t+1} &= \mathsf{R}_{t+1}/(\PermGroFac_{t+1} \psi_{t+1}) a_t + \theta_{t+1}, \\ +\mathsf{R}_{t+1} &=S_t\phi_{t+1}\mathbf{R}_{t+1}+ (1-S_t)\mathsf{R}_{t+1}, \\ +(\psi_{t+1},\theta_{t+1},\phi_{t+1}) &\sim F_{t+1}, \\ +\mathbb{E}[\psi]=\mathbb{E}[\theta] &= 1. \\ +u(c) &= \frac{c^{1-\CRRA}}{1-\CRRA} \\ +\end{align*}\end{split}\]
+
+
Constructors:
+
+
+
Solving Parameters:
+
    +
  • cycles (int) – 0 specifies an infinite horizon model, 1 specifies a finite model.

  • +
  • T_cycle (int) – Number of periods in the cycle for this agent type.

  • +
  • CRRA (float, \(\rho\)) – Coefficient of Relative Risk Aversion.

  • +
  • Rfree (float or list[float], time varying, \(\mathsf{R}\)) – Risk Free interest rate. Pass a list of floats to make Rfree time varying.

  • +
  • RiskyShareFixed (list[float], \(S\)) – Fixed share of assets in the risky asset.

  • +
  • DiscFac (float, \(\beta\)) – Intertemporal discount factor.

  • +
  • LivPrb (list[float], time varying, \(1-\mathsf{D}\)) – Survival probability after each period.

  • +
  • PermGroFac (list[float], time varying, \(\Gamma\)) – Permanent income growth factor.

  • +
  • BoroCnstArt (float, default=0.0, \(\underline{a}\)) – The minimum Asset/Perminant Income ratio. for this agent, BoroCnstArt must be 0.

  • +
  • vFuncBool (bool) – Whether to calculate the value function during solution.

  • +
  • CubicBool (bool) – Whether to use cubic spline interpoliation.

  • +
  • PortfolioBool (Boolean) – Determines whether agent will use portfolio optimization or they only have access to risky assets. If false, the risky share is always one.

  • +
+
+
Simulation Parameters:
+
    +
  • sim_common_Rrisky (Boolean) – Whether risky returns have a shared/common value across agents. If True, Risky return’s can’t be time varying.

  • +
  • AgentCount (int) – Number of agents of this kind that are created during simulations.

  • +
  • T_age (int) – Age after which to automatically kill agents, None to ignore.

  • +
  • T_sim (int, required for simulation) – Number of periods to simulate.

  • +
  • track_vars (list[strings]) – List of variables that should be tracked when running the simulation. +For this agent, the options are ‘Adjust’, ‘PermShk’, ‘Risky’, ‘TranShk’, ‘aLvl’, ‘aNrm’, ‘bNrm’, ‘cNrm’, ‘mNrm’, ‘pLvl’, and ‘who_dies’.

    +

    Adjust is the array of which agents can adjust

    +

    PermShk is the agent’s permanent income shock

    +

    Risky is the agent’s risky asset shock

    +

    TranShk is the agent’s transitory income shock

    +

    aLvl is the nominal asset level

    +

    aNrm is the normalized assets

    +

    bNrm is the normalized resources without this period’s labor income

    +

    cNrm is the normalized consumption

    +

    mNrm is the normalized market resources

    +

    pLvl is the permanent income level

    +

    who_dies is the array of which agents died

    +
  • +
  • aNrmInitMean (float) – Mean of Log initial Normalized Assets.

  • +
  • aNrmInitStd (float) – Std of Log initial Normalized Assets.

  • +
  • pLvlInitMean (float) – Mean of Log initial permanent income.

  • +
  • pLvlInitStd (float) – Std of Log initial permanent income.

  • +
  • PermGroFacAgg (float) – Aggregate permanent income growth factor (The portion of PermGroFac attributable to aggregate productivity growth).

  • +
  • PerfMITShk (boolean) – Do Perfect Foresight MIT Shock (Forces Newborns to follow solution path of the agent they replaced if True).

  • +
  • NewbornTransShk (boolean) – Whether Newborns have transitory shock.

  • +
+
+
Attributes:
+
    +
  • solution (list[Consumer solution object]) – Created by the solve() method. Finite horizon models create a list with T_cycle+1 elements, for each period in the solution. +Infinite horizon solutions return a list with T_cycle elements for each period in the cycle.

    +

    Visit HARK.ConsumptionSaving.ConsIndShockModel.ConsumerSolution for more information about the solution.

    +
  • +
  • history (Dict[Array]) – Created by running the simulate() method. +Contains the variables in track_vars. Each item in the dictionary is an array with the shape (T_sim,AgentCount). +Visit HARK.core.AgentType.simulate for more information.

  • +
+
+
+
+
+IncShkDstn_default = {'IncUnemp': 0.3, 'IncUnempRet': 0.0, 'PermShkCount': 7, 'PermShkStd': [0.1], 'T_retire': 0, 'TranShkCount': 7, 'TranShkStd': [0.1], 'UnempPrb': 0.05, 'UnempPrbRet': 0.005}#
+
+ +
+
+RiskyDstn_default = {'RiskyAvg': 1.0803701891, 'RiskyCount': 5, 'RiskyStd': 0.162927447983}#
+
+ +
+
+aXtraGrid_default = {'aXtraCount': 48, 'aXtraExtra': None, 'aXtraMax': 20, 'aXtraMin': 0.001, 'aXtraNestFac': 3}#
+
+ +
+
+ShareGrid_default = {'ShareCount': 25}#
+
+ +
+
+solving_default = {'AdjustPrb': 1.0, 'BoroCnstArt': 0.0, 'CRRA': 2.0, 'CubicBool': False, 'DiscFac': 0.96, 'LivPrb': [0.98], 'PermGroFac': [1.01], 'Rfree': 1.03, 'RiskyShareFixed': [0.0], 'T_cycle': 1, 'constructors': {'IncShkDstn': <function construct_lognormal_income_process_unemployment>, 'PermShkDstn': <function get_PermShkDstn_from_IncShkDstn>, 'RiskyDstn': <function make_lognormal_RiskyDstn>, 'ShareGrid': <function make_simple_ShareGrid>, 'ShareLimit': <function calc_ShareLimit_for_CRRA>, 'ShockDstn': <function combine_IncShkDstn_and_RiskyDstn>, 'TranShkDstn': <function get_TranShkDstn_from_IncShkDstn>, 'aXtraGrid': <function make_assets_grid>, 'solution_terminal': <function make_basic_CRRA_solution_terminal>}, 'cycles': 1, 'sim_common_Rrisky': True, 'vFuncBool': False}#
+
+ +
+
+simulation_default = {'AgentCount': 10000, 'NewbornTransShk': False, 'PerfMITShk': False, 'PermGroFacAgg': 1.0, 'T_age': None, 'aNrmInitMean': 0.0, 'aNrmInitStd': 1.0, 'neutral_measure': False, 'pLvlInitMean': 0.0, 'pLvlInitStd': 0.0}#
+
+ +
+
+time_vary_ = ['LivPrb', 'PermGroFac', 'RiskyShareFixed']#
+
+ +
+ +
+ + +
+ + + + + + + +
+ + + + +
+ + +
+ + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/Documentation/reference/ConsumptionSaving/ConsRiskyContribModel.html b/Documentation/reference/ConsumptionSaving/ConsRiskyContribModel.html new file mode 100644 index 000000000..435549542 --- /dev/null +++ b/Documentation/reference/ConsumptionSaving/ConsRiskyContribModel.html @@ -0,0 +1,1239 @@ + + + + + + + + + + + ConsRiskyContribModel — HARK latest documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+
+ + + + +
+ + + + + + + + + + + + + +
+ +
+ + +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ +
+

ConsRiskyContribModel#

+

This file contains classes and functions for representing, solving, and simulating +a consumer type with idiosyncratic shocks to permanent and transitory income, +who can save in both a risk-free and a risky asset but faces frictions to +moving funds between them. The agent can only consume out of his risk-free +asset.

+

The model is described in detail in the REMARK: +https://econ-ark.org/materials/riskycontrib

+
@software{mateo_velasquez_giraldo_2021_4977915,
+  author       = {Mateo Velásquez-Giraldo},
+  title        = {{Mv77/RiskyContrib: A Two-Asset Savings Model with
+                   an Income-Contribution Scheme}},
+  month        = jun,
+  year         = 2021,
+  publisher    = {Zenodo},
+  version      = {v1.0.1},
+  doi          = {10.5281/zenodo.4977915},
+  url          = {https://doi.org/10.5281/zenodo.4977915}
+}
+
+
+
+
+class HARK.ConsumptionSaving.ConsRiskyContribModel.RiskyContribConsumerType(verbose=False, quiet=False, joint_dist_solver=False, **kwds)#
+

Bases: IndShockRiskyAssetConsumerType

+

A consumer type with idiosyncratic shocks to permanent and transitory income, +who can save in both a risk-free and a risky asset but faces frictions to +moving funds between them. The agent can only consume out of his risk-free +asset.

+

The frictions are:

+
    +
  • A proportional tax on funds moved from the risky to the risk-free +asset.

  • +
  • A stochastic inability to move funds between his accounts.

  • +
+

To partially avoid the second friction, the agent can commit to have a +fraction of his labor income, which is usually deposited in his risk-free +account, diverted to his risky account. He can change this fraction +only in periods where he is able to move funds between accounts.

+
+
+time_inv_ = ['CRRA', 'DiscFac', 'BoroCnstArt', 'BoroCnstArt', 'vFuncBool', 'CubicBool', 'PortfolioBisect', 'DiscreteShareBool', 'joint_dist_solver']#
+
+ +
+
+state_vars = ['pLvl', 'PlvlAgg', 'bNrm', 'mNrm', 'aNrm', 'aLvl', 'gNrm', 'nNrm', 'mNrmTilde', 'nNrmTilde', 'Share']#
+
+ +
+
+shock_vars_ = ['PermShk', 'TranShk', 'Adjust', 'Risky']#
+
+ +
+
+pre_solve()#
+

Method that is run automatically just before solution by backward iteration. +Solves the (trivial) terminal period and does a quick check on the borrowing +constraint and MaxKinks attribute (only relevant in constrained, infinite +horizon problems).

+
+ +
+
+update()#
+

Update the income process, the assets grid, and the terminal solution.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+update_solution_terminal()#
+

Solves the terminal period. The solution is trivial. +Cns: agent will consume all of his liquid resources. +Sha: irrelevant as there is no “next” period. +Reb: agent will shift all of his resources to the risk-free asset.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+update_tau()#
+

Checks that the tax rate on risky-to-risk-free flows has the appropriate +length adds it to time_(in)vary

+
+
Return type:
+

None.

+
+
+
+ +
+
+update_share_grid()#
+

Creates grid for the income contribution share.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+update_dfrac_grid()#
+

Creates grid for the rebalancing flow between assets. This flow is +normalized as a ratio. +- If d > 0, d*mNrm flows towards the risky asset. +- If d < 0, d*nNrm (pre-tax) flows towards the risk-free asset.

+
+
Return type:
+

None.

+
+
+
+ +
+
+update_nNrm_grid()#
+

Updates the agent’s iliquid assets grid by constructing a +multi-exponentially spaced grid of nNrm values.

+
+
Parameters:
+

None

+
+
Return type:
+

None.

+
+
+
+ +
+
+update_mNrm_grid()#
+

Updates the agent’s liquid assets exogenous grid by constructing a +multi-exponentially spaced grid of mNrm values.

+
+
Parameters:
+

None

+
+
Return type:
+

None.

+
+
+
+ +
+
+initialize_sim()#
+

Initialize the state of simulation attributes.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+sim_birth(which_agents)#
+

Create new agents to replace ones who have recently died; takes draws of +initial aNrm and pLvl, as in ConsIndShockModel, then sets Share, Adjust +and post-rebalancing risky asset nNrmTilde to zero as initial values. +:param which_agents: Boolean array of size AgentCount indicating which agents should be “born”. +:type which_agents: np.array

+
+
Return type:
+

None

+
+
+
+ +
+
+sim_one_period()#
+

Simulates one period for this type.

+

Has to be re-defined instead of using AgentType.sim_one_period() because +of the “stages” structure.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+get_states_Reb()#
+

Get states for the first “stage”: rebalancing.

+
+ +
+
+get_controls_Reb()#
+

Get controls for the first stage: rebalancing

+
+ +
+
+get_states_Sha()#
+

Get states for the second “stage”: choosing the contribution share.

+
+ +
+
+get_controls_Sha()#
+

Get controls for the second “stage”: choosing the contribution share.

+
+ +
+
+get_states_Cns()#
+

Get states for the third “stage”: consumption.

+
+ +
+
+get_controls_Cns()#
+

Get controls for the third “stage”: consumption.

+
+ +
+
+get_post_states()#
+

Set variables that are not a state to any problem but need to be +computed in order to interact with shocks and produce next period’s +states.

+
+ +
+ +
+
+class HARK.ConsumptionSaving.ConsRiskyContribModel.RiskyContribRebSolution(vFunc_Adj=None, dfracFunc_Adj=None, dvdmFunc_Adj=None, dvdnFunc_Adj=None, vFunc_Fxd=None, dfracFunc_Fxd=None, dvdmFunc_Fxd=None, dvdnFunc_Fxd=None, dvdsFunc_Fxd=None)#
+

Bases: MetricObject

+

A class for representing the solution to the asset-rebalancing stage of +the ‘RiskyContrib’ model.

+
+
Parameters:
+
    +
  • vFunc_Adj (ValueFunc2D) – Stage value function over normalized liquid resources and normalized +iliquid resources when the agent is able to adjust his portfolio.

  • +
  • dfracFunc_Adj (Interp2D) – Deposit function over normalized liquid resources and normalized +iliquid resources when the agent is able to adjust his portfolio.

  • +
  • dvdmFunc_Adj (MargValueFunc2D) – Marginal value over normalized liquid resources when the agent is able +to adjust his portfolio.

  • +
  • dvdnFunc_Adj (MargValueFunc2D) – Marginal value over normalized liquid resources when the agent is able +to adjust his portfolio.

  • +
  • vFunc_Fxd (ValueFunc3D) – Stage value function over normalized liquid resources, normalized +iliquid resources, and income contribution share when the agent is +not able to adjust his portfolio.

  • +
  • dfracFunc_Fxd (Interp2D) – Deposit function over normalized liquid resources, normalized iliquid +resources, and income contribution share when the agent is not able to +adjust his portfolio. +Must be ConstantFunction(0.0)

  • +
  • dvdmFunc_Fxd (MargValueFunc3D) – Marginal value over normalized liquid resources when the agent is not +able to adjust his portfolio.

  • +
  • dvdnFunc_Fxd (MargValueFunc3D) – Marginal value over normalized iliquid resources when the agent is not +able to adjust his portfolio.

  • +
  • dvdsFunc_Fxd (Interp3D) – Marginal value function over income contribution share when the agent +is not able to ajust his portfolio.

  • +
+
+
+
+
+distance_criteria = ['dvdmFunc_Adj', 'dvdnFunc_Adj']#
+
+ +
+ +
+
+class HARK.ConsumptionSaving.ConsRiskyContribModel.RiskyContribShaSolution(vFunc_Adj=None, ShareFunc_Adj=None, dvdmFunc_Adj=None, dvdnFunc_Adj=None, vFunc_Fxd=None, ShareFunc_Fxd=None, dvdmFunc_Fxd=None, dvdnFunc_Fxd=None, dvdsFunc_Fxd=None)#
+

Bases: MetricObject

+

A class for representing the solution to the contribution-share stage of +the ‘RiskyContrib’ model.

+
+
Parameters:
+
    +
  • vFunc_Adj (ValueFunc2D) – Stage value function over normalized liquid resources and normalized +iliquid resources when the agent is able to adjust his portfolio.

  • +
  • ShareFunc_Adj (Interp2D) – Income contribution share function over normalized liquid resources +and normalized iliquid resources when the agent is able to adjust his +portfolio.

  • +
  • dvdmFunc_Adj (MargValueFunc2D) – Marginal value function over normalized liquid resources when the agent +is able to adjust his portfolio.

  • +
  • dvdnFunc_Adj (MargValueFunc2D) – Marginal value function over normalized iliquid resources when the +agent is able to adjust his portfolio.

  • +
  • vFunc_Fxd (ValueFunc3D) – Stage value function over normalized liquid resources, normalized +iliquid resources, and income contribution share when the agent is not +able to adjust his portfolio.

  • +
  • ShareFunc_Fxd (Interp3D) – Income contribution share function over normalized liquid resources, +iliquid resources, and income contribution share when the agent is not +able to adjust his portfolio. +Should be an IdentityFunc.

  • +
  • dvdmFunc_Fxd (MargValueFunc3D) – Marginal value function over normalized liquid resources when the agent +is not able to adjust his portfolio.

  • +
  • dvdnFunc_Fxd (MargValueFunc3D) – Marginal value function over normalized iliquid resources when the +agent is not able to adjust his portfolio.

  • +
  • dvdsFunc_Fxd (Interp3D) – Marginal value function over income contribution share when the agent +is not able to adjust his portfolio

  • +
+
+
+
+
+distance_criteria = ['dvdmFunc_Adj', 'dvdnFunc_Adj']#
+
+ +
+ +
+
+class HARK.ConsumptionSaving.ConsRiskyContribModel.RiskyContribCnsSolution(vFunc=None, cFunc=None, dvdmFunc=None, dvdnFunc=None, dvdsFunc=None)#
+

Bases: MetricObject

+

A class for representing the solution to the consumption stage of the +‘RiskyContrib’ model.

+
+
Parameters:
+
    +
  • vFunc (ValueFunc3D) – Stage-value function over normalized liquid resources, normalized +iliquid resources, and income contribution share.

  • +
  • cFunc (Interp3D) – Consumption function over normalized liquid resources, normalized +iliquid resources, and income contribution share.

  • +
  • dvdmFunc (MargValueFunc3D) – Marginal value function over normalized liquid resources.

  • +
  • dvdnFunc (MargValueFunc3D) – Marginal value function over normalized iliquid resources.

  • +
  • dvdsFunc (Interp3D) – Marginal value function over income contribution share.

  • +
+
+
+
+
+distance_criteria = ['dvdmFunc', 'dvdnFunc']#
+
+ +
+ +
+
+class HARK.ConsumptionSaving.ConsRiskyContribModel.RiskyContribSolution(Reb, Sha, Cns)#
+

Bases: MetricObject

+

A class for representing the solution to a full time-period of the +‘RiskyContrib’ agent type’s problem.

+
+
Parameters:
+
+
+
+
+
+distance_criteria = ['stage_sols']#
+
+ +
+ +
+
+HARK.ConsumptionSaving.ConsRiskyContribModel.rebalance_assets(d, m, n, tau)#
+

A function that produces post-rebalancing assets for given initial assets, +rebalancing action, and tax rate.

+
+
Parameters:
+
    +
  • d (np.array) – Array with rebalancing decisions. d > 0 represents depositing d*m into +the risky asset account. d<0 represents withdrawing |d|*n (pre-tax) +from the risky account into the risky account.

  • +
  • m (np.array) – Initial risk-free assets.

  • +
  • n (np.array) – Initial risky assets.

  • +
  • tau (float) – Tax rate on flows from the risky to the risk-free asset.

  • +
+
+
Returns:
+

    +
  • mTil (np.array) – Post-rebalancing risk-free assets.

  • +
  • nTil (np.arrat) – Post-rebalancing risky assets.

  • +
+

+
+
+
+ +
+
+HARK.ConsumptionSaving.ConsRiskyContribModel.m_nrm_next(shocks, aNrm, Share, Rfree, PermGroFac)#
+

Given end-of-period balances and contribution share and the +start-of-next-period shocks, figure out next period’s normalized riskless +assets

+
+
Parameters:
+
    +
  • shocks (np.array) – Length-3 array with the stochastic shocks that get realized between the +end of the current period and the start of next period. Their order is +(0) permanent income shock, (1) transitory income shock, (2) risky +asset return.

  • +
  • aNrm (float) – End-of-period risk-free asset balances.

  • +
  • Share (float) – End-of-period income deduction share.

  • +
  • Rfree (float) – Risk-free return factor.

  • +
  • PermGroFac (float) – Permanent income growth factor.

  • +
+
+
Returns:
+

m_nrm_tp1 – Next-period normalized riskless balance.

+
+
Return type:
+

float

+
+
+
+ +
+
+HARK.ConsumptionSaving.ConsRiskyContribModel.n_nrm_next(shocks, nNrm, Share, PermGroFac)#
+

Given end-of-period balances and contribution share and the +start-of-next-period shocks, figure out next period’s normalized risky +assets

+
+
Parameters:
+
    +
  • shocks (np.array) – Length-3 array with the stochastic shocks that get realized between the +end of the current period and the start of next period. Their order is +(0) permanent income shock, (1) transitory income shock, (2) risky +asset return.

  • +
  • nNrm (float) – End-of-period risky asset balances.

  • +
  • Share (float) – End-of-period income deduction share.

  • +
  • PermGroFac (float) – Permanent income growth factor.

  • +
+
+
Returns:
+

n_nrm_tp1 – Next-period normalized risky balance.

+
+
Return type:
+

float

+
+
+
+ +
+
+HARK.ConsumptionSaving.ConsRiskyContribModel.solve_RiskyContrib_Cns(solution_next, ShockDstn, IncShkDstn, RiskyDstn, IndepDstnBool, LivPrb, DiscFac, CRRA, Rfree, PermGroFac, BoroCnstArt, aXtraGrid, nNrmGrid, mNrmGrid, ShareGrid, vFuncBool, AdjustPrb, DiscreteShareBool, joint_dist_solver, **unused_params)#
+

Solves the consumption stage of the agent’s problem

+
+
Parameters:
+
    +
  • solution_next (RiskyContribRebSolution) – Solution to the first stage of the next period in the agent’s problem.

  • +
  • ShockDstn (DiscreteDistribution) – Joint distribution of next period’s (0) permanent income shock, (1) +transitory income shock, and (2) risky asset return factor.

  • +
  • IncShkDstn (DiscreteDistribution) – Joint distribution of next period’s (0) permanent income shock and (1) +transitory income shock.

  • +
  • RiskyDstn (DiscreteDistribution) – Distribution of next period’s risky asset return factor.

  • +
  • IndepDstnBool (bool) – Indicates whether the income and risky return distributions are +independent.

  • +
  • LivPrb (float) – Probability of surviving until next period.

  • +
  • DiscFac (float) – Time-preference discount factor.

  • +
  • CRRA (float) – Coefficient of relative risk aversion.

  • +
  • Rfree (float) – Risk-free return factor.

  • +
  • PermGroFac (float) – Deterministic permanent income growth factor.

  • +
  • BoroCnstArt (float) – Minimum allowed market resources (must be 0).

  • +
  • aXtraGrid (numpy array) – Exogenous grid for end-of-period risk free resources.

  • +
  • nNrmGrid (numpy array) – Exogenous grid for risky resources.

  • +
  • mNrmGrid (numpy array) – Exogenous grid for risk-free resources.

  • +
  • ShareGrid (numpt array) – Exogenous grid for the income contribution share.

  • +
  • vFuncBool (bool) – Boolean that determines wether the value function’s level needs to be +computed.

  • +
  • AdjustPrb (float) – Probability thet the agent will be able to adjust his portfolio next +period.

  • +
  • DiscreteShareBool (bool) – Boolean that determines whether only a discrete set of contribution +shares (ShareGrid) is allowed.

  • +
  • joint_dist_solver (bool) – Should the general solver be used even if income and returns are +independent?

  • +
+
+
Returns:
+

solution – Solution to the agent’s consumption stage problem.

+
+
Return type:
+

RiskyContribCnsSolution

+
+
+
+ +
+
+HARK.ConsumptionSaving.ConsRiskyContribModel.solve_RiskyContrib_Sha(solution_next, CRRA, AdjustPrb, mNrmGrid, nNrmGrid, ShareGrid, DiscreteShareBool, vFuncBool, **unused_params)#
+

Solves the income-contribution-share stag of the agent’s problem

+
+
Parameters:
+
    +
  • solution_next (RiskyContribCnsSolution) – Solution to the agent’s consumption stage problem that follows.

  • +
  • CRRA (float) – Coefficient of relative risk aversion.

  • +
  • AdjustPrb (float) – Probability that the agent will be able to rebalance his portfolio +next period.

  • +
  • mNrmGrid (numpy array) – Exogenous grid for risk-free resources.

  • +
  • nNrmGrid (numpy array) – Exogenous grid for risky resources.

  • +
  • ShareGrid (numpy array) – Exogenous grid for the income contribution share.

  • +
  • DiscreteShareBool (bool) – Boolean that determines whether only a discrete set of contribution +shares (ShareGrid) is allowed.

  • +
  • vFuncBool (bool) – Determines whether the level of the value function is computed.

  • +
+
+
Yields:
+

solution (RiskyContribShaSolution) – Solution to the income-contribution-share stage of the agent’s problem.

+
+
+
+ +
+
+HARK.ConsumptionSaving.ConsRiskyContribModel.solve_RiskyContrib_Reb(solution_next, CRRA, tau, nNrmGrid, mNrmGrid, dfracGrid, vFuncBool, **unused_params)#
+

Solves the asset-rebalancing-stage of the agent’s problem

+
+
Parameters:
+
    +
  • solution_next (RiskyContribShaSolution) – Solution to the income-contribution-share stage problem that follows.

  • +
  • CRRA (float) – Coefficient of relative risk aversion.

  • +
  • tau (float) – Tax rate on risky asset withdrawals.

  • +
  • nNrmGrid (numpy array) – Exogenous grid for risky resources.

  • +
  • mNrmGrid (numpy array) – Exogenous grid for risk-free resources.

  • +
  • dfracGrid (numpy array) – Grid for rebalancing flows. The final grid will be equivalent to +[-nNrm*dfracGrid, dfracGrid*mNrm].

  • +
  • vFuncBool (bool) – Determines whether the level of th value function must be computed.

  • +
+
+
Returns:
+

solution – Solution to the asset-rebalancing stage of the agent’s problem.

+
+
Return type:
+

RiskyContribShaSolution

+
+
+
+ +
+
+HARK.ConsumptionSaving.ConsRiskyContribModel.solveRiskyContrib(solution_next, ShockDstn, IncShkDstn, RiskyDstn, IndepDstnBool, LivPrb, DiscFac, CRRA, Rfree, PermGroFac, tau, BoroCnstArt, aXtraGrid, nNrmGrid, mNrmGrid, ShareGrid, dfracGrid, vFuncBool, AdjustPrb, DiscreteShareBool, joint_dist_solver)#
+

Solve a full period (with its three stages) of the agent’s problem

+
+
Parameters:
+
    +
  • solution_next (RiskyContribSolution) – Solution to next period’s problem.

  • +
  • ShockDstn (DiscreteDistribution) – Joint distribution of next period’s (0) permanent income shock, (1) +transitory income shock, and (2) risky asset return factor.

  • +
  • IncShkDstn (DiscreteDistribution) – Joint distribution of next period’s (0) permanent income shock and (1) +transitory income shock.

  • +
  • RiskyDstn (DiscreteDistribution) – Distribution of next period’s risky asset return factor.

  • +
  • IndepDstnBool (bool) – Indicates whether the income and risky return distributions are +independent.

  • +
  • LivPrb (float) – Probability of surviving until next period.

  • +
  • DiscFac (float) – Time-preference discount factor.

  • +
  • CRRA (float) – Coefficient of relative risk aversion.

  • +
  • Rfree (float) – Risk-free return factor.

  • +
  • PermGroFac (float) – Deterministic permanent income growth factor.

  • +
  • tau (float) – Tax rate on risky asset withdrawals.

  • +
  • BoroCnstArt (float) – Minimum allowed market resources (must be 0).

  • +
  • aXtraGrid (numpy array) – Exogenous grid for end-of-period risk free resources.

  • +
  • nNrmGrid (numpy array) – Exogenous grid for risky resources.

  • +
  • mNrmGrid (numpy array) – Exogenous grid for risk-free resources.

  • +
  • ShareGrid (numpy array) – Exogenous grid for the income contribution share.

  • +
  • dfracGrid (numpy array) – Grid for rebalancing flows. The final grid will be equivalent to +[-nNrm*dfracGrid, dfracGrid*mNrm].

  • +
  • vFuncBool (bool) – Determines whether the level of th value function must be computed.

  • +
  • AdjustPrb (float) – Probability that the agent will be able to rebalance his portfolio +next period.

  • +
  • DiscreteShareBool (bool) – Boolean that determines whether only a discrete set of contribution +shares (ShareGrid) is allowed.

  • +
  • joint_dist_solver (bool) – Should the general solver be used even if income and returns are +independent?

  • +
+
+
Returns:
+

periodSol – Solution to the agent’s current-period problem.

+
+
Return type:
+

RiskyContribSolution

+
+
+
+ +
+ + +
+ + + + + + + +
+ + + + + + + +
+ + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/Documentation/reference/ConsumptionSaving/TractableBufferStockModel.html b/Documentation/reference/ConsumptionSaving/TractableBufferStockModel.html new file mode 100644 index 000000000..4ce2e5813 --- /dev/null +++ b/Documentation/reference/ConsumptionSaving/TractableBufferStockModel.html @@ -0,0 +1,770 @@ + + + + + + + + + + + TractableBufferStockModel — HARK latest documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+
+ + + + +
+ + + + + + + + + + + + + +
+ +
+ + +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ +
+

TractableBufferStockModel#

+

Defines and solves the Tractable Buffer Stock model described in lecture notes +for “A Tractable Model of Buffer Stock Saving” (henceforth, TBS) available at +https://www.econ2.jhu.edu/people/ccarroll/public/lecturenotes/consumption/TractableBufferStock +The model concerns an agent with constant relative risk aversion utility making +decisions over consumption and saving. He is subject to only a very particular +sort of risk: the possibility that he will become permanently unemployed until +the day he dies; barring this, his income is certain and grows at a constant rate.

+

The model has an infinite horizon, but is not solved by backward iteration in a +traditional sense. Because of the very specific assumptions about risk, it is +possible to find the agent’s steady state or target level of market resources +when employed, as well as information about the optimal consumption rule at this +target level. The full consumption function can then be constructed by “back- +shooting”, inverting the Euler equation to find what consumption must have been +in the previous period. The consumption function is thus constructed by repeat- +edly adding “stable arm” points to either end of a growing list until specified +bounds are exceeded.

+

Despite the non-standard solution method, the iterative process can be embedded +in the HARK framework, as shown below.

+
+
+class HARK.ConsumptionSaving.TractableBufferStockModel.TractableConsumerSolution(mNrm_list=None, cNrm_list=None, MPC_list=None, cFunc_U=<class 'HARK.utilities.NullFunc'>, cFunc=<class 'HARK.utilities.NullFunc'>)#
+

Bases: MetricObject

+

A class representing the solution to a tractable buffer saving problem. +Attributes include a list of money points mNrm_list, a list of consumption points +cNrm_list, a list of MPCs MPC_list, a perfect foresight consumption function +while employed, and a perfect foresight consumption function while unemployed. +The solution includes a consumption function constructed from the lists.

+
+
Parameters:
+
    +
  • mNrm_list ([float]) – List of normalized market resources points on the stable arm.

  • +
  • cNrm_list ([float]) – List of normalized consumption points on the stable arm.

  • +
  • MPC_list ([float]) – List of marginal propensities to consume on the stable arm, corres- +ponding to the (mNrm,cNrm) points.

  • +
  • cFunc_U (function) – The (linear) consumption function when permanently unemployed.

  • +
  • cFunc (function) – The consumption function when employed.

  • +
+
+
+
+ +
+
+class HARK.ConsumptionSaving.TractableBufferStockModel.TractableConsumerType(**kwds)#
+

Bases: AgentType

+
+
Parameters:
+

AgentType (Same as)

+
+
+
+
+state_vars = ['bLvl', 'mLvl', 'aLvl']#
+
+ +
+
+pre_solve()#
+

Calculates all of the solution objects that can be obtained before con- +ducting the backshooting routine, including the target levels, the per- +fect foresight solution, (marginal) consumption at m=0, and the small +perturbations around the steady state.

+
+
Parameters:
+

none

+
+
Return type:
+

none

+
+
+
+ +
+
+post_solve()#
+

This method adds consumption at m=0 to the list of stable arm points, +then constructs the consumption function as a cubic interpolation over +those points. Should be run after the backshooting routine is complete.

+
+
Parameters:
+

none

+
+
Return type:
+

none

+
+
+
+ +
+
+sim_birth(which_agents)#
+

Makes new consumers for the given indices. Initialized variables include aNrm, as +well as time variables t_age and t_cycle. Normalized assets are drawn from a lognormal +distributions given by aLvlInitMean and aLvlInitStd.

+
+
Parameters:
+

which_agents (np.array(Bool)) – Boolean array of size self.AgentCount indicating which agents should be “born”.

+
+
Return type:
+

None

+
+
+
+ +
+
+sim_death()#
+

Trivial function that returns boolean array of all False, as there is no death.

+
+
Parameters:
+

None

+
+
Returns:
+

which_agents – Boolean array of size AgentCount indicating which agents die.

+
+
Return type:
+

np.array(bool)

+
+
+
+ +
+
+get_shocks()#
+

Determine which agents switch from employment to unemployment. All unemployed agents remain +unemployed until death.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+transition()#
+

Calculate market resources for all agents this period.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+get_controls()#
+

Calculate consumption for each agent this period.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+get_poststates()#
+

Calculates end-of-period assets for each consumer of this type.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+ +
+ + +
+ + + + + + + +
+ + + + + + + +
+ + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/Documentation/reference/ConsumptionSaving/index.html b/Documentation/reference/ConsumptionSaving/index.html new file mode 100644 index 000000000..8acf5a90d --- /dev/null +++ b/Documentation/reference/ConsumptionSaving/index.html @@ -0,0 +1,502 @@ + + + + + + + + + + + Consumption Saving — HARK latest documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+
+ + + + + + +
+ + + + + + + + + + + +
+ +
+ + +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + +
+ +
+
+
+ +
+ + + + +
+ + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/Documentation/reference/index.html b/Documentation/reference/index.html new file mode 100644 index 000000000..24993c982 --- /dev/null +++ b/Documentation/reference/index.html @@ -0,0 +1,604 @@ + + + + + + + + + + + API Reference — HARK latest documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+
+ + + + +
+ + + + + + + + + + + + + +
+ +
+ + + + + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/Documentation/reference/tools/core.html b/Documentation/reference/tools/core.html new file mode 100644 index 000000000..78bc55055 --- /dev/null +++ b/Documentation/reference/tools/core.html @@ -0,0 +1,1875 @@ + + + + + + + + + + + Core — HARK latest documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+
+ + + + +
+ + + + + + + + + + + + + +
+ +
+ + +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ +
+

Core#

+

High-level functions and classes for solving a wide variety of economic models. +The “core” of HARK is a framework for “microeconomic” and “macroeconomic” +models. A micro model concerns the dynamic optimization problem for some type +of agents, where agents take the inputs to their problem as exogenous. A macro +model adds an additional layer, endogenizing some of the inputs to the micro +problem by finding a general equilibrium dynamic rule.

+
+
+HARK.core.disable_logging()#
+
+ +
+
+HARK.core.enable_logging()#
+
+ +
+
+HARK.core.warnings()#
+
+ +
+
+HARK.core.quiet()#
+
+ +
+
+HARK.core.verbose()#
+
+ +
+
+HARK.core.set_verbosity_level(level)#
+
+ +
+
+class HARK.core.Parameters(**parameters: Any)#
+

Bases: object

+

A smart container for model parameters that handles age-varying dynamics.

+

This class stores parameters as an internal dictionary and manages their +age-varying properties, providing both attribute-style and dictionary-style +access. It is designed to handle the time-varying dynamics of parameters +in economic models.

+
+
Attributes:
+
    +
  • _length (int) – The terminal age of the agents in the model.

  • +
  • _invariant_params (Set[str]) – A set of parameter names that are invariant over time.

  • +
  • _varying_params (Set[str]) – A set of parameter names that vary over time.

  • +
  • _parameters (Dict[str, Any]) – The internal dictionary storing all parameters.

  • +
+
+
+
+
+keys() Iterator[str]#
+

Return a view of parameter names.

+
+ +
+
+values() Iterator[Any]#
+

Return a view of parameter values.

+
+ +
+
+items() Iterator[Tuple[str, Any]]#
+

Return a view of parameter (name, value) pairs.

+
+ +
+
+to_dict() Dict[str, Any]#
+

Convert parameters to a plain dictionary.

+
+
Returns:
+

A dictionary containing all parameters.

+
+
Return type:
+

Dict[str, Any]

+
+
+
+ +
+
+to_namedtuple() namedtuple#
+

Convert parameters to a namedtuple.

+
+
Returns:
+

A namedtuple containing all parameters.

+
+
Return type:
+

namedtuple

+
+
+
+ +
+
+update(other: Parameters | Dict[str, Any]) None#
+

Update parameters from another Parameters object or dictionary.

+
+
Parameters:
+

other (Union[Parameters, Dict[str, Any]]) – The source of parameters to update from.

+
+
Raises:
+

TypeError – If the input is neither a Parameters object nor a dictionary.

+
+
+
+ +
+
+copy() Parameters#
+

Create a deep copy of the Parameters object.

+
+
Returns:
+

A new Parameters object with the same contents.

+
+
Return type:
+

Parameters

+
+
+
+ +
+
+add_to_time_vary(*params: str) None#
+

Adds any number of parameters to the time-varying set.

+
+
Parameters:
+

*params (str) – Any number of strings naming parameters to be added to time_vary.

+
+
+
+ +
+
+add_to_time_inv(*params: str) None#
+

Adds any number of parameters to the time-invariant set.

+
+
Parameters:
+

*params (str) – Any number of strings naming parameters to be added to time_inv.

+
+
+
+ +
+
+del_from_time_vary(*params: str) None#
+

Removes any number of parameters from the time-varying set.

+
+
Parameters:
+

*params (str) – Any number of strings naming parameters to be removed from time_vary.

+
+
+
+ +
+
+del_from_time_inv(*params: str) None#
+

Removes any number of parameters from the time-invariant set.

+
+
Parameters:
+

*params (str) – Any number of strings naming parameters to be removed from time_inv.

+
+
+
+ +
+
+get(key: str, default: Any = None) Any#
+

Get a parameter value, returning a default if not found.

+
+
Parameters:
+
    +
  • key (str) – The parameter name.

  • +
  • default (Any, optional) – The default value to return if the key is not found.

  • +
+
+
Returns:
+

The parameter value or the default.

+
+
Return type:
+

Any

+
+
+
+ +
+
+set_many(**kwargs: Any) None#
+

Set multiple parameters at once.

+
+
Parameters:
+

**kwargs (Keyword arguments representing parameter names and values.)

+
+
+
+ +
+
+is_time_varying(key: str) bool#
+

Check if a parameter is time-varying.

+
+
Parameters:
+

key (str) – The parameter name.

+
+
Returns:
+

True if the parameter is time-varying, False otherwise.

+
+
Return type:
+

bool

+
+
+
+ +
+ +
+
+class HARK.core.Model#
+

Bases: object

+

A class with special handling of parameters assignment.

+
+
+assign_parameters(**kwds)#
+

Assign an arbitrary number of attributes to this agent.

+
+
Parameters:
+

**kwds (keyword arguments) – Any number of keyword arguments of the form key=value. +Each value will be assigned to the attribute named in self.

+
+
Return type:
+

None

+
+
+
+ +
+
+get_parameter(name)#
+

Returns a parameter of this model

+
+
Parameters:
+

name (str) – The name of the parameter to get

+
+
Returns:
+

value

+
+
Return type:
+

The value of the parameter

+
+
+
+ +
+
+describe()#
+
+ +
+
+del_param(param_name)#
+

Deletes a parameter from this instance, removing it both from the object’s +namespace (if it’s there) and the parameters dictionary (likewise).

+
+
Parameters:
+

param_name (str) – A string naming a parameter or data to be deleted from this instance. +Removes information from self.parameters dictionary and own namespace.

+
+
Return type:
+

None

+
+
+
+ +
+
+construct(*args, force=False)#
+

Top-level method for building constructed inputs. If called without any +inputs, construct builds each of the objects named in the keys of the +constructors dictionary; it draws inputs for the constructors from the +parameters dictionary and adds its results to the same. If passed one or +more strings as arguments, the method builds only the named keys. The +method will do multiple “passes” over the requested keys, as some cons- +tructors require inputs built by other constructors. If any requested +constructors failed to build due to missing data, those keys (and the +missing data) will be named in self._missing_key_data. Other errors are +recorded in the dictionary attribute _constructor_errors.

+
+
Parameters:
+
    +
  • *args (str, optional) – Keys of self.constructors that are requested to be constructed. +If no arguments are passed, all elements of the dictionary are implied.

  • +
  • force (bool, optional) – When True, the method will force its way past any errors, including +missing constructors, missing arguments for constructors, and errors +raised during execution of constructors. Information about all such +errors is stored in the dictionary attributes described above. When +False (default), any errors or exception will be raised.

  • +
+
+
Return type:
+

None

+
+
+
+ +
+
+describe_constructors(*args)#
+

Prints to screen a string describing this instance’s constructed objects, +including their names, the function that constructs them, the names of +those functions inputs, and whether those inputs are present.

+
+
Parameters:
+

*args (str, optional) – Optional list of strings naming constructed inputs to be described. +If none are passed, all constructors are described.

+
+
Return type:
+

None

+
+
+
+ +
+ +
+
+class HARK.core.AgentType(solution_terminal=None, pseudo_terminal=True, tolerance=1e-06, seed=0, **kwds)#
+

Bases: Model

+

A superclass for economic agents in the HARK framework. Each model should +specify its own subclass of AgentType, inheriting its methods and overwriting +as necessary. Critically, every subclass of AgentType should define class- +specific static values of the attributes time_vary and time_inv as lists of +strings. Each element of time_vary is the name of a field in AgentSubType +that varies over time in the model. Each element of time_inv is the name of +a field in AgentSubType that is constant over time in the model.

+
+
Parameters:
+
    +
  • solution_terminal (Solution) – A representation of the solution to the terminal period problem of +this AgentType instance, or an initial guess of the solution if this +is an infinite horizon problem.

  • +
  • cycles (int) – The number of times the sequence of periods is experienced by this +AgentType in their “lifetime”. cycles=1 corresponds to a lifecycle +model, with a certain sequence of one period problems experienced +once before terminating. cycles=0 corresponds to an infinite horizon +model, with a sequence of one period problems repeating indefinitely.

  • +
  • pseudo_terminal (boolean) – Indicates whether solution_terminal isn’t actually part of the +solution to the problem (as a known solution to the terminal period +problem), but instead represents a “scrap value”-style termination. +When True, solution_terminal is not included in the solution; when +false, solution_terminal is the last element of the solution.

  • +
  • tolerance (float) – Maximum acceptable “distance” between successive solutions to the +one period problem in an infinite horizon (cycles=0) model in order +for the solution to be considered as having “converged”. Inoperative +when cycles>0.

  • +
  • seed (int) – A seed for this instance’s random number generator.

  • +
+
+
Attributes:
+
    +
  • AgentCount (int) – The number of agents of this type to use in simulation.

  • +
  • state_vars (list of string) – The string labels for this AgentType’s model state variables.

  • +
+
+
+
+
+state_vars = []#
+
+ +
+
+add_to_time_vary(*params)#
+

Adds any number of parameters to time_vary for this instance.

+
+
Parameters:
+

params (string) – Any number of strings naming attributes to be added to time_vary

+
+
Return type:
+

None

+
+
+
+ +
+
+add_to_time_inv(*params)#
+

Adds any number of parameters to time_inv for this instance.

+
+
Parameters:
+

params (string) – Any number of strings naming attributes to be added to time_inv

+
+
Return type:
+

None

+
+
+
+ +
+
+del_from_time_vary(*params)#
+

Removes any number of parameters from time_vary for this instance.

+
+
Parameters:
+

params (string) – Any number of strings naming attributes to be removed from time_vary

+
+
Return type:
+

None

+
+
+
+ +
+
+del_from_time_inv(*params)#
+

Removes any number of parameters from time_inv for this instance.

+
+
Parameters:
+

params (string) – Any number of strings naming attributes to be removed from time_inv

+
+
Return type:
+

None

+
+
+
+ +
+
+unpack(parameter)#
+

Unpacks a parameter from a solution object for easier access. +After the model has been solved, the parameters (like consumption function) +reside in the attributes of each element of ConsumerType.solution (e.g. cFunc). This method creates a (time varying) attribute of the given +parameter name that contains a list of functions accessible by ConsumerType.parameter.

+
+
Parameters:
+

parameter (str) – Name of the function to unpack from the solution

+
+
Return type:
+

none

+
+
+
+ +
+
+solve(verbose=False, presolve=True)#
+

Solve the model for this instance of an agent type by backward induction. +Loops through the sequence of one period problems, passing the solution +from period t+1 to the problem for period t.

+
+
Parameters:
+
    +
  • verbose (bool, optional) – If True, solution progress is printed to screen. Default False.

  • +
  • presolve (bool, optional) – If True (default), the pre_solve method is run before solving.

  • +
+
+
Return type:
+

none

+
+
+
+ +
+
+reset_rng()#
+

Reset the random number generator for this type.

+
+
Parameters:
+

none

+
+
Return type:
+

none

+
+
+
+ +
+
+check_elements_of_time_vary_are_lists()#
+

A method to check that elements of time_vary are lists.

+
+ +
+
+check_restrictions()#
+

A method to check that various restrictions are met for the model class.

+
+ +
+
+pre_solve()#
+

A method that is run immediately before the model is solved, to check inputs or to prepare +the terminal solution, perhaps.

+
+
Parameters:
+

none

+
+
Return type:
+

none

+
+
+
+ +
+
+post_solve()#
+

A method that is run immediately after the model is solved, to finalize +the solution in some way. Does nothing here.

+
+
Parameters:
+

none

+
+
Return type:
+

none

+
+
+
+ +
+
+initialize_sim()#
+

Prepares this AgentType for a new simulation. Resets the internal random number generator, +makes initial states for all agents (using sim_birth), clears histories of tracked variables.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+sim_one_period()#
+

Simulates one period for this type. Calls the methods get_mortality(), get_shocks() or +read_shocks, get_states(), get_controls(), and get_poststates(). These should be defined for +AgentType subclasses, except get_mortality (define its components sim_death and sim_birth +instead) and read_shocks.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+make_shock_history()#
+

Makes a pre-specified history of shocks for the simulation. Shock variables should be named +in self.shock_vars, a list of strings that is subclass-specific. This method runs a subset +of the standard simulation loop by simulating only mortality and shocks; each variable named +in shock_vars is stored in a T_sim x AgentCount array in history dictionary self.history[X]. +Automatically sets self.read_shocks to True so that these pre-specified shocks are used for +all subsequent calls to simulate().

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+get_mortality()#
+

Simulates mortality or agent turnover according to some model-specific rules named sim_death +and sim_birth (methods of an AgentType subclass). sim_death takes no arguments and returns +a Boolean array of size AgentCount, indicating which agents of this type have “died” and +must be replaced. sim_birth takes such a Boolean array as an argument and generates initial +post-decision states for those agent indices.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+sim_death()#
+

Determines which agents in the current population “die” or should be replaced. Takes no +inputs, returns a Boolean array of size self.AgentCount, which has True for agents who die +and False for those that survive. Returns all False by default, must be overwritten by a +subclass to have replacement events.

+
+
Parameters:
+

None

+
+
Returns:
+

who_dies – Boolean array of size self.AgentCount indicating which agents die and are replaced.

+
+
Return type:
+

np.array

+
+
+
+ +
+
+sim_birth(which_agents)#
+

Makes new agents for the simulation. Takes a boolean array as an input, indicating which +agent indices are to be “born”. Does nothing by default, must be overwritten by a subclass.

+
+
Parameters:
+

which_agents (np.array(Bool)) – Boolean array of size self.AgentCount indicating which agents should be “born”.

+
+
Return type:
+

None

+
+
+
+ +
+
+get_shocks()#
+

Gets values of shock variables for the current period. Does nothing by default, but can +be overwritten by subclasses of AgentType.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+read_shocks_from_history()#
+

Reads values of shock variables for the current period from history arrays. +For each variable X named in self.shock_vars, this attribute of self is +set to self.history[X][self.t_sim,:].

+

This method is only ever called if self.read_shocks is True. This can +be achieved by using the method make_shock_history() (or manually after +storing a “handcrafted” shock history).

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+get_states()#
+

Gets values of state variables for the current period. +By default, calls transition function and assigns values +to the state_now dictionary.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+transition()#
+
+
Parameters:
+
    +
  • None

  • +
  • [Eventually

  • +
  • spec (to match dolo)

  • +
  • exogenous_prev

  • +
  • endogenous_prev

  • +
  • controls

  • +
  • exogenous

  • +
  • parameters]

  • +
+
+
Returns:
+

endogenous_state – Tuple with new values of the endogenous states

+
+
Return type:
+

()

+
+
+
+ +
+
+get_controls()#
+

Gets values of control variables for the current period, probably by using current states. +Does nothing by default, but can be overwritten by subclasses of AgentType.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+get_poststates()#
+

Gets values of post-decision state variables for the current period, +probably by current +states and controls and maybe market-level events or shock variables. +Does nothing by +default, but can be overwritten by subclasses of AgentType.

+

DEPRECATED: New models should use the state now/previous rollover +functionality instead of poststates.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+simulate(sim_periods=None)#
+

Simulates this agent type for a given number of periods. Defaults to +self.T_sim if no input. +Records histories of attributes named in self.track_vars in +self.history[varname].

+
+
Parameters:
+

None

+
+
Returns:
+

history – The history tracked during the simulation.

+
+
Return type:
+

dict

+
+
+
+ +
+
+clear_history()#
+

Clears the histories of the attributes named in self.track_vars.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+ +
+
+HARK.core.solve_agent(agent, verbose)#
+

Solve the dynamic model for one agent type +using backwards induction. +This function iterates on “cycles” +of an agent’s model either a given number of times +or until solution convergence +if an infinite horizon model is used +(with agent.cycles = 0).

+
+
Parameters:
+
    +
  • agent (AgentType) – The microeconomic AgentType whose dynamic problem +is to be solved.

  • +
  • verbose (boolean) – If True, solution progress is printed to screen (when cycles != 1).

  • +
+
+
Returns:
+

solution – A list of solutions to the one period problems that the agent will +encounter in his “lifetime”.

+
+
Return type:
+

[Solution]

+
+
+
+ +
+
+HARK.core.solve_one_cycle(agent, solution_last)#
+

Solve one “cycle” of the dynamic model for one agent type. This function +iterates over the periods within an agent’s cycle, updating the time-varying +parameters and passing them to the single period solver(s).

+
+
Parameters:
+
    +
  • agent (AgentType) – The microeconomic AgentType whose dynamic problem is to be solved.

  • +
  • solution_last (Solution) – A representation of the solution of the period that comes after the +end of the sequence of one period problems. This might be the term- +inal period solution, a “pseudo terminal” solution, or simply the +solution to the earliest period from the succeeding cycle.

  • +
+
+
Returns:
+

solution_cycle – A list of one period solutions for one “cycle” of the AgentType’s +microeconomic model.

+
+
Return type:
+

[Solution]

+
+
+
+ +
+
+HARK.core.make_one_period_oo_solver(solver_class)#
+

Returns a function that solves a single period consumption-saving +problem. +:param solver_class: A class of Solver to be used. +:type solver_class: Solver +:param ——-: +:param solver_function: A function for solving one period of a problem. +:type solver_function: function

+
+ +
+
+class HARK.core.Market(agents=None, sow_vars=None, reap_vars=None, const_vars=None, track_vars=None, dyn_vars=None, mill_rule=None, calc_dynamics=None, act_T=1000, tolerance=1e-06, **kwds)#
+

Bases: Model

+

A superclass to represent a central clearinghouse of information. Used for +dynamic general equilibrium models to solve the “macroeconomic” model as a +layer on top of the “microeconomic” models of one or more AgentTypes.

+
+
Parameters:
+
    +
  • agents ([AgentType]) – A list of all the AgentTypes in this market.

  • +
  • sow_vars ([string]) – Names of variables generated by the “aggregate market process” that should +“sown” to the agents in the market. Aggregate state, etc.

  • +
  • reap_vars ([string]) – Names of variables to be collected (“reaped”) from agents in the market +to be used in the “aggregate market process”.

  • +
  • const_vars ([string]) – Names of attributes of the Market instance that are used in the “aggregate +market process” but do not come from agents– they are constant or simply +parameters inherent to the process.

  • +
  • track_vars ([string]) – Names of variables generated by the “aggregate market process” that should +be tracked as a “history” so that a new dynamic rule can be calculated. +This is often a subset of sow_vars.

  • +
  • dyn_vars ([string]) – Names of variables that constitute a “dynamic rule”.

  • +
  • mill_rule (function) – A function that takes inputs named in reap_vars and returns a tuple the same size and order as sow_vars. The “aggregate market process” that +transforms individual agent actions/states/data into aggregate data to +be sent back to agents.

  • +
  • calc_dynamics (function) – A function that takes inputs named in track_vars and returns an object +with attributes named in dyn_vars. Looks at histories of aggregate +variables and generates a new “dynamic rule” for agents to believe and +act on.

  • +
  • act_T (int) – The number of times that the “aggregate market process” should be run +in order to generate a history of aggregate variables.

  • +
  • tolerance (float) – Minimum acceptable distance between “dynamic rules” to consider the +Market solution process converged. Distance is a user-defined metric.

  • +
+
+
+
+
+solve_agents()#
+

Solves the microeconomic problem for all AgentTypes in this market.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+solve()#
+

“Solves” the market by finding a “dynamic rule” that governs the aggregate +market state such that when agents believe in these dynamics, their actions +collectively generate the same dynamic rule.

+
+
Parameters:
+

None

+
+
Return type:
+

None

+
+
+
+ +
+
+reap()#
+

Collects attributes named in reap_vars from each AgentType in the market, +storing them in respectively named attributes of self.

+
+
Parameters:
+

none

+
+
Return type:
+

none

+
+
+
+ +
+
+sow()#
+

Distributes attrributes named in sow_vars from self to each AgentType +in the market, storing them in respectively named attributes.

+
+
Parameters:
+

none

+
+
Return type:
+

none

+
+
+
+ +
+
+mill()#
+

Processes the variables collected from agents using the function mill_rule, +storing the results in attributes named in aggr_sow.

+
+
Parameters:
+

none

+
+
Return type:
+

none

+
+
+
+ +
+
+cultivate()#
+

Has each AgentType in agents perform their market_action method, using +variables sown from the market (and maybe also “private” variables). +The market_action method should store new results in attributes named in +reap_vars to be reaped later.

+
+
Parameters:
+

none

+
+
Return type:
+

none

+
+
+
+ +
+
+reset()#
+

Reset the state of the market (attributes in sow_vars, etc) to some +user-defined initial state, and erase the histories of tracked variables.

+
+
Parameters:
+

none

+
+
Return type:
+

none

+
+
+
+ +
+
+store()#
+

Record the current value of each variable X named in track_vars in an +dictionary field named history[X].

+
+
Parameters:
+

none

+
+
Return type:
+

none

+
+
+
+ +
+
+make_history()#
+

Runs a loop of sow–>cultivate–>reap–>mill act_T times, tracking the +evolution of variables X named in track_vars in dictionary fields +history[X].

+
+
Parameters:
+

none

+
+
Return type:
+

none

+
+
+
+ +
+
+update_dynamics()#
+

Calculates a new “aggregate dynamic rule” using the history of variables +named in track_vars, and distributes this rule to AgentTypes in agents.

+
+
Parameters:
+

none

+
+
Returns:
+

dynamics – The new “aggregate dynamic rule” that agents believe in and act on. +Should have attributes named in dyn_vars.

+
+
Return type:
+

instance

+
+
+
+ +
+ +
+
+HARK.core.distribute_params(agent, param_name, param_count, distribution)#
+

Distributes heterogeneous values of one parameter to the AgentTypes in self.agents. +:param agent: An agent to clone. +:type agent: AgentType +:param param_name: Name of the parameter to be assigned. +:type param_name: string +:param param_count: Number of different values the parameter will take on. +:type param_count: int +:param distribution: A 1-D distribution. +:type distribution: Distribution

+
+
Returns:
+

agent_set – A list of param_count agents, ex ante heterogeneous with +respect to param_name. The AgentCount of the original +will be split between the agents of the returned +list in proportion to the given distribution.

+
+
Return type:
+

[AgentType]

+
+
+
+ +
+
+class HARK.core.AgentPopulation(agent_type: AgentType, parameters: dict, seed: int = 0)#
+

Bases: object

+

A class for representing a population of ex-ante heterogeneous agents.

+
+
+agent_type: AgentType#
+
+ +
+
+parameters: dict#
+
+ +
+
+seed: int = 0#
+
+ +
+
+time_var: List[str]#
+
+ +
+
+time_inv: List[str]#
+
+ +
+
+distributed_params: List[str]#
+
+ +
+
+agent_type_count: int | None#
+
+ +
+
+term_age: int | None#
+
+ +
+
+continuous_distributions: Dict[str, Distribution]#
+
+ +
+
+discrete_distributions: Dict[str, Distribution]#
+
+ +
+
+population_parameters: List[Dict[str, List[float] | float]]#
+
+ +
+
+agents: List[AgentType]#
+
+ +
+
+agent_database: DataFrame#
+
+ +
+
+solution: List[Any]#
+
+ +
+
+approx_distributions(approx_params: dict)#
+

Approximate continuous distributions with discrete ones. If the initial +parameters include a Distribution type, then the AgentPopulation is +not ready to solve, and stands for an abstract population. To solve the +AgentPopulation, we need discretization parameters for each continuous +distribution. This method approximates the continuous distributions with +discrete ones, and updates the parameters dictionary.

+
+ +
+
+create_distributed_agents()#
+

Parses the parameters dictionary and creates a list of agents with the +appropriate parameters. Also sets the seed for each agent.

+
+ +
+
+create_database()#
+

Optionally creates a pandas DataFrame with the parameters for each agent.

+
+ +
+
+solve()#
+

Solves each agent of the population serially.

+
+ +
+
+unpack_solutions()#
+

Unpacks the solutions of each agent into an attribute of the population.

+
+ +
+
+initialize_sim()#
+

Initializes the simulation for each agent.

+
+ +
+
+simulate()#
+

Simulates each agent of the population serially.

+
+ +
+ +
+ + +
+ + + + + + + +
+ + + + +
+ + +
+ + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/Documentation/reference/tools/dcegm.html b/Documentation/reference/tools/dcegm.html new file mode 100644 index 000000000..5b6762be9 --- /dev/null +++ b/Documentation/reference/tools/dcegm.html @@ -0,0 +1,705 @@ + + + + + + + + + + + dcegm — HARK latest documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+
+ + + + +
+ + + + + + + + + + + + + +
+ +
+ + +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ +
+

dcegm#

+

Functions for working with the discrete-continuous EGM (DCEGM) algorithm as +described in “The endogenous grid method for discrete-continuous dynamic +choice models with (or without) taste shocks” by Iskhakov et al. (2016) +[https://doi.org/10.3982/QE643 and ijrsDCEGM2017 in our Zotero]

+

Example can be found in econ-ark/DemARK

+
+
+HARK.dcegm.calc_linear_crossing(x, left_y, right_y)#
+

Computes the intersection between two line segments, defined by two common +x points, and the values of both segments at both x points. The intercept +is only found if it happens between the two x coordinates.

+
+
Parameters:
+
    +
  • x (np.array, length 2) – The two common x coordinates. x[0] < x[1] is assumed

  • +
  • left_y (np.array, length 2) – y values of the two segments at x[0]

  • +
  • right_y (np.array, length 2) – y values of the two segments at x[1]

  • +
+
+
Returns:
+

    +
  • (m_int, v_int) (a tuple with the corrdinates of the intercept.)

  • +
  • if there is no intercept in the interval [x[0],x[1]], (nan,nan)

  • +
+

+
+
+
+ +
+
+HARK.dcegm.calc_cross_points(x_grid, cond_ys, opt_idx)#
+

Given a grid of x values, a matrix with the values of different line segments +evaluated on the x grid, and a vector indicating the choice of a segment +at each grid point, this function computes the coordinates of the +crossing points that happen when the choice of segment changes.

+

The purpose of the function is to take (x,y) lines that are defined piece- +wise, and at every gap in x where the “piece” changes, find the point where +the two “pieces” involved in the change would intercept.

+

Adding these points to our piece-wise approximation will improve it, since +it will eliminate interpolation between points that belong to different +“pieces”.

+
+
Parameters:
+
    +
  • x_grid (np.array) – Grid of x values.

  • +
  • cond_ys (2-D np.array. Must have as many rows as possible segments, and) – len(x_grid) columns. +cond_ys[i,j] contains the value of segment (or “piece”) i at x_grid[j]. +Entries can be nan if the segment is not defined at a particular point.

  • +
  • opt_idx (np.array of indices, must have length len(x_grid).) – Indicates what segment is to be used at each x gridpoint. The value +of the piecewise function at x_grid[k] is cond_ys[opt_idx[k],k].

  • +
+
+
Returns:
+

    +
  • xing_points (2D np.array) – Crossing points, each in its own row as an [x, y] pair.

  • +
  • segments (np.array with two columns and as many rows as xing points.) – Each row represents a crossing point. The first column is the index +of the segment used to the left, and the second, to the right.

  • +
+

+
+
+
+ +
+
+HARK.dcegm.calc_nondecreasing_segments(x, y)#
+

Given a sequence of (x,y) points, this function finds the start and end +indices of its largest non-decreasing segments.

+

A non-decreasing segment is a sub-sequence of points +{(x_0, y_0),…,(x_n,y_n)} such that for all 0 <= i,j <= n, +If j>=i then x_j >= x_i and y_j >= y_i

+
+
Parameters:
+
    +
  • x (1D np.array of floats) – x coordinates of the sequence of points.

  • +
  • y (1D np.array of floats) – y coordinates of the sequence of points.

  • +
+
+
Returns:
+

    +
  • starts (1D np.array of ints) – Indices where a new non-decreasing segment starts.

  • +
  • ends (1D np.array of ints) – Indices where a non-decreasing segment ends.

  • +
+

+
+
+
+ +
+
+HARK.dcegm.upper_envelope(segments, calc_crossings=True)#
+

Finds the upper envelope of a list of non-decreasing segments

+
+
Parameters:
+
    +
  • segments (list of segments. Segments are tuples of arrays, with item[0]) – containing the x coordninates and item[1] the y coordinates of the +points that confrom the segment item.

  • +
  • calc_crossings (Bool, optional) – Indicates whether the crossing points at which the “upper” segment +changes should be computed. The default is True.

  • +
+
+
Returns:
+

    +
  • x (np.array of floats) – x coordinates of the points that conform the upper envelope.

  • +
  • y (np.array of floats) – y coordinates of the points that conform the upper envelope.

  • +
  • env_inds (np array of ints) – Array of the same length as x and y. It indicates which of the +provided segments is the “upper” one at every returned (x,y) point.

  • +
+

+
+
+
+ +
+ + +
+ + + + + + + +
+ + + + + + + +
+ + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/Documentation/reference/tools/distribution.html b/Documentation/reference/tools/distribution.html new file mode 100644 index 000000000..94ea5914f --- /dev/null +++ b/Documentation/reference/tools/distribution.html @@ -0,0 +1,1552 @@ + + + + + + + + + + + Distribution — HARK latest documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+
+ + + + +
+ + + + + + + + + + + + + +
+ +
+ + +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ +
+

Distribution#

+
+
+class HARK.distributions.DiscreteDistribution(pmv: ndarray, atoms: ndarray, seed: int = 0, limit: Dict[str, Any] | None = None)#
+

Bases: Distribution

+

A representation of a discrete probability distribution.

+
+
Parameters:
+
    +
  • pmv (np.array) – An array of floats representing a probability mass function.

  • +
  • atoms (np.array) – Discrete point values for each probability mass. +For multivariate distributions, the last dimension of atoms must index +“atom” or the random realization. For instance, if atoms.shape == (2,6,4), +the random variable has 4 possible realizations and each of them has shape (2,6).

  • +
  • seed (int) – Seed for random number generator.

  • +
+
+
+
+
+dim() int#
+

Last dimension of self.atoms indexes “atom.”

+
+ +
+
+draw_events(N: int) ndarray#
+

Draws N ‘events’ from the distribution PMF. +These events are indices into atoms.

+
+ +
+
+draw(N: int, atoms: None | int | ndarray = None, exact_match: bool = False) ndarray#
+

Simulates N draws from a discrete distribution with probabilities P and outcomes atoms.

+
+
Parameters:
+
    +
  • N (int) – Number of draws to simulate.

  • +
  • atoms (None, int, or np.array) – If None, then use this distribution’s atoms for point values. +If an int, then the index of atoms for the point values. +If an np.array, use the array for the point values.

  • +
  • exact_match (boolean) – Whether the draws should “exactly” match the discrete distribution (as +closely as possible given finite draws). When True, returned draws are +a random permutation of the N-length list that best fits the discrete +distribution. When False (default), each draw is independent from the +others and the result could deviate from the input.

  • +
+
+
Returns:
+

draws – An array of draws from the discrete distribution; each element is a value in atoms.

+
+
Return type:
+

np.array

+
+
+
+ +
+
+expected(func: Callable | None = None, *args: ndarray) ndarray#
+

Expected value of a function, given an array of configurations of its +inputs along with a DiscreteDistribution object that specifies the +probability of each configuration.

+

If no function is provided, it’s much faster to go straight to dot +product instead of calling the dummy function.

+

If a function is provided, we need to add one more dimension, +the atom dimension, to any inputs that are n-dim arrays. +This allows numpy to easily broadcast the function’s output. +For more information on broadcasting, see: +https://numpy.org/doc/stable/user/basics.broadcasting.html#general-broadcasting-rules

+
+
Parameters:
+
    +
  • func (function) – The function to be evaluated. +This function should take the full array of distribution values +and return either arrays of arbitrary shape or scalars. +It may also take other arguments *args. +This function differs from the standalone calc_expectation +method in that it uses numpy’s vectorization and broadcasting +rules to avoid costly iteration. +Note: If you need to use a function that acts on single outcomes +of the distribution, consider distribution.calc_expectation.

  • +
  • *args – Other inputs for func, representing the non-stochastic arguments. +The the expectation is computed at f(dstn, *args).

  • +
+
+
Returns:
+

f_exp – The expectation of the function at the queried values. +Scalar if only one value.

+
+
Return type:
+

np.array or scalar

+
+
+
+ +
+
+dist_of_func(func: ~typing.Callable[[...], float] = <function DiscreteDistribution.<lambda>>, *args: ~typing.Any) DiscreteDistribution#
+

Finds the distribution of a random variable Y that is a function +of discrete random variable atoms, Y=f(atoms).

+
+
Parameters:
+
    +
  • func (function) – The function to be evaluated. +This function should take the full array of distribution values. +It may also take other arguments *args.

  • +
  • *args – Additional non-stochastic arguments for func, +The function is computed as f(dstn, *args).

  • +
+
+
Returns:
+

f_dstn – The distribution of func(dstn).

+
+
Return type:
+

DiscreteDistribution

+
+
+
+ +
+
+discretize(N: int, *args: Any, **kwargs: Any) DiscreteDistribution#
+

DiscreteDistribution is already an approximation, so this method +returns a copy of the distribution.

+

TODO: print warning message?

+
+ +
+
+make_univariate(dim_to_keep, seed=0)#
+

Make a univariate discrete distribution from this distribution, keeping +only the specified dimension.

+
+
Parameters:
+
    +
  • dim_to_keep (int) – Index of the distribution to be kept. Any other dimensions will be +“collapsed” into the univariate atoms, combining probabilities.

  • +
  • seed (int, optional) – Seed for random number generator of univariate distribution

  • +
+
+
Returns:
+

univariate_dstn – Univariate distribution with only the specified index.

+
+
Return type:
+

DiscreteDistribution

+
+
+
+ +
+ +
+
+class HARK.distributions.DiscreteDistributionLabeled(pmv: ndarray, atoms: ndarray, seed: int = 0, limit: Dict[str, Any] | None = None, name: str = 'DiscreteDistributionLabeled', attrs: Dict[str, Any] | None = None, var_names: List[str] | None = None, var_attrs: List[Dict[str, Any] | None] | None = None)#
+

Bases: DiscreteDistribution

+

A representation of a discrete probability distribution +stored in an underlying xarray.Dataset.

+
+
Parameters:
+
    +
  • pmv (np.array) – An array of values representing a probability mass function.

  • +
  • data (np.array) – Discrete point values for each probability mass. +For multivariate distributions, the last dimension of atoms must index +“atom” or the random realization. For instance, if atoms.shape == (2,6,4), +the random variable has 4 possible realizations and each of them has shape (2,6).

  • +
  • seed (int) – Seed for random number generator.

  • +
  • name (str) – Name of the distribution.

  • +
  • attrs (dict) – Attributes for the distribution.

  • +
  • var_names (list of str) – Names of the variables in the distribution.

  • +
  • var_attrs (list of dict) – Attributes of the variables in the distribution.

  • +
+
+
+
+
+classmethod from_unlabeled(dist, name='DiscreteDistributionLabeled', attrs=None, var_names=None, var_attrs=None)#
+
+ +
+
+classmethod from_dataset(x_obj, pmf)#
+
+ +
+
+property variables#
+

A dict-like container of DataArrays corresponding to +the variables of the distribution.

+
+ +
+
+property name#
+

The distribution’s name.

+
+ +
+
+property attrs#
+

The distribution’s attributes.

+
+ +
+
+dist_of_func(func: ~typing.Callable = <function DiscreteDistributionLabeled.<lambda>>, *args, **kwargs) DiscreteDistribution#
+

Finds the distribution of a random variable Y that is a function +of discrete random variable atoms, Y=f(atoms).

+
+
Parameters:
+
    +
  • func (function) – The function to be evaluated. +This function should take the full array of distribution values. +It may also take other arguments *args.

  • +
  • *args – Additional non-stochastic arguments for func, +The function is computed as f(dstn, *args).

  • +
  • **kwargs – Additional keyword arguments for func. Must be xarray compatible +in order to work with xarray broadcasting.

  • +
+
+
Returns:
+

f_dstn – The distribution of func(dstn).

+
+
Return type:
+

DiscreteDistribution or DiscreteDistributionLabeled

+
+
+
+ +
+
+expected(func: Callable | None = None, *args: Any, **kwargs: Any) float | ndarray#
+

Expectation of a function, given an array of configurations of its inputs +along with a DiscreteDistributionLabeled object that specifies the probability +of each configuration.

+
+
Parameters:
+
    +
  • func (function) – The function to be evaluated. +This function should take the full array of distribution values +and return either arrays of arbitrary shape or scalars. +It may also take other arguments *args. +This function differs from the standalone calc_expectation +method in that it uses numpy’s vectorization and broadcasting +rules to avoid costly iteration. +Note: If you need to use a function that acts on single outcomes +of the distribution, consider distribution.calc_expectation.

  • +
  • *args – Other inputs for func, representing the non-stochastic arguments. +The the expectation is computed at f(dstn, *args).

  • +
  • labels (bool) – If True, the function should use labeled indexing instead of integer +indexing using the distribution’s underlying rv coordinates. For example, +if dims = (‘rv’, ‘x’) and coords = {‘rv’: [‘a’, ‘b’], }, then +the function can be lambda x: x[“a”] + x[“b”].

  • +
+
+
Returns:
+

f_exp – The expectation of the function at the queried values. +Scalar if only one value.

+
+
Return type:
+

np.array or scalar

+
+
+
+ +
+ +
+
+class HARK.distributions.Distribution(seed: int | None = 0)#
+

Bases: object

+

Base class for all probability distributions +with seed and random number generator.

+

For discussion on random number generation and random seeds, see +https://docs.scipy.org/doc/scipy/tutorial/stats.html#random-number-generation

+
+
Parameters:
+

seed (Optional[int]) – Seed for random number generator.

+
+
+
+
+property seed: int#
+

Seed for random number generator.

+
+
Returns:
+

Seed.

+
+
Return type:
+

int

+
+
+
+ +
+
+reset() None#
+

Reset the random number generator of this distribution. +Resetting the seed will result in the same sequence of +random numbers being generated.

+
+ +
+
+random_seed() None#
+

Generate a new random seed for this distribution.

+
+ +
+
+draw(N: int) ndarray#
+

Generate arrays of draws from this distribution. +If input N is a number, output is a length N array of draws from the +distribution. If N is a list, output is a length T list whose +t-th entry is a length N array of draws from the distribution[t].

+
+
Parameters:
+
    +
  • N (int) – Number of draws in each row.

  • +
  • Returns

  • +
  • ------------

  • +
  • draws (np.array or [np.array]) – T-length list of arrays of random variable draws each of size n, or +a single array of size N (if sigma is a scalar).

  • +
+
+
+
+ +
+
+discretize(N: int, method: str = 'equiprobable', endpoints: bool = False, **kwds: Any) DiscreteDistribution#
+

Discretize the distribution into N points using the specified method.

+
+
Parameters:
+
    +
  • N (int) – Number of points in the discretization.

  • +
  • method (str, optional) – Method for discretization, by default “equiprobable”

  • +
  • endpoints (bool, optional) – Whether to include endpoints in the discretization, by default False

  • +
+
+
Returns:
+

Discretized distribution.

+
+
Return type:
+

DiscreteDistribution

+
+
Raises:
+

NotImplementedError – If method is not implemented for this distribution.

+
+
+
+ +
+ +
+
+class HARK.distributions.IndexDistribution(engine, conditional, RNG=None, seed=0)#
+

Bases: Distribution

+

This class provides a way to define a distribution that +is conditional on an index.

+

The current implementation combines a defined distribution +class (such as Bernoulli, LogNormal, etc.) with information +about the conditions on the parameters of the distribution.

+

For example, an IndexDistribution can be defined as +a Bernoulli distribution whose parameter p is a function of +a different input parameter.

+
+
Parameters:
+
    +
  • engine (Distribution class) – A Distribution subclass.

  • +
  • conditional (dict) – Information about the conditional variation +on the input parameters of the engine distribution. +Keys should match the arguments to the engine class +constructor.

  • +
  • seed (int) – Seed for random number generator.

  • +
+
+
+
+
+conditional = None#
+
+ +
+
+engine = None#
+
+ +
+
+discretize(N, **kwds)#
+

Approximation of the distribution.

+
+
Parameters:
+
    +
  • N (init) – Number of discrete points to approximate +continuous distribution into.

  • +
  • kwds (dict) – Other keyword arguments passed to engine +distribution approx() method.

  • +
  • Returns

  • +
  • ------------

  • +
  • dists ([DiscreteDistribution]) –

    A list of DiscreteDistributions that are the +approximation of engine distribution under each condition.

    +

    TODO: It would be better if there were a conditional discrete +distribution representation. But that integrates with the +solution code. This implementation will return the list of +distributions representations expected by the solution code.

    +

  • +
+
+
+
+ +
+
+draw(condition)#
+

Generate arrays of draws. +The input is an array containing the conditions. +The output is an array of the same length (axis 1 dimension) +as the conditions containing random draws of the conditional +distribution.

+
+
Parameters:
+
    +
  • condition (np.array) – The input conditions to the distribution.

  • +
  • Returns

  • +
  • ------------

  • +
  • draws (np.array)

  • +
+
+
+
+ +
+ +
+
+class HARK.distributions.TimeVaryingDiscreteDistribution(distributions, seed=0)#
+

Bases: Distribution

+

This class provides a way to define a discrete distribution that +is conditional on an index.

+

Wraps a list of discrete distributions.

+
+
Parameters:
+
    +
  • distributions ([DiscreteDistribution]) – A list of discrete distributions

  • +
  • seed (int) – Seed for random number generator.

  • +
+
+
+
+
+distributions = []#
+
+ +
+
+draw(condition)#
+

Generate arrays of draws. +The input is an array containing the conditions. +The output is an array of the same length (axis 1 dimension) +as the conditions containing random draws of the conditional +distribution.

+
+
Parameters:
+
    +
  • condition (np.array) – The input conditions to the distribution.

  • +
  • Returns

  • +
  • ------------

  • +
  • draws (np.array)

  • +
+
+
+
+ +
+ +
+
+class HARK.distributions.Lognormal(mu: float | ndarray = 0.0, sigma: float | ndarray = 1.0, seed: int | None = 0, mean=None, std=None)#
+

Bases: ContinuousFrozenDistribution

+

A Lognormal distribution

+
+
Parameters:
+
    +
  • mu (float or [float]) – One or more means of underlying normal distribution. +Number of elements T in mu determines number of rows of output.

  • +
  • sigma (float or [float]) – One or more standard deviations of underlying normal distribution. +Number of elements T in sigma determines number of rows of output.

  • +
  • seed (int) – Seed for random number generator.

  • +
+
+
+
+
+classmethod from_mean_std(mean, std, seed=0)#
+

Construct a LogNormal distribution from its +mean and standard deviation.

+

This is unlike the normal constructor for the distribution, +which takes the mu and sigma for the normal distribution +that is the logarithm of the Log Normal distribution.

+
+
Parameters:
+
    +
  • mean (float or [float]) – One or more means. Number of elements T in mu determines number +of rows of output.

  • +
  • std (float or [float]) – One or more standard deviations. Number of elements T in sigma +determines number of rows of output.

  • +
  • seed (int) – Seed for random number generator.

  • +
+
+
Return type:
+

LogNormal

+
+
+
+ +
+ +
+
+class HARK.distributions.MeanOneLogNormal(mu: float | ndarray = 0.0, sigma: float | ndarray = 1.0, seed: int | None = 0, mean=None, std=None)#
+

Bases: Lognormal

+

A Lognormal distribution with mean 1.

+
+ +
+
+class HARK.distributions.Normal(mu=0.0, sigma=1.0, seed=0)#
+

Bases: ContinuousFrozenDistribution

+

A Normal distribution.

+
+
Parameters:
+
    +
  • mu (float or [float]) – One or more means. Number of elements T in mu determines number +of rows of output.

  • +
  • sigma (float or [float]) – One or more standard deviations. Number of elements T in sigma +determines number of rows of output.

  • +
  • seed (int) – Seed for random number generator.

  • +
+
+
+
+
+discretize(N, method='hermite', endpoints=False)#
+

For normal distributions, the Gauss-Hermite quadrature rule is +used as the default method for discretization.

+
+ +
+ +
+
+class HARK.distributions.Weibull(scale=1.0, shape=1.0, seed=0)#
+

Bases: ContinuousFrozenDistribution

+

A Weibull distribution.

+
+
Parameters:
+
    +
  • scale (float or [float]) – One or more scales. Number of elements T in scale +determines number of +rows of output.

  • +
  • shape (float or [float]) – One or more shape parameters. Number of elements T in scale +determines number of rows of output.

  • +
  • seed (int) – Seed for random number generator.

  • +
+
+
+
+ +
+
+class HARK.distributions.Bernoulli(p=0.5, seed=0)#
+

Bases: DiscreteFrozenDistribution

+

A Bernoulli distribution.

+
+
Parameters:
+
    +
  • p (float or [float]) – Probability or probabilities of the event occurring (True).

  • +
  • seed (int) – Seed for random number generator.

  • +
+
+
+
+ +
+
+class HARK.distributions.MVLogNormal(mu: List | ndarray = [0.0, 0.0], Sigma: List | ndarray = [[1.0, 0.0], [0.0, 1.0]], seed=None)#
+

Bases: multi_rv_frozen, Distribution

+

A Multivariate Lognormal distribution.

+
+
Parameters:
+
    +
  • mu (Union[list, numpy.ndarray], optional) – Means of underlying multivariate normal, default [0.0, 0.0].

  • +
  • Sigma (Union[list, numpy.ndarray], optional) – nxn variance-covariance matrix of underlying multivariate normal, default [[1.0, 0.0], [0.0, 1.0]].

  • +
  • seed (int, optional) – Seed for random number generator, default 0.

  • +
+
+
+
+
+mean()#
+

Mean of the distribution.

+
+
Returns:
+

Mean of the distribution.

+
+
Return type:
+

np.ndarray

+
+
+
+ +
+
+rvs(size: int = 1, random_state=None)#
+

Random sample from the distribution.

+
+
Parameters:
+
    +
  • size (int) – Number of data points to generate.

  • +
  • random_state (optional) – Seed for random number generator.

  • +
+
+
Returns:
+

Random sample from the distribution.

+
+
Return type:
+

np.ndarray

+
+
+
+ +
+ +
+
+class HARK.distributions.MVNormal(mu=[1, 1], Sigma=[[1, 0], [0, 1]], seed=0)#
+

Bases: multivariate_normal_frozen, Distribution

+

A Multivariate Normal distribution.

+
+
Parameters:
+
    +
  • mu (numpy array) – Mean vector.

  • +
  • Sigma (2-d numpy array. Each dimension must have length equal to that of) – mu. +Variance-covariance matrix.

  • +
  • seed (int) – Seed for random number generator.

  • +
+
+
+
+
+discretize(N, method='hermite', endpoints=False)#
+

For multivariate normal distributions, the Gauss-Hermite +quadrature rule is used as the default method for discretization.

+
+ +
+ +
+
+HARK.distributions.approx_beta(N, a=1.0, b=1.0)#
+

Calculate a discrete approximation to the beta distribution. May be quite +slow, as it uses a rudimentary numeric integration method to generate the +discrete approximation.

+
+
Parameters:
+
    +
  • N (int) – Size of discrete space vector to be returned.

  • +
  • a (float) – First shape parameter (sometimes called alpha).

  • +
  • b (float) – Second shape parameter (sometimes called beta).

  • +
+
+
Returns:
+

d – Probability associated with each point in array of discrete +points for discrete probability mass function.

+
+
Return type:
+

DiscreteDistribution

+
+
+
+ +
+
+HARK.distributions.approx_lognormal_gauss_hermite(N, mu=0.0, sigma=1.0, seed=0)#
+
+ +
+
+HARK.distributions.calc_expectation(dstn, func=<function <lambda>>, *args)#
+

Expectation of a function, given an array of configurations of its inputs +along with a DiscreteDistribution object that specifies the probability +of each configuration.

+
+
Parameters:
+
    +
  • dstn (DiscreteDistribution) – The distribution over which the function is to be evaluated.

  • +
  • func (function) – The function to be evaluated. +This function should take an array of shape dstn.dim() and return +either arrays of arbitrary shape or scalars. +It may also take other arguments *args.

  • +
  • *args – Other inputs for func, representing the non-stochastic arguments. +The the expectation is computed at f(dstn, *args).

  • +
+
+
Returns:
+

f_exp – The expectation of the function at the queried values. +Scalar if only one value.

+
+
Return type:
+

np.array or scalar

+
+
+
+ +
+
+HARK.distributions.calc_lognormal_style_pars_from_normal_pars(mu_normal, std_normal)#
+
+ +
+
+HARK.distributions.calc_normal_style_pars_from_lognormal_pars(avg_lognormal, std_lognormal)#
+
+ +
+
+HARK.distributions.combine_indep_dstns(*distributions, seed=0)#
+

Given n independent vector-valued discrete distributions, construct their joint discrete distribution. +Can take multivariate discrete distributions as inputs.

+
+
Parameters:
+

distributions (DiscreteDistribution) – Arbitrary number of discrete distributions to combine. Their realizations must be +vector-valued (for each D in distributions, it must be the case that len(D.dim())==1).

+
+
Returns:
+

    +
  • A DiscreteDistribution representing the joint distribution of the given

  • +
  • random variables.

  • +
+

+
+
+
+ +
+
+HARK.distributions.distr_of_function(dstn, func=<function <lambda>>, *args)#
+

Finds the distribution of a random variable Y that is a function +of discrete random variable atoms, Y=f(atoms).

+
+
Parameters:
+
    +
  • dstn (DiscreteDistribution) – The distribution over which the function is to be evaluated.

  • +
  • func (function) – The function to be evaluated. +This function should take an array of shape dstn.dim(). +It may also take other arguments *args.

  • +
  • *args – Additional non-stochastic arguments for func, +The function is computed at f(dstn, *args).

  • +
+
+
Returns:
+

f_dstn – The distribution of func(dstn).

+
+
Return type:
+

DiscreteDistribution

+
+
+
+ +
+
+HARK.distributions.expected(func=None, dist=None, args=(), **kwargs)#
+

Expectation of a function, given an array of configurations of its inputs +along with a DiscreteDistribution(atomsRA) object that specifies the probability +of each configuration.

+
+
Parameters:
+
    +
  • func (function) – The function to be evaluated. +This function should take the full array of distribution values +and return either arrays of arbitrary shape or scalars. +It may also take other arguments *args. +This function differs from the standalone calc_expectation +method in that it uses numpy’s vectorization and broadcasting +rules to avoid costly iteration. +Note: If you need to use a function that acts on single outcomes +of the distribution, consier distribution.calc_expectation.

  • +
  • dist (DiscreteDistribution or DiscreteDistributionLabeled) – The distribution over which the function is to be evaluated.

  • +
  • args (tuple) – Other inputs for func, representing the non-stochastic arguments. +The the expectation is computed at f(dstn, *args).

  • +
  • labels (bool) – If True, the function should use labeled indexing instead of integer +indexing using the distribution’s underlying rv coordinates. For example, +if dims = (‘rv’, ‘x’) and coords = {‘rv’: [‘a’, ‘b’], }, then +the function can be lambda x: x[“a”] + x[“b”].

  • +
+
+
Returns:
+

f_exp – The expectation of the function at the queried values. +Scalar if only one value.

+
+
Return type:
+

np.array or scalar

+
+
+
+ +
+
+class HARK.distributions.Uniform(bot=0.0, top=1.0, seed=0)#
+

Bases: ContinuousFrozenDistribution

+

A Uniform distribution.

+
+
Parameters:
+
    +
  • bot (float or [float]) – One or more bottom values. +Number of elements T in mu determines number +of rows of output.

  • +
  • top (float or [float]) – One or more top values. +Number of elements T in top determines number of +rows of output.

  • +
  • seed (int) – Seed for random number generator.

  • +
+
+
+
+ +
+
+class HARK.distributions.MarkovProcess(transition_matrix, seed=0)#
+

Bases: Distribution

+

A representation of a discrete Markov process.

+
+
Parameters:
+
    +
  • transition_matrix (np.array) – An array of floats representing a probability mass for +each state transition.

  • +
  • seed (int) – Seed for random number generator.

  • +
+
+
+
+
+transition_matrix = None#
+
+ +
+
+draw(state)#
+

Draw new states fromt the transition matrix.

+
+
Parameters:
+

state (int or nd.array) – The state or states (1-D array) from which to draw new states.

+
+
Returns:
+

new_state – New states.

+
+
Return type:
+

int or nd.array

+
+
+
+ +
+ +
+
+HARK.distributions.add_discrete_outcome_constant_mean(distribution, x, p, sort=False)#
+

Adds a discrete outcome of x with probability p to an existing distribution, +holding constant the relative probabilities of other outcomes and overall mean.

+
+
Parameters:
+
    +
  • distribution (DiscreteDistribution) – A one-dimensional DiscreteDistribution.

  • +
  • x (float) – The new value to be added to the distribution.

  • +
  • p (float) – The probability of the discrete outcome x occuring.

  • +
  • sort (bool) – Whether or not to sort atoms before returning it

  • +
+
+
Returns:
+

d – Probability associated with each point in array of discrete +points for discrete probability mass function.

+
+
Return type:
+

DiscreteDistribution

+
+
+
+ +
+ + +
+ + + + + + + +
+ + + + +
+ + +
+ + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/Documentation/reference/tools/econforgeinterp.html b/Documentation/reference/tools/econforgeinterp.html new file mode 100644 index 000000000..f4d14ad15 --- /dev/null +++ b/Documentation/reference/tools/econforgeinterp.html @@ -0,0 +1,699 @@ + + + + + + + + + + + Econforgeinterp — HARK latest documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+
+ + + + +
+ + + + + + + + + + + + + +
+ +
+ + +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ +
+

Econforgeinterp#

+
+
+class HARK.econforgeinterp.LinearFast(f_val, grids, extrap_mode='linear', prebuilt_grid=None)#
+

Bases: MetricObject

+

A class that constructs and holds all the necessary elements to +call a multilinear interpolator from econforge.interpolator in +a way that resembles the basic interpolators in HARK.interpolation.

+
+
+distance_criteria = ['f_val', 'grid_list']#
+
+ +
+
+gradient(*args)#
+

Evaluates gradient of the interpolator.

+
+
Parameters:
+

args ([numpy.array]) – List of arrays. The i-th entry contains the i-th coordinate +of all the points to be evaluated. All entries must have the +same shape.

+
+
Returns:
+

List of the derivatives of the function with respect to each +input, evaluated at the given points. E.g. if the interpolator +represents 3D function f, f.gradient(x,y,z) will return +[df/dx(x,y,z), df/dy(x,y,z), df/dz(x,y,z)]. Each element has the +shape of items in args.

+
+
Return type:
+

[numpy.array]

+
+
+
+ +
+ +
+
+class HARK.econforgeinterp.DecayInterp(interp, limit_fun, limit_grad=None, extrap_method='decay_prop')#
+

Bases: MetricObject

+

A class of interpolators that use a limiting function +for extrapolation.

+

See HARK/examples/Interpolation/DecayInterp.ipynb for examples of +how to use this class.

+
+
+distance_criteria = ['interp']#
+
+ +
+
+extrap_decay_prop(x, closest_x)#
+

“decay_prop” extrapolation method. Combines the interpolator’s +default extrapolation and the limiting function with weights +that depend on how far from the grid the values are.

+
+
Parameters:
+
    +
  • x (inputs that require extrapolation.)

  • +
  • closest_x (for each of the inputs that require extrapolation, contains) – the closest point that falls inside the grid.

  • +
+
+
+
+ +
+
+extrap_decay_hark(x, closest_x)#
+

“decay_hark” extrapolation method. Takes into account the rate at +which the interpolator and limiting function are approaching at the +edge of the grid for combining them.

+
+
Parameters:
+
    +
  • x (inputs that require extrapolation.)

  • +
  • closest_x (for each of the inputs that require extrapolation, contains) – the closest point that falls inside the grid.

  • +
+
+
+
+ +
+
+extrap_paste(x, closest_x)#
+

“paste” extrapolation method. Uses the limiting function +for extrapolation, but with a vertical shift that “pastes” it +to the interpolator at the edge of the grid.

+
+
Parameters:
+
    +
  • x (inputs that require extrapolation.)

  • +
  • closest_x (for each of the inputs that require extrapolation, contains) – the closest point that falls inside the grid.

  • +
+
+
+
+ +
+ +
+ + +
+ + + + + + + +
+ + + + + + + +
+ + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/Documentation/reference/tools/estimation.html b/Documentation/reference/tools/estimation.html new file mode 100644 index 000000000..652a3d782 --- /dev/null +++ b/Documentation/reference/tools/estimation.html @@ -0,0 +1,722 @@ + + + + + + + + + + + Estimation — HARK latest documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+
+ + + + +
+ + + + + + + + + + + + + +
+ +
+ + +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ +
+

Estimation#

+

Functions for estimating structural models, including optimization methods +and bootstrapping tools.

+
+
+HARK.estimation.minimize_nelder_mead(objective_func, parameter_guess, verbose=False, which_vars=None, **kwargs)#
+

Minimizes the objective function using the Nelder-Mead simplex algorithm, +starting from an initial parameter guess.

+
+
Parameters:
+
    +
  • objective_func (function) – The function to be minimized. It should take only a single argument, which +should be a list representing the parameters to be estimated.

  • +
  • parameter_guess ([float]) – A starting point for the Nelder-Mead algorithm, which must be a valid +input for objective_func.

  • +
  • which_vars (np.array or None) – Array of booleans indicating which parameters should be estimated. When +not provided, estimation is performed on all parameters.

  • +
  • verbose (boolean) – A flag for the amount of output to print.

  • +
+
+
Returns:
+

xopt – The values that minimize objective_func.

+
+
Return type:
+

[float]

+
+
+
+ +
+
+HARK.estimation.minimize_powell(objective_func, parameter_guess, verbose=False)#
+

Minimizes the objective function using a derivative-free Powell algorithm, +starting from an initial parameter guess.

+
+
Parameters:
+
    +
  • objective_func (function) – The function to be minimized. It should take only a single argument, which +should be a list representing the parameters to be estimated.

  • +
  • parameter_guess ([float]) – A starting point for the Powell algorithm, which must be a valid +input for objective_func.

  • +
  • verbose (boolean) – A flag for the amount of output to print.

  • +
+
+
Returns:
+

xopt – The values that minimize objective_func.

+
+
Return type:
+

[float]

+
+
+
+ +
+
+HARK.estimation.bootstrap_sample_from_data(data, weights=None, seed=0)#
+

Samples rows from the input array of data, generating a new data array with +an equal number of rows (records). Rows are drawn with equal probability +by default, but probabilities can be specified with weights (must sum to 1).

+
+
Parameters:
+
    +
  • data (np.array) – An array of data, with each row representing a record.

  • +
  • weights (np.array) – A weighting array with length equal to data.shape[0].

  • +
  • seed (int) – A seed for the random number generator.

  • +
+
+
Returns:
+

new_data – A resampled version of input data.

+
+
Return type:
+

np.array

+
+
+
+ +
+
+HARK.estimation.parallelNelderMead(obj_func, guess, perturb=None, P=1, ftol=1e-06, xtol=1e-08, maxiter=inf, maxeval=inf, r_param=1.0, e_param=1.0, c_param=0.5, s_param=0.5, maxthreads=None, name=None, resume=False, savefreq=None, verbose=1)#
+

A parallel implementation of the Nelder-Mead minimization algorithm, as +described in Lee and Wiswall. For long optimization procedures, it can +save progress between iterations and resume later.

+
+
Parameters:
+
    +
  • obj_func (function) – The objective function to be minimized. Takes a single 1D array as input.

  • +
  • guess (np.array) – Initial starting point for the simplex, representing an input for obj_func.

  • +
  • perturb (np.array) – Perturbation vector for the simplex, of the same length as an input to +obj_func. If perturb[j] is non-zero, a simplex point will be created +that perturbs the j-th element of guess by perturb[j]; if it is zero, +then the j-th parameter of obj_func will not be optimized over. By +default, perturb=None, indicating that all parameters should be optimized, +with an initial perturbation of 0.1*guess.

  • +
  • P (int) – Degree of parallelization: the number of vertices of the simplex to try +to update on each iteration of the process.

  • +
  • ftol (float) – Absolute tolerance of the objective function for convergence. If suc- +cessive iterations return minimum function values that differ by less +than ftol, the process terminates successfully.

  • +
  • xtol (float) – Absolute tolerance of the input values for convergence. If the maximum +distance between the current minimum point and the worst point in the +simplex is less than xtol, then the process terminates successfully.

  • +
  • maxiter (int) – Maximum number of Nelder-Mead iterations; reaching iters=maxiter is +reported as an “unsuccessful” minimization.

  • +
  • maxeval (int) – Maximum number of evaluations of obj_func (across all processes); reaching +evals=maxeval is reported as an “unsuccessful” minimization.

  • +
  • r_param (float) – Parameter indicating magnitude of the reflection point calculation.

  • +
  • e_param (float) – Parameter indicating magnitude of the expansion point calculation.

  • +
  • c_param (float) – Parameter indicating magnitude of the contraction point calculation.

  • +
  • s_param (float) – Parameter indicating magnitude of the shrink calculation.

  • +
  • maxthreads (int) – The maximum number of CPU cores that the optimization should use, +regardless of the size of the problem.

  • +
  • name (string) – A filename for (optionally) saving the progress of the Nelder-Mead search, +and for resuming a previous search (when resume=True). Useful for long +searches that could potentially be interrupted by computer down time.

  • +
  • resume (boolean) – An indicator for whether the search should resume from earlier progress. +When True, the process will load a progress file named in input name.

  • +
  • savefreq (int) – When not None, search progress will be saved to name.txt every savefreq +iterations, to be loaded later with resume=True).

  • +
  • verbose (int) – Indicator for the verbosity of the optimization routine. Higher values +generate more text output; verbose=0 produces no text output.

  • +
+
+
Returns:
+

    +
  • min_point (np.array) – The input that minimizes obj_func, as found by the minimization.

  • +
  • fmin (float) – The minimum of obj_func; fmin = obj_func(min_point).

  • +
+

+
+
+
+ +
+ + +
+ + + + + + + +
+ + + + + + + +
+ + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/Documentation/reference/tools/helpers.html b/Documentation/reference/tools/helpers.html new file mode 100644 index 000000000..1efff6a5e --- /dev/null +++ b/Documentation/reference/tools/helpers.html @@ -0,0 +1,638 @@ + + + + + + + + + + + Helpers — HARK latest documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+
+ + + + +
+ + + + + + + + + + + + + +
+ +
+ + +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ +
+

Helpers#

+

Functions for manipulating the file system or environment.

+
+
+HARK.helpers.copy_module(target_path, my_directory_full_path, my_module)#
+

Helper function for copy_module_to_local(). Provides the actual copy +functionality, with highly cautious safeguards against copying over +important things.

+
+
Parameters:
+
    +
  • target_path (string) – String, file path to target location

  • +
  • my_directory_full_path (string) – String, full pathname to this file’s directory

  • +
  • my_module (string) – String, name of the module to copy

  • +
+
+
Return type:
+

none

+
+
+
+ +
+
+HARK.helpers.print_helper()#
+
+ +
+
+HARK.helpers.copy_module_to_local(full_module_name)#
+

This function contains simple code to copy a submodule to a location on +your hard drive, as specified by you. The purpose of this code is to provide +users with a simple way to access a copy of code that usually sits deep in +the Econ-ARK package structure, for purposes of tinkering and experimenting +directly. This is meant to be a simple way to explore HARK code. To interact +with the codebase under active development, please refer to the documentation +under github.com/econ-ark/HARK/

+

To execute, do the following on the Python command line:

+
+

from HARK.core import copy_module_to_local +copy_module_to_local(“FULL-HARK-MODULE-NAME-HERE”)

+
+

For example, if you want SolvingMicroDSOPs you would enter

+
+

from HARK.core import copy_module_to_local +copy_module_to_local(“HARK.SolvingMicroDSOPs”)

+
+
+ +
+ + +
+ + + + + + + +
+ + + + +
+ + +
+ + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/Documentation/reference/tools/incomeprocess.html b/Documentation/reference/tools/incomeprocess.html new file mode 100644 index 000000000..4ab80f532 --- /dev/null +++ b/Documentation/reference/tools/incomeprocess.html @@ -0,0 +1,1275 @@ + + + + + + + + + + + Calibration — HARK latest documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+
+ + + + +
+ + + + + + + + + + + + + +
+ +
+ + +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ +
+

Calibration#

+

This file has various classes and functions for constructing income processes.

+
+
+class HARK.Calibration.Income.IncomeProcesses.BinaryIncShkDstn(shk_prob, shk_val, seed=0)#
+

Bases: DiscreteDistribution

+

A one period income shock distribution (transitory, permanent, or other) +with only two outcomes. One probability and value are specified, and the +other is implied to make it a mean one distribution.

+
+
Parameters:
+
    +
  • shk_prob (float) – Probability of one of the income shock outcomes.

  • +
  • shk_val (float) – Value of the specified income shock outcome.

  • +
  • seed (int, optional) – Random seed. The default is 0.

  • +
+
+
Returns:
+

ShkDstn – Binary income shock distribuion.

+
+
Return type:
+

DiscreteDistribution

+
+
+
+ +
+
+class HARK.Calibration.Income.IncomeProcesses.LognormPermIncShk(sigma, n_approx, neutral_measure=False, seed=0)#
+

Bases: DiscreteDistribution

+

A one-period distribution of a multiplicative lognormal permanent income shock. +:param sigma: Standard deviation of the log-shock. +:type sigma: float +:param n_approx: Number of points to use in the discrete approximation. +:type n_approx: int +:param neutral_measure: Whether to use Harmenberg’s permanent-income-neutral measure. The default is False. +:type neutral_measure: Bool, optional +:param seed: Random seed. The default is 0. +:type seed: int, optional

+
+
Returns:
+

PermShkDstn – Permanent income shock distribution.

+
+
Return type:
+

DiscreteDistribution

+
+
+
+ +
+
+class HARK.Calibration.Income.IncomeProcesses.MixtureTranIncShk(sigma, UnempPrb, IncUnemp, n_approx, seed=0)#
+

Bases: DiscreteDistribution

+

A one-period distribution for transitory income shocks that are a mixture +between a log-normal and a single-value unemployment shock.

+
+
Parameters:
+
    +
  • sigma (float) – Standard deviation of the log-shock.

  • +
  • UnempPrb (float) – Probability of the “unemployment” shock.

  • +
  • IncUnemp (float) – Income shock in the “unemployment” state.

  • +
  • n_approx (int) – Number of points to use in the discrete approximation.

  • +
  • seed (int, optional) – Random seed. The default is 0.

  • +
+
+
Returns:
+

TranShkDstn – Transitory income shock distribution.

+
+
Return type:
+

DiscreteDistribution

+
+
+
+ +
+
+class HARK.Calibration.Income.IncomeProcesses.MixtureTranIncShk_HANK(sigma, UnempPrb, IncUnemp, n_approx, wage, labor, tax_rate, seed=0)#
+

Bases: DiscreteDistribution

+

A one-period distribution for transitory income shocks that are a mixture +between a log-normal and a single-value unemployment shock. This version +has additional parameters that makes it useful for HANK models.

+
+
Parameters:
+
    +
  • sigma (float) – Standard deviation of the log-shock.

  • +
  • UnempPrb (float) – Probability of the “unemployment” shock.

  • +
  • IncUnemp (float) – Income shock in the “unemployment” state.

  • +
  • n_approx (int) – Number of points to use in the discrete approximation.

  • +
  • tax_rate (float) – Flat tax rate on labor income.

  • +
  • labor (float) – Intensive margin labor supply.

  • +
  • wage (float) – Wage rate scaling factor.

  • +
  • seed (int, optional) – Random seed. The default is 0.

  • +
+
+
Returns:
+

TranShkDstn – Transitory income shock distribution.

+
+
Return type:
+

DiscreteDistribution

+
+
+
+ +
+
+class HARK.Calibration.Income.IncomeProcesses.BufferStockIncShkDstn(sigma_Perm, sigma_Tran, n_approx_Perm, n_approx_Tran, UnempPrb, IncUnemp, neutral_measure=False, seed=0)#
+

Bases: DiscreteDistributionLabeled

+

A one-period distribution object for the joint distribution of income +shocks (permanent and transitory), as modeled in the Buffer Stock Theory +paper: +- Lognormal, discretized permanent income shocks. +- Transitory shocks that are a mixture of: +- A lognormal distribution in normal times. +- An “unemployment” shock.

+
+
Parameters:
+
    +
  • sigma_Perm (float) – Standard deviation of the log- permanent shock.

  • +
  • sigma_Tran (float) – Standard deviation of the log- transitory shock.

  • +
  • n_approx_Perm (int) – Number of points to use in the discrete approximation of the permanent shock.

  • +
  • n_approx_Tran (int) – Number of points to use in the discrete approximation of the transitory shock.

  • +
  • UnempPrb (float) – Probability of the “unemployment” shock.

  • +
  • IncUnemp (float) – Income shock in the “unemployment” state.

  • +
  • neutral_measure (Bool, optional) – Whether to use Hamenberg’s permanent-income-neutral measure. The default is False.

  • +
  • seed (int, optional) – Random seed. The default is 0.

  • +
+
+
Returns:
+

IncShkDstn – Income shock distribution.

+
+
Return type:
+

DiscreteDistribution

+
+
+
+ +
+
+class HARK.Calibration.Income.IncomeProcesses.IncShkDstn_HANK(sigma_Perm, sigma_Tran, n_approx_Perm, n_approx_Tran, UnempPrb, IncUnemp, tax_rate, labor, wage, neutral_measure=False, seed=0)#
+

Bases: DiscreteDistributionLabeled

+

A one-period distribution object for the joint distribution of income +shocks (permanent and transitory), as modeled in the Buffer Stock Theory +paper: +- Lognormal, discretized permanent income shocks. +- Transitory shocks that are a mixture of: +- A lognormal distribution in normal times. +- An “unemployment” shock.

+

This version has additional features that make it particularly useful for HANK models.

+
+
Parameters:
+
    +
  • sigma_Perm (float) – Standard deviation of the log- permanent shock.

  • +
  • sigma_Tran (float) – Standard deviation of the log- transitory shock.

  • +
  • n_approx_Perm (int) – Number of points to use in the discrete approximation of the permanent shock.

  • +
  • n_approx_Tran (int) – Number of points to use in the discrete approximation of the transitory shock.

  • +
  • UnempPrb (float) – Probability of the “unemployment” shock.

  • +
  • IncUnemp (float) – Income shock in the “unemployment” state.

  • +
  • tax_rate (float) – Flat tax rate on labor income.

  • +
  • labor (float) – Intensive margin labor supply.

  • +
  • wage (float) – Wage rate scaling factor.

  • +
  • neutral_measure (Bool, optional) – Whether to use Harmenberg’s permanent-income-neutral measure. The default is False.

  • +
  • seed (int, optional) – Random seed. The default is 0.

  • +
+
+
Returns:
+

IncShkDstn – Income shock distribution.

+
+
Return type:
+

DiscreteDistribution

+
+
+
+ +
+
+HARK.Calibration.Income.IncomeProcesses.construct_lognormal_income_process_unemployment(T_cycle, PermShkStd, PermShkCount, TranShkStd, TranShkCount, T_retire, UnempPrb, IncUnemp, UnempPrbRet, IncUnempRet, RNG, neutral_measure=False)#
+

Generates a list of discrete approximations to the income process for each +life period, from end of life to beginning of life. Permanent shocks (\(\psi\)) are mean +one lognormally distributed with standard deviation PermShkStd[t] during the +working life, and degenerate at 1 in the retirement period. Transitory shocks (\(\theta\)) +are mean one lognormally distributed with a point mass at IncUnemp with +probability UnempPrb while working; they are mean one with a point mass at +IncUnempRet with probability UnempPrbRet. Retirement occurs +after t=T_retire periods of working.

+
+\[\begin{split}\begin{align*} +\psi_t &\sim \begin{cases} +\exp(\mathcal{N}(-\textbf{PermShkStd}_{t}^{2}/2,\textbf{PermShkStd}_{t}^{2})) & \text{if } t \leq t_{\text{retire}}\\ +1 & \text{if } t > t_{\text{retire}} +\end{cases}\\ +p_{\text{unemp}} & = \begin{cases} +\textbf{UnempPrb} & \text{if } t \leq t_{\text{retire}} \\ +\textbf{UnempPrbRet} & \text{if } t > t_{\text{retire}} \\ +\end{cases}\\ +&\text{if } p > p_{\text{unemp}} \\ +\theta_t &\sim\begin{cases} +\exp(\mathcal{N}(-\textbf{PermShkStd}_{t}^{2}/2-\ln(\frac{1-\textbf{IncUnemp }\textbf{UnempPrb}}{1-\textbf{UnempPrb}}),\textbf{PermShkStd}_{t}^{2})) & \text{if } t\leq t_{\text{retire}}\\ +\frac{1-\textbf{UnempPrbRet }\textbf{IncUnempRet}}{1-\textbf{UnempPrbRet}} & \text{if } t > t_{\text{retire}} \\ +\end{cases}\\ +&\text{otherwise}\\ +\theta_t &\sim\begin{cases} +\textbf{IncUnemp} & \text{if } t\leq t_{\text{retire}}\\ +\textbf{IncUnempRet} & \text{if } t\leq t_{\text{retire}}\\ +\end{cases}\\ +\mathbb{E}[\psi]&=\mathbb{E}[\theta] = 1.\\ +\end{align*}\end{split}\]
+

All time in this function runs forward, from t=0 to t=T

+
+
Parameters:
+
    +
  • PermShkStd ([float]) – List of standard deviations in log permanent income uncertainty during +the agent’s life.

  • +
  • PermShkCount (int) – The number of approximation points to be used in the discrete approximation +to the permanent income shock distribution.

  • +
  • TranShkStd ([float]) – List of standard deviations in log transitory income uncertainty during +the agent’s life.

  • +
  • TranShkCount (int) – The number of approximation points to be used in the discrete approximation +to the permanent income shock distribution.

  • +
  • UnempPrb (float or [float]) – The probability of becoming unemployed during the working period.

  • +
  • UnempPrbRet (float or None) – The probability of not receiving typical retirement income when retired.

  • +
  • T_retire (int) – The index value for the final working period in the agent’s life. +If T_retire <= 0 then there is no retirement.

  • +
  • IncUnemp (float or [float]) – Transitory income received when unemployed.

  • +
  • IncUnempRet (float or None) – Transitory income received while “unemployed” when retired.

  • +
  • T_cycle (int) – Total number of non-terminal periods in the consumer’s sequence of periods.

  • +
  • RNG (np.random.RandomState) – Random number generator for this type.

  • +
  • neutral_measure (bool) – Indicator for whether the permanent-income-neutral measure should be used.

  • +
+
+
Returns:
+

IncShkDstn – A list with T_cycle elements, each of which is a +discrete approximation to the income process in a period.

+
+
Return type:
+

[distribution.Distribution]

+
+
+
+ +
+
+HARK.Calibration.Income.IncomeProcesses.construct_HANK_lognormal_income_process_unemployment(T_cycle, PermShkStd, PermShkCount, TranShkStd, TranShkCount, T_retire, UnempPrb, IncUnemp, UnempPrbRet, IncUnempRet, tax_rate, labor, wage, RNG, neutral_measure=False)#
+

Generates a list of discrete approximations to the income process for each +life period, from end of life to beginning of life. Permanent shocks are mean +one lognormally distributed with standard deviation PermShkStd[t] during the +working life, and degenerate at 1 in the retirement period. Transitory shocks +are mean one lognormally distributed with a point mass at IncUnemp with +probability UnempPrb while working; they are mean one with a point mass at +IncUnempRet with probability UnempPrbRet. Retirement occurs after t=T_retire +periods of working.

+

This version of the function incorporates additional flexibility with respect +to transitory income (continuous labor supply, wage rate, tax rate) and thus +is useful in HANK models (hence the name!).

+

Note 1: All time in this function runs forward, from t=0 to t=T

+

Note 2: All parameters are passed as attributes of the input parameters.

+
+

Parameters (passed as attributes of the input parameters)#

+
+
PermShkStd[float]

List of standard deviations in log permanent income uncertainty during +the agent’s life.

+
+
PermShkCountint

The number of approximation points to be used in the discrete approxima- +tion to the permanent income shock distribution.

+
+
TranShkStd[float]

List of standard deviations in log transitory income uncertainty during +the agent’s life.

+
+
TranShkCountint

The number of approximation points to be used in the discrete approxima- +tion to the permanent income shock distribution.

+
+
UnempPrbfloat or [float]

The probability of becoming unemployed during the working period.

+
+
UnempPrbRetfloat or None

The probability of not receiving typical retirement income when retired.

+
+
T_retireint

The index value for the final working period in the agent’s life. +If T_retire <= 0 then there is no retirement.

+
+
IncUnempfloat or [float]

Transitory income received when unemployed.

+
+
IncUnempRetfloat or None

Transitory income received while “unemployed” when retired.

+
+
tax_rate[float]

List of flat tax rates on labor income, age-varying.

+
+
labor[float]

List of intensive margin labor supply, age-varying.

+
+
wage[float]

List of wage rate scaling factors, age-varying.

+
+
T_cycleint

Total number of non-terminal periods in the consumer’s sequence of periods.

+
+
+
+
returns:
+
    +
  • IncShkDstn ([distribution.Distribution]) – A list with T_cycle elements, each of which is a +discrete approximation to the income process in a period.

  • +
  • PermShkDstn ([[distribution.Distributiony]]) – A list with T_cycle elements, each of which +a discrete approximation to the permanent income shocks.

  • +
  • TranShkDstn ([[distribution.Distribution]]) – A list with T_cycle elements, each of which +a discrete approximation to the transitory income shocks.

  • +
+
+
+
+
+ +
+
+HARK.Calibration.Income.IncomeProcesses.get_PermShkDstn_from_IncShkDstn(IncShkDstn, RNG)#
+
+ +
+
+HARK.Calibration.Income.IncomeProcesses.get_TranShkDstn_from_IncShkDstn(IncShkDstn, RNG)#
+
+ +
+
+HARK.Calibration.Income.IncomeProcesses.get_TranShkGrid_from_TranShkDstn(T_cycle, TranShkDstn)#
+
+ +
+
+HARK.Calibration.Income.IncomeProcesses.make_polynomial_PermGroFac(T_cycle, PermGroFac_coeffs, age_0=0.0, age_step=1.0)#
+

Construct the profile of permanent growth factors by age using polynomial coefficients.

+
+
Parameters:
+
    +
  • T_cycle (int) – Number of non-terminal period’s in this agent’s cycle.

  • +
  • PermGroFac_coeffs ([float]) – Arbitrary length list or 1D vector of polynomial coefficients of age on +permanent income growth factor.

  • +
  • age_0 (float, optional) – Initial age of agents (when t_age=0), with respect to the polynomial coefficients. +The default is 0.

  • +
  • age_step (float, optional) – Age increment in the model, with respect to the polynomial coefficients. +The default is 1.

  • +
+
+
Returns:
+

PermGroFac – List of permanent income growth factors, one per period.

+
+
Return type:
+

[float]

+
+
+
+ +
+
+HARK.Calibration.Income.IncomeProcesses.make_polynomial_PermShkStd(T_cycle, PermShkStd_coeffs, age_0=0.0, age_step=1.0)#
+

Construct the profile of (log) permanent income shock standard deviations by +age using polynomial coefficients.

+
+
Parameters:
+
    +
  • T_cycle (int) – Number of non-terminal period’s in this agent’s cycle.

  • +
  • PermGroFac_coeffs ([float]) – Arbitrary length list or 1D vector of polynomial coefficients of age on +(log) permanent income shock standard deviation.

  • +
  • age_0 (float, optional) – Initial age of agents (when t_age=0), with respect to the polynomial coefficients. +The default is 0.

  • +
  • age_step (float, optional) – Age increment in the model, with respect to the polynomial coefficients. +The default is 1.

  • +
+
+
Returns:
+

PermShkStd – List of (log) permanent income shock standard deviations, one per period.

+
+
Return type:
+

[float]

+
+
+
+ +
+
+HARK.Calibration.Income.IncomeProcesses.make_polynomial_TranShkStd(T_cycle, TranShkStd_coeffs, age_0=0.0, age_step=1.0)#
+

Construct the profile of (log) transitory income shock standard deviations by +age using polynomial coefficients.

+
+
Parameters:
+
    +
  • T_cycle (int) – Number of non-terminal period’s in this agent’s cycle.

  • +
  • PermGroFac_coeffs ([float]) – Arbitrary length list or 1D vector of polynomial coefficients of age on +(log) transitory income shock standard deviation.

  • +
  • age_0 (float, optional) – Initial age of agents (when t_age=0), with respect to the polynomial coefficients. +The default is 0.

  • +
  • age_step (float, optional) – Age increment in the model, with respect to the polynomial coefficients. +The default is 1.

  • +
+
+
Returns:
+

TranShkStd – List of (log) permanent income shock standard deviations, one per period.

+
+
Return type:
+

[float]

+
+
+
+ +
+
+class HARK.Calibration.Income.IncomeProcesses.pLvlFuncAR1(pLogMean, PermGroFac, Corr)#
+

Bases: MetricObject

+

A class for representing AR1-style persistent income growth functions.

+
+
Parameters:
+
    +
  • pLogMean (float) – Log persistent income level toward which we are drawn.

  • +
  • PermGroFac (float) – Autonomous (e.g. life cycle) pLvl growth (does not AR1 decay).

  • +
  • Corr (float) – Correlation coefficient on log income.

  • +
+
+
+
+ +
+
+HARK.Calibration.Income.IncomeProcesses.make_PermGroFac_from_ind_and_agg(PermGroFacInd, PermGroFacAgg)#
+

A very simple function that constructs overall permanent income growth over +the lifecycle as the sum of idiosyncratic productivity growth PermGroFacInd and +aggregate productivity growth PermGroFacAgg. In most HARK models, PermGroFac +is treated as the overall permanent income growth factor, regardless of source. +In applications in which the user has estimated permanent income growth from +cross sectional data, or wants to investigate how a change in aggregate +productivity growth affects behavior or outcomes, this function can be used +as the constructor for PermGroFac.

+

To use this function, specify idiosyncratic productivity growth in the attribute +PermGroFacInd (or construct it), and put this function as the entry for PermGroFac +in the constructors dictionary of your AgentType subclass instances.

+
+
Parameters:
+
    +
  • PermGroFacInd ([float] or np.array) – Lifecycle sequence of idiosyncratic permanent productivity growth factors. +These represent individual-based productivity factors, like experience.

  • +
  • PermGroFacAgg (float) – Constant aggregate permanent growth factor, representing (e.g.) TFP.

  • +
+
+
Returns:
+

PermGroFac – Lifecycle sequence of overall permanent productivity growth factors. +Returns same type as PermGroFacInd.

+
+
Return type:
+

[float] or np.array

+
+
+
+ +
+
+HARK.Calibration.Income.IncomeProcesses.make_trivial_pLvlNextFunc(T_cycle)#
+

A dummy function that creates default trivial permanent income dynamics: +none at all! Simply returns a list of IdentityFunctions, one for each period.

+
+\[G_{t}(x) = x\]
+
+
Parameters:
+

T_cycle (int) – Number of non-terminal periods in the agent’s problem.

+
+
Returns:
+

pLvlNextFunc – List of trivial permanent income dynamic functions.

+
+
Return type:
+

[IdentityFunction]

+
+
+
+ +
+
+HARK.Calibration.Income.IncomeProcesses.make_explicit_perminc_pLvlNextFunc(T_cycle, PermGroFac)#
+

A function that creates permanent income dynamics as a sequence of linear +functions, indicating constant expected permanent income growth across +permanent income levels.

+
+\[G_{t+1} (x) = \Gamma_{t+1} x\]
+
+
Parameters:
+
    +
  • T_cycle (int) – Number of non-terminal periods in the agent’s problem.

  • +
  • PermGroFac ([float]) – List of permanent income growth factors over the agent’s problem.

  • +
+
+
Returns:
+

pLvlNextFunc – List of linear functions representing constant permanent income growth +rate, regardless of current permanent income level.

+
+
Return type:
+

[LinearInterp]

+
+
+
+ +
+
+HARK.Calibration.Income.IncomeProcesses.make_AR1_style_pLvlNextFunc(T_cycle, pLvlInitMean, PermGroFac, PrstIncCorr)#
+

A function that creates permanent income dynamics as a sequence of AR1-style +functions. If cycles=0, the product of PermGroFac across all periods must be +1.0, otherwise this method is invalid.

+
+\[\begin{split}\begin{align} +log(G_{t+1} (x)) &=\varphi log(x) + (1-\varphi) log(\overline{P}_{t})+log(\Gamma_{t+1}) + log(\psi_{t+1}), \\ +\overline{P}_{t+1} &= \overline{P}_{t} \Gamma_{t+1} \\ +\end{align}\end{split}\]
+
+
Parameters:
+
    +
  • T_cycle (int) – Number of non-terminal periods in the agent’s problem.

  • +
  • pLvlInitMean (float) – Mean of log permanent income at initialization.

  • +
  • PermGroFac ([float]) – List of permanent income growth factors over the agent’s problem.

  • +
  • PrstIncCorr (float) – Correlation coefficient on log permanent income today on log permanent +income in the succeeding period.

  • +
+
+
Returns:
+

pLvlNextFunc – List of AR1-style persistent income dynamics functions

+
+
Return type:
+

[pLvlFuncAR1]

+
+
+
+ +
+
+HARK.Calibration.Income.IncomeProcesses.make_basic_pLvlPctiles(pLvlPctiles_count, pLvlPctiles_bound=[0.001, 0.999], pLvlPctiles_tail_count=0, pLvlPctiles_tail_order=2.718281828459045)#
+

Make a relatively basic specification for pLvlPctiles by choosing the number +of uniformly spaced nodes in the “body”, the percentile boundaries for the +body, the number of nodes in each tail, and the order/factor by which the +tail percentiles approach 0 and 1 respectively.

+
+
Parameters:
+
    +
  • pLvlPctile_count (int) – Number of nodes in the “body” of the percentile set.

  • +
  • pLvlPctile_bound ([float,float], optional) – Percentile bounds for the “body” of the set. The default is [0.0, 1.0].

  • +
  • pLvlPctile_tail_count (int, optional) – Number of nodes in each extant tail of the set. The default is 0.

  • +
  • pLvlPctile_tail_order (float, optional) – Factor by which tail percentiles shrink toward 0 and 1. The default is np.e.

  • +
+
+
Returns:
+

pLvlPctiles – Array of percentiles of pLvl, usually used to construct pLvlGrid using +the function below.

+
+
Return type:
+

np.array

+
+
+
+ +
+
+HARK.Calibration.Income.IncomeProcesses.make_pLvlGrid_by_simulation(cycles, T_cycle, PermShkDstn, pLvlNextFunc, LivPrb, pLvlInitMean, pLvlInitStd, pLvlPctiles, pLvlExtra=None)#
+

Construct the permanent income grid for each period of the problem by simulation. +If the model is infinite horizon (cycles=0), an approximation of the long run +steady state distribution of permanent income is used (by simulating many periods). +If the model is lifecycle (cycles=1), explicit simulation is used. In either +case, the input pLvlPctiles is used to choose percentiles from the distribution.

+

If the problem is neither infinite horizon nor lifecycle, this method will fail. +If the problem is infinite horizon, cumprod(PermGroFac) must equal one.

+
+
Parameters:
+
    +
  • cycles (int) – Number of times the sequence of periods happens for the agent; must be 0 or 1.

  • +
  • T_cycle (int) – Number of non-terminal periods in the agent’s problem.

  • +
  • PermShkDstn ([distribution]) – List of permanent shock distributions in each period of the problem.

  • +
  • pLvlNextFunc ([function]) – List of permanent income dynamic functions.

  • +
  • LivPrb ([float]) – List of survival probabilities by period of the cycle. Only used in infinite +horizon specifications.

  • +
  • pLvlInitMean (float) – Mean of log permanent income at initialization.

  • +
  • pLvlInitStd (float) – Standard deviaition of log permanent income at initialization.

  • +
  • pLvlPctiles ([float]) – List or array of percentiles (between 0 and 1) of permanent income to +use for the pLvlGrid.

  • +
  • pLvlExtra (None or [float], optional) – Additional pLvl values to automatically include in pLvlGrid.

  • +
+
+
Returns:
+

pLvlGrid – List of permanent income grids for each period, constructed by simulating +the permanent income process and extracting specified percentiles.

+
+
Return type:
+

[np.array]

+
+
+
+ +

This file contains tools for creating risky asset return distributions, for use +as inputs to several consumption-saving model solvers.

+
+
+HARK.Calibration.Assets.AssetProcesses.make_lognormal_RiskyDstn(T_cycle, RiskyAvg, RiskyStd, RiskyCount, RNG)#
+

Creates a discrete approximation of lognormal risky asset returns, either +as a single distribution or as a lifecycle sequence.

+
+\[\begin{split}\begin{align} +\phi_t &\sim \exp(\mathcal{N}(\textbf{RiskyStd}_{t}^2)) \\ +\mathbb{E}_{t} \left[ \phi_t \right] &= \textbf{RiskyAvg}_{t}\\ +\end{align}\end{split}\]
+
+
Parameters:
+
    +
  • T_cycle (int) – Number of non-terminal periods in this agent’s cycle.

  • +
  • RiskyAvg (float or [float]) – Mean return factor of risky asset. If a single number, it is used for all +periods. If it is a list, then it represents lifecycle returns (or +perceptions thereof).

  • +
  • RiskyStd (float or [float]) – Standard deviation of log returns of the risky asset. Allows the same +options as RiskyAvg.

  • +
  • RiskyCount (int) – Number of equiprobable discrete nodes in the risky return distribution.

  • +
  • RNG (RandomState) – Internal random number generator for the AgentType instance, used to +generate random seeds.

  • +
+
+
Returns:
+

RiskyDstn – Discretized approximation to lognormal asset returns.

+
+
Return type:
+

DiscreteDistribution or [DiscreteDistribution]

+
+
+
+ +
+
+HARK.Calibration.Assets.AssetProcesses.combine_IncShkDstn_and_RiskyDstn(T_cycle, RiskyDstn, IncShkDstn)#
+

Combine the income shock distribution (over PermShk and TranShk) with the +risky return distribution (RiskyDstn) to make a new object called ShockDstn.

+
+
Parameters:
+
    +
  • T_cycle (int) – Number of non-terminal periods in this agent’s cycle.

  • +
  • RiskyDstn (DiscreteDistribution or [DiscreteDistribution]) – Discretized approximation to lognormal asset returns.

  • +
  • IncShkDstn ([Distribution]) – A discrete approximation to the income process between each period.

  • +
+
+
Returns:
+

ShockDstn – A combined trivariate discrete distribution of permanent shocks, transitory +shocks, and risky returns. Has one element per period of the agent’s cycle.

+
+
Return type:
+

IndexDistribution

+
+
+
+ +
+
+HARK.Calibration.Assets.AssetProcesses.calc_ShareLimit_for_CRRA(T_cycle, RiskyDstn, CRRA, Rfree)#
+

Calculates the lower bound on the risky asset share as market resources go +to infinity, given that utility is CRRA.

+
+
Parameters:
+
    +
  • T_cycle (int) – Number of non-terminal periods in this agent’s cycle.

  • +
  • RiskyDstn (DiscreteDistribution or [DiscreteDistribution]) – Discretized approximation to lognormal asset returns.

  • +
  • CRRA (float) – Coefficient of relative risk aversion.

  • +
  • Rfree (float) – Return factor on the risk-free asset.

  • +
+
+
Returns:
+

ShareLimit – Lower bound on risky asset share. Can be a single number or a lifecycle sequence.

+
+
Return type:
+

float or [float]

+
+
+
+ +
+ + +
+ + + + + + + +
+ + + + + + + +
+ + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/Documentation/reference/tools/index.html b/Documentation/reference/tools/index.html new file mode 100644 index 000000000..00ac5420e --- /dev/null +++ b/Documentation/reference/tools/index.html @@ -0,0 +1,502 @@ + + + + + + + + + + + Tools — HARK latest documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+
+ + + + + + +
+ + + + + + + + + + + +
+ +
+ + +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + +
+ +
+
+
+ +
+ + + + +
+ + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/Documentation/reference/tools/interpolation.html b/Documentation/reference/tools/interpolation.html new file mode 100644 index 000000000..2e5f8b015 --- /dev/null +++ b/Documentation/reference/tools/interpolation.html @@ -0,0 +1,2015 @@ + + + + + + + + + + + Interpolation — HARK latest documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+
+ + + + +
+ + + + + + + + + + + + + +
+ +
+ + +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ +
+

Interpolation#

+

Custom interpolation methods for representing approximations to functions. +It also includes wrapper classes to enforce standard methods across classes. +Each interpolation class must have a distance() method that compares itself to +another instance; this is used in HARK.core’s solve() method to check for solution +convergence. The interpolator classes currently in this module inherit their +distance method from MetricObject.

+
+
+class HARK.interpolation.HARKinterpolator1D#
+

Bases: MetricObject

+

A wrapper class for 1D interpolation methods in HARK.

+
+
+distance_criteria = []#
+
+ +
+
+derivative(x)#
+

Evaluates the derivative of the interpolated function at the given input.

+
+
Parameters:
+

x (np.array or float) – Real values to be evaluated in the interpolated function.

+
+
Returns:
+

dydx – The interpolated function’s first derivative evaluated at x: +dydx = f’(x), with the same shape as x.

+
+
Return type:
+

np.array or float

+
+
+
+ +
+
+eval_with_derivative(x)#
+

Evaluates the interpolated function and its derivative at the given input.

+
+
Parameters:
+

x (np.array or float) – Real values to be evaluated in the interpolated function.

+
+
Returns:
+

    +
  • y (np.array or float) – The interpolated function evaluated at x: y = f(x), with the same +shape as x.

  • +
  • dydx (np.array or float) – The interpolated function’s first derivative evaluated at x: +dydx = f’(x), with the same shape as x.

  • +
+

+
+
+
+ +
+ +
+
+class HARK.interpolation.HARKinterpolator2D#
+

Bases: MetricObject

+

A wrapper class for 2D interpolation methods in HARK.

+
+
+distance_criteria = []#
+
+ +
+
+derivativeX(x, y)#
+

Evaluates the partial derivative of interpolated function with respect +to x (the first argument) at the given input.

+
+
Parameters:
+
    +
  • x (np.array or float) – Real values to be evaluated in the interpolated function.

  • +
  • y (np.array or float) – Real values to be evaluated in the interpolated function; must be +the same size as x.

  • +
+
+
Returns:
+

dfdx – The derivative of the interpolated function with respect to x, eval- +uated at x,y: dfdx = f_x(x,y), with the same shape as x and y.

+
+
Return type:
+

np.array or float

+
+
+
+ +
+
+derivativeY(x, y)#
+

Evaluates the partial derivative of interpolated function with respect +to y (the second argument) at the given input.

+
+
Parameters:
+
    +
  • x (np.array or float) – Real values to be evaluated in the interpolated function.

  • +
  • y (np.array or float) – Real values to be evaluated in the interpolated function; must be +the same size as x.

  • +
+
+
Returns:
+

dfdy – The derivative of the interpolated function with respect to y, eval- +uated at x,y: dfdx = f_y(x,y), with the same shape as x and y.

+
+
Return type:
+

np.array or float

+
+
+
+ +
+ +
+
+class HARK.interpolation.HARKinterpolator3D#
+

Bases: MetricObject

+

A wrapper class for 3D interpolation methods in HARK.

+
+
+distance_criteria = []#
+
+ +
+
+derivativeX(x, y, z)#
+

Evaluates the partial derivative of the interpolated function with respect +to x (the first argument) at the given input.

+
+
Parameters:
+
    +
  • x (np.array or float) – Real values to be evaluated in the interpolated function.

  • +
  • y (np.array or float) – Real values to be evaluated in the interpolated function; must be +the same size as x.

  • +
  • z (np.array or float) – Real values to be evaluated in the interpolated function; must be +the same size as x.

  • +
+
+
Returns:
+

dfdx – The derivative with respect to x of the interpolated function evaluated +at x,y,z: dfdx = f_x(x,y,z), with the same shape as x, y, and z.

+
+
Return type:
+

np.array or float

+
+
+
+ +
+
+derivativeY(x, y, z)#
+

Evaluates the partial derivative of the interpolated function with respect +to y (the second argument) at the given input.

+
+
Parameters:
+
    +
  • x (np.array or float) – Real values to be evaluated in the interpolated function.

  • +
  • y (np.array or float) – Real values to be evaluated in the interpolated function; must be +the same size as x.

  • +
  • z (np.array or float) – Real values to be evaluated in the interpolated function; must be +the same size as x.

  • +
+
+
Returns:
+

dfdy – The derivative with respect to y of the interpolated function evaluated +at x,y,z: dfdy = f_y(x,y,z), with the same shape as x, y, and z.

+
+
Return type:
+

np.array or float

+
+
+
+ +
+
+derivativeZ(x, y, z)#
+

Evaluates the partial derivative of the interpolated function with respect +to z (the third argument) at the given input.

+
+
Parameters:
+
    +
  • x (np.array or float) – Real values to be evaluated in the interpolated function.

  • +
  • y (np.array or float) – Real values to be evaluated in the interpolated function; must be +the same size as x.

  • +
  • z (np.array or float) – Real values to be evaluated in the interpolated function; must be +the same size as x.

  • +
+
+
Returns:
+

dfdz – The derivative with respect to z of the interpolated function evaluated +at x,y,z: dfdz = f_z(x,y,z), with the same shape as x, y, and z.

+
+
Return type:
+

np.array or float

+
+
+
+ +
+ +
+
+class HARK.interpolation.HARKinterpolator4D#
+

Bases: MetricObject

+

A wrapper class for 4D interpolation methods in HARK.

+
+
+distance_criteria = []#
+
+ +
+
+derivativeW(w, x, y, z)#
+

Evaluates the partial derivative with respect to w (the first argument) +of the interpolated function at the given input.

+
+
Parameters:
+
    +
  • w (np.array or float) – Real values to be evaluated in the interpolated function.

  • +
  • x (np.array or float) – Real values to be evaluated in the interpolated function; must be +the same size as w.

  • +
  • y (np.array or float) – Real values to be evaluated in the interpolated function; must be +the same size as w.

  • +
  • z (np.array or float) – Real values to be evaluated in the interpolated function; must be +the same size as w.

  • +
+
+
Returns:
+

dfdw – The derivative with respect to w of the interpolated function eval- +uated at w,x,y,z: dfdw = f_w(w,x,y,z), with the same shape as inputs.

+
+
Return type:
+

np.array or float

+
+
+
+ +
+
+derivativeX(w, x, y, z)#
+

Evaluates the partial derivative with respect to x (the second argument) +of the interpolated function at the given input.

+
+
Parameters:
+
    +
  • w (np.array or float) – Real values to be evaluated in the interpolated function.

  • +
  • x (np.array or float) – Real values to be evaluated in the interpolated function; must be +the same size as w.

  • +
  • y (np.array or float) – Real values to be evaluated in the interpolated function; must be +the same size as w.

  • +
  • z (np.array or float) – Real values to be evaluated in the interpolated function; must be +the same size as w.

  • +
+
+
Returns:
+

dfdx – The derivative with respect to x of the interpolated function eval- +uated at w,x,y,z: dfdx = f_x(w,x,y,z), with the same shape as inputs.

+
+
Return type:
+

np.array or float

+
+
+
+ +
+
+derivativeY(w, x, y, z)#
+

Evaluates the partial derivative with respect to y (the third argument) +of the interpolated function at the given input.

+
+
Parameters:
+
    +
  • w (np.array or float) – Real values to be evaluated in the interpolated function.

  • +
  • x (np.array or float) – Real values to be evaluated in the interpolated function; must be +the same size as w.

  • +
  • y (np.array or float) – Real values to be evaluated in the interpolated function; must be +the same size as w.

  • +
  • z (np.array or float) – Real values to be evaluated in the interpolated function; must be +the same size as w.

  • +
+
+
Returns:
+

dfdy – The derivative with respect to y of the interpolated function eval- +uated at w,x,y,z: dfdy = f_y(w,x,y,z), with the same shape as inputs.

+
+
Return type:
+

np.array or float

+
+
+
+ +
+
+derivativeZ(w, x, y, z)#
+

Evaluates the partial derivative with respect to z (the fourth argument) +of the interpolated function at the given input.

+
+
Parameters:
+
    +
  • w (np.array or float) – Real values to be evaluated in the interpolated function.

  • +
  • x (np.array or float) – Real values to be evaluated in the interpolated function; must be +the same size as w.

  • +
  • y (np.array or float) – Real values to be evaluated in the interpolated function; must be +the same size as w.

  • +
  • z (np.array or float) – Real values to be evaluated in the interpolated function; must be +the same size as w.

  • +
+
+
Returns:
+

dfdz – The derivative with respect to z of the interpolated function eval- +uated at w,x,y,z: dfdz = f_z(w,x,y,z), with the same shape as inputs.

+
+
Return type:
+

np.array or float

+
+
+
+ +
+ +
+
+class HARK.interpolation.IdentityFunction(i_dim=0, n_dims=1)#
+

Bases: MetricObject

+

A fairly trivial interpolator that simply returns one of its arguments. Useful for avoiding +numeric error in extreme cases.

+
+
Parameters:
+
    +
  • i_dim (int) – Index of the dimension on which the identity is defined. f(*x) = x[i]

  • +
  • n_dims (int) – Total number of input dimensions for this function.

  • +
+
+
+
+
+distance_criteria = ['i_dim']#
+
+ +
+
+derivative(*args)#
+

Returns the derivative of the function with respect to the first dimension.

+
+ +
+
+derivativeX(*args)#
+

Returns the derivative of the function with respect to the X dimension. +This is the first input whenever n_dims < 4 and the second input otherwise.

+
+ +
+
+derivativeY(*args)#
+

Returns the derivative of the function with respect to the Y dimension. +This is the second input whenever n_dims < 4 and the third input otherwise.

+
+ +
+
+derivativeZ(*args)#
+

Returns the derivative of the function with respect to the Z dimension. +This is the third input whenever n_dims < 4 and the fourth input otherwise.

+
+ +
+
+derivativeW(*args)#
+

Returns the derivative of the function with respect to the W dimension. +This should only exist when n_dims >= 4.

+
+ +
+ +
+
+class HARK.interpolation.ConstantFunction(value)#
+

Bases: MetricObject

+

A class for representing trivial functions that return the same real output for any input. This +is convenient for models where an object might be a (non-trivial) function, but in some variations +that object is just a constant number. Rather than needing to make a (Bi/Tri/Quad)- +LinearInterpolation with trivial state grids and the same f_value in every entry, ConstantFunction +allows the user to quickly make a constant/trivial function. This comes up, e.g., in models +with endogenous pricing of insurance contracts; a contract’s premium might depend on some state +variables of the individual, but in some variations the premium of a contract is just a number.

+
+
Parameters:
+

value (float) – The constant value that the function returns.

+
+
+
+
+convergence_criteria = ['value']#
+
+ +
+
+derivative(*args)#
+

Evaluate the derivative of the function. The first input must exist and should be an array. +Returns an array of identical shape to args[0] (if it exists). This is an array of zeros.

+
+ +
+
+derivativeX(*args)#
+

Evaluate the derivative of the function. The first input must exist and should be an array. +Returns an array of identical shape to args[0] (if it exists). This is an array of zeros.

+
+ +
+
+derivativeY(*args)#
+

Evaluate the derivative of the function. The first input must exist and should be an array. +Returns an array of identical shape to args[0] (if it exists). This is an array of zeros.

+
+ +
+
+derivativeZ(*args)#
+

Evaluate the derivative of the function. The first input must exist and should be an array. +Returns an array of identical shape to args[0] (if it exists). This is an array of zeros.

+
+ +
+
+derivativeW(*args)#
+

Evaluate the derivative of the function. The first input must exist and should be an array. +Returns an array of identical shape to args[0] (if it exists). This is an array of zeros.

+
+ +
+
+derivativeXX(*args)#
+

Evaluate the derivative of the function. The first input must exist and should be an array. +Returns an array of identical shape to args[0] (if it exists). This is an array of zeros.

+
+ +
+ +
+
+class HARK.interpolation.LinearInterp(x_list, y_list, intercept_limit=None, slope_limit=None, lower_extrap=False)#
+

Bases: HARKinterpolator1D

+

A “from scratch” 1D linear interpolation class. Allows for linear or decay +extrapolation (approaching a limiting linear function from below).

+

NOTE: When no input is given for the limiting linear function, linear +extrapolation is used above the highest gridpoint.

+
+
Parameters:
+
    +
  • x_list (np.array) – List of x values composing the grid.

  • +
  • y_list (np.array) – List of y values, representing f(x) at the points in x_list.

  • +
  • intercept_limit (float) – Intercept of limiting linear function.

  • +
  • slope_limit (float) – Slope of limiting linear function.

  • +
  • lower_extrap (boolean) – Indicator for whether lower extrapolation is allowed. False means +f(x) = NaN for x < min(x_list); True means linear extrapolation.

  • +
+
+
+
+
+distance_criteria = ['x_list', 'y_list']#
+
+ +
+ +
+
+class HARK.interpolation.CubicInterp(x_list, y_list, dydx_list, intercept_limit=None, slope_limit=None, lower_extrap=False)#
+

Bases: HARKinterpolator1D

+

An interpolating function using piecewise cubic splines. Matches level and +slope of 1D function at gridpoints, smoothly interpolating in between. +Extrapolation above highest gridpoint approaches a limiting linear function +if desired (linear extrapolation also enabled.)

+
+
NOTE: When no input is given for the limiting linear function, linear

extrapolation is used above the highest gridpoint.

+
+
+
+
Parameters:
+
    +
  • x_list (np.array) – List of x values composing the grid.

  • +
  • y_list (np.array) – List of y values, representing f(x) at the points in x_list.

  • +
  • dydx_list (np.array) – List of dydx values, representing f’(x) at the points in x_list

  • +
  • intercept_limit (float) – Intercept of limiting linear function.

  • +
  • slope_limit (float) – Slope of limiting linear function.

  • +
  • lower_extrap (boolean) – Indicator for whether lower extrapolation is allowed. False means +f(x) = NaN for x < min(x_list); True means linear extrapolation.

  • +
+
+
+
+
+distance_criteria = ['x_list', 'y_list', 'dydx_list']#
+
+ +
+ +
+
+class HARK.interpolation.CubicHermiteInterp(x_list, y_list, dydx_list, intercept_limit=None, slope_limit=None, lower_extrap=False)#
+

Bases: HARKinterpolator1D

+

An interpolating function using piecewise cubic splines. Matches level and +slope of 1D function at gridpoints, smoothly interpolating in between. +Extrapolation above highest gridpoint approaches a limiting linear function +if desired (linear extrapolation also enabled.)

+
+
NOTE: When no input is given for the limiting linear function, linear

extrapolation is used above the highest gridpoint.

+
+
+
+
Parameters:
+
    +
  • x_list (np.array) – List of x values composing the grid.

  • +
  • y_list (np.array) – List of y values, representing f(x) at the points in x_list.

  • +
  • dydx_list (np.array) – List of dydx values, representing f’(x) at the points in x_list

  • +
  • intercept_limit (float) – Intercept of limiting linear function.

  • +
  • slope_limit (float) – Slope of limiting linear function.

  • +
  • lower_extrap (boolean) – Indicator for whether lower extrapolation is allowed. False means +f(x) = NaN for x < min(x_list); True means linear extrapolation.

  • +
+
+
+
+
+distance_criteria = ['x_list', 'y_list', 'dydx_list']#
+
+ +
+
+out_of_bounds(x)#
+
+ +
+ +
+
+class HARK.interpolation.BilinearInterp(f_values, x_list, y_list, xSearchFunc=None, ySearchFunc=None)#
+

Bases: HARKinterpolator2D

+

Bilinear full (or tensor) grid interpolation of a function f(x,y).

+
+
Parameters:
+
    +
  • f_values (numpy.array) – An array of size (x_n,y_n) such that f_values[i,j] = f(x_list[i],y_list[j])

  • +
  • x_list (numpy.array) – An array of x values, with length designated x_n.

  • +
  • y_list (numpy.array) – An array of y values, with length designated y_n.

  • +
  • xSearchFunc (function) – An optional function that returns the reference location for x values: +indices = xSearchFunc(x_list,x). Default is np.searchsorted

  • +
  • ySearchFunc (function) – An optional function that returns the reference location for y values: +indices = ySearchFunc(y_list,y). Default is np.searchsorted

  • +
+
+
+
+
+distance_criteria = ['x_list', 'y_list', 'f_values']#
+
+ +
+ +
+
+class HARK.interpolation.TrilinearInterp(f_values, x_list, y_list, z_list, xSearchFunc=None, ySearchFunc=None, zSearchFunc=None)#
+

Bases: HARKinterpolator3D

+

Trilinear full (or tensor) grid interpolation of a function f(x,y,z).

+
+
Parameters:
+
    +
  • f_values (numpy.array) – An array of size (x_n,y_n,z_n) such that f_values[i,j,k] = +f(x_list[i],y_list[j],z_list[k])

  • +
  • x_list (numpy.array) – An array of x values, with length designated x_n.

  • +
  • y_list (numpy.array) – An array of y values, with length designated y_n.

  • +
  • z_list (numpy.array) – An array of z values, with length designated z_n.

  • +
  • xSearchFunc (function) – An optional function that returns the reference location for x values: +indices = xSearchFunc(x_list,x). Default is np.searchsorted

  • +
  • ySearchFunc (function) – An optional function that returns the reference location for y values: +indices = ySearchFunc(y_list,y). Default is np.searchsorted

  • +
  • zSearchFunc (function) – An optional function that returns the reference location for z values: +indices = zSearchFunc(z_list,z). Default is np.searchsorted

  • +
+
+
+
+
+distance_criteria = ['f_values', 'x_list', 'y_list', 'z_list']#
+
+ +
+ +
+
+class HARK.interpolation.QuadlinearInterp(f_values, w_list, x_list, y_list, z_list, wSearchFunc=None, xSearchFunc=None, ySearchFunc=None, zSearchFunc=None)#
+

Bases: HARKinterpolator4D

+

Quadlinear full (or tensor) grid interpolation of a function f(w,x,y,z).

+
+
Parameters:
+
    +
  • f_values (numpy.array) – An array of size (w_n,x_n,y_n,z_n) such that f_values[i,j,k,l] = +f(w_list[i],x_list[j],y_list[k],z_list[l])

  • +
  • w_list (numpy.array) – An array of x values, with length designated w_n.

  • +
  • x_list (numpy.array) – An array of x values, with length designated x_n.

  • +
  • y_list (numpy.array) – An array of y values, with length designated y_n.

  • +
  • z_list (numpy.array) – An array of z values, with length designated z_n.

  • +
  • wSearchFunc (function) – An optional function that returns the reference location for w values: +indices = wSearchFunc(w_list,w). Default is np.searchsorted

  • +
  • xSearchFunc (function) – An optional function that returns the reference location for x values: +indices = xSearchFunc(x_list,x). Default is np.searchsorted

  • +
  • ySearchFunc (function) – An optional function that returns the reference location for y values: +indices = ySearchFunc(y_list,y). Default is np.searchsorted

  • +
  • zSearchFunc (function) – An optional function that returns the reference location for z values: +indices = zSearchFunc(z_list,z). Default is np.searchsorted

  • +
+
+
+
+
+distance_criteria = ['f_values', 'w_list', 'x_list', 'y_list', 'z_list']#
+
+ +
+ +
+
+class HARK.interpolation.LowerEnvelope(*functions, nan_bool=True)#
+

Bases: HARKinterpolator1D

+

The lower envelope of a finite set of 1D functions, each of which can be of +any class that has the methods __call__, derivative, and eval_with_derivative. +Generally: it combines HARKinterpolator1Ds.

+
+
Parameters:
+
    +
  • *functions (function) – Any number of real functions; often instances of HARKinterpolator1D

  • +
  • nan_bool (boolean) – An indicator for whether the solver should exclude NA’s when +forming the lower envelope

  • +
+
+
+
+
+distance_criteria = ['functions']#
+
+ +
+ +
+
+class HARK.interpolation.UpperEnvelope(*functions, nan_bool=True)#
+

Bases: HARKinterpolator1D

+

The upper envelope of a finite set of 1D functions, each of which can be of +any class that has the methods __call__, derivative, and eval_with_derivative. +Generally: it combines HARKinterpolator1Ds.

+
+
Parameters:
+
    +
  • *functions (function) – Any number of real functions; often instances of HARKinterpolator1D

  • +
  • nan_bool (boolean) – An indicator for whether the solver should exclude NA’s when forming +the lower envelope.

  • +
+
+
+
+
+distance_criteria = ['functions']#
+
+ +
+ +
+
+class HARK.interpolation.LowerEnvelope2D(*functions, nan_bool=True)#
+

Bases: HARKinterpolator2D

+

The lower envelope of a finite set of 2D functions, each of which can be of +any class that has the methods __call__, derivativeX, and derivativeY. +Generally: it combines HARKinterpolator2Ds.

+
+
Parameters:
+
    +
  • *functions (function) – Any number of real functions; often instances of HARKinterpolator2D

  • +
  • nan_bool (boolean) – An indicator for whether the solver should exclude NA’s when forming +the lower envelope.

  • +
+
+
+
+
+distance_criteria = ['functions']#
+
+ +
+ +
+
+class HARK.interpolation.LowerEnvelope3D(*functions, nan_bool=True)#
+

Bases: HARKinterpolator3D

+

The lower envelope of a finite set of 3D functions, each of which can be of +any class that has the methods __call__, derivativeX, derivativeY, and +derivativeZ. Generally: it combines HARKinterpolator2Ds.

+
+
Parameters:
+
    +
  • *functions (function) – Any number of real functions; often instances of HARKinterpolator3D

  • +
  • nan_bool (boolean) – An indicator for whether the solver should exclude NA’s when forming +the lower envelope.

  • +
+
+
+
+
+distance_criteria = ['functions']#
+
+ +
+ +
+
+class HARK.interpolation.VariableLowerBoundFunc2D(func, lowerBound)#
+

Bases: MetricObject

+

A class for representing a function with two real inputs whose lower bound +in the first input depends on the second input. Useful for managing curved +natural borrowing constraints, as occurs in the persistent shocks model.

+
+
Parameters:
+
    +
  • func (function) – A function f: (R_+ x R) –> R representing the function of interest +shifted by its lower bound in the first input.

  • +
  • lowerBound (function) – The lower bound in the first input of the function of interest, as +a function of the second input.

  • +
+
+
+
+
+distance_criteria = ['func', 'lowerBound']#
+
+ +
+
+derivativeX(x, y)#
+

Evaluate the first derivative with respect to x of the function at given +state space points.

+
+
Parameters:
+
    +
  • x (np.array) – First input values.

  • +
  • y (np.array) – Second input values; should be of same shape as x.

  • +
+
+
Returns:
+

dfdx_out – First derivative of function with respect to the first input, +evaluated at (x,y), of same shape as inputs.

+
+
Return type:
+

np.array

+
+
+
+ +
+
+derivativeY(x, y)#
+

Evaluate the first derivative with respect to y of the function at given +state space points.

+
+
Parameters:
+
    +
  • x (np.array) – First input values.

  • +
  • y (np.array) – Second input values; should be of same shape as x.

  • +
+
+
Returns:
+

dfdy_out – First derivative of function with respect to the second input, +evaluated at (x,y), of same shape as inputs.

+
+
Return type:
+

np.array

+
+
+
+ +
+ +
+
+class HARK.interpolation.VariableLowerBoundFunc3D(func, lowerBound)#
+

Bases: MetricObject

+

A class for representing a function with three real inputs whose lower bound +in the first input depends on the second input. Useful for managing curved +natural borrowing constraints.

+
+
Parameters:
+
    +
  • func (function) – A function f: (R_+ x R^2) –> R representing the function of interest +shifted by its lower bound in the first input.

  • +
  • lowerBound (function) – The lower bound in the first input of the function of interest, as +a function of the second input.

  • +
+
+
+
+
+distance_criteria = ['func', 'lowerBound']#
+
+ +
+
+derivativeX(x, y, z)#
+

Evaluate the first derivative with respect to x of the function at given +state space points.

+
+
Parameters:
+
    +
  • x (np.array) – First input values.

  • +
  • y (np.array) – Second input values; should be of same shape as x.

  • +
  • z (np.array) – Third input values; should be of same shape as x.

  • +
+
+
Returns:
+

dfdx_out – First derivative of function with respect to the first input, +evaluated at (x,y,z), of same shape as inputs.

+
+
Return type:
+

np.array

+
+
+
+ +
+
+derivativeY(x, y, z)#
+

Evaluate the first derivative with respect to y of the function at given +state space points.

+
+
Parameters:
+
    +
  • x (np.array) – First input values.

  • +
  • y (np.array) – Second input values; should be of same shape as x.

  • +
  • z (np.array) – Third input values; should be of same shape as x.

  • +
+
+
Returns:
+

dfdy_out – First derivative of function with respect to the second input, +evaluated at (x,y,z), of same shape as inputs.

+
+
Return type:
+

np.array

+
+
+
+ +
+
+derivativeZ(x, y, z)#
+

Evaluate the first derivative with respect to z of the function at given +state space points.

+
+
Parameters:
+
    +
  • x (np.array) – First input values.

  • +
  • y (np.array) – Second input values; should be of same shape as x.

  • +
  • z (np.array) – Third input values; should be of same shape as x.

  • +
+
+
Returns:
+

dfdz_out – First derivative of function with respect to the third input, +evaluated at (x,y,z), of same shape as inputs.

+
+
Return type:
+

np.array

+
+
+
+ +
+ +
+
+class HARK.interpolation.LinearInterpOnInterp1D(xInterpolators, y_values)#
+

Bases: HARKinterpolator2D

+

A 2D interpolator that linearly interpolates among a list of 1D interpolators.

+
+
Parameters:
+
    +
  • xInterpolators ([HARKinterpolator1D]) – A list of 1D interpolations over the x variable. The nth element of +xInterpolators represents f(x,y_values[n]).

  • +
  • y_values (numpy.array) – An array of y values equal in length to xInterpolators.

  • +
+
+
+
+
+distance_criteria = ['xInterpolators', 'y_list']#
+
+ +
+ +
+
+class HARK.interpolation.BilinearInterpOnInterp1D(xInterpolators, y_values, z_values)#
+

Bases: HARKinterpolator3D

+

A 3D interpolator that bilinearly interpolates among a list of lists of 1D +interpolators.

+

Constructor for the class, generating an approximation to a function of +the form f(x,y,z) using interpolations over f(x,y_0,z_0) for a fixed grid +of y_0 and z_0 values.

+
+
Parameters:
+
    +
  • xInterpolators ([[HARKinterpolator1D]]) – A list of lists of 1D interpolations over the x variable. The i,j-th +element of xInterpolators represents f(x,y_values[i],z_values[j]).

  • +
  • y_values (numpy.array) – An array of y values equal in length to xInterpolators.

  • +
  • z_values (numpy.array) – An array of z values equal in length to xInterpolators[0].

  • +
+
+
+
+
+distance_criteria = ['xInterpolators', 'y_list', 'z_list']#
+
+ +
+ +
+
+class HARK.interpolation.TrilinearInterpOnInterp1D(wInterpolators, x_values, y_values, z_values)#
+

Bases: HARKinterpolator4D

+

A 4D interpolator that trilinearly interpolates among a list of lists of 1D interpolators.

+

Constructor for the class, generating an approximation to a function of +the form f(w,x,y,z) using interpolations over f(w,x_0,y_0,z_0) for a fixed +grid of y_0 and z_0 values.

+
+
Parameters:
+
    +
  • wInterpolators ([[[HARKinterpolator1D]]]) – A list of lists of lists of 1D interpolations over the x variable. +The i,j,k-th element of wInterpolators represents f(w,x_values[i],y_values[j],z_values[k]).

  • +
  • x_values (numpy.array) – An array of x values equal in length to wInterpolators.

  • +
  • y_values (numpy.array) – An array of y values equal in length to wInterpolators[0].

  • +
  • z_values (numpy.array) – An array of z values equal in length to wInterpolators[0][0]

  • +
+
+
+
+
+distance_criteria = ['wInterpolators', 'x_list', 'y_list', 'z_list']#
+
+ +
+ +
+
+class HARK.interpolation.LinearInterpOnInterp2D(xyInterpolators, z_values)#
+

Bases: HARKinterpolator3D

+

A 3D interpolation method that linearly interpolates between “layers” of +arbitrary 2D interpolations. Useful for models with two endogenous state +variables and one exogenous state variable when solving with the endogenous +grid method. NOTE: should not be used if an exogenous 3D grid is used, will +be significantly slower than TrilinearInterp.

+

Constructor for the class, generating an approximation to a function of +the form f(x,y,z) using interpolations over f(x,y,z_0) for a fixed grid +of z_0 values.

+
+
Parameters:
+
    +
  • xyInterpolators ([HARKinterpolator2D]) – A list of 2D interpolations over the x and y variables. The nth +element of xyInterpolators represents f(x,y,z_values[n]).

  • +
  • z_values (numpy.array) – An array of z values equal in length to xyInterpolators.

  • +
+
+
+
+
+distance_criteria = ['xyInterpolators', 'z_list']#
+
+ +
+ +
+
+class HARK.interpolation.BilinearInterpOnInterp2D(wxInterpolators, y_values, z_values)#
+

Bases: HARKinterpolator4D

+

A 4D interpolation method that bilinearly interpolates among “layers” of +arbitrary 2D interpolations. Useful for models with two endogenous state +variables and two exogenous state variables when solving with the endogenous +grid method. NOTE: should not be used if an exogenous 4D grid is used, will +be significantly slower than QuadlinearInterp.

+

Constructor for the class, generating an approximation to a function of +the form f(w,x,y,z) using interpolations over f(w,x,y_0,z_0) for a fixed +grid of y_0 and z_0 values.

+
+
Parameters:
+
    +
  • wxInterpolators ([[HARKinterpolator2D]]) – A list of lists of 2D interpolations over the w and x variables. +The i,j-th element of wxInterpolators represents +f(w,x,y_values[i],z_values[j]).

  • +
  • y_values (numpy.array) – An array of y values equal in length to wxInterpolators.

  • +
  • z_values (numpy.array) – An array of z values equal in length to wxInterpolators[0].

  • +
+
+
+
+
+distance_criteria = ['wxInterpolators', 'y_list', 'z_list']#
+
+ +
+ +
+
+class HARK.interpolation.Curvilinear2DInterp(f_values, x_values, y_values)#
+

Bases: HARKinterpolator2D

+

A 2D interpolation method for curvilinear or “warped grid” interpolation, as +in White (2015). Used for models with two endogenous states that are solved +with the endogenous grid method.

+
+
Parameters:
+
    +
  • f_values (numpy.array) – A 2D array of function values such that f_values[i,j] = +f(x_values[i,j],y_values[i,j]).

  • +
  • x_values (numpy.array) – A 2D array of x values of the same size as f_values.

  • +
  • y_values (numpy.array) – A 2D array of y values of the same size as f_values.

  • +
+
+
+
+
+distance_criteria = ['f_values', 'x_values', 'y_values']#
+
+ +
+
+update_polarity()#
+

Fills in the polarity attribute of the interpolation, determining whether +the “plus” (True) or “minus” (False) solution of the system of equations +should be used for each sector. Needs to be called in __init__.

+
+
Parameters:
+

none

+
+
Return type:
+

none

+
+
+
+ +
+
+find_sector(x, y)#
+

Finds the quadrilateral “sector” for each (x,y) point in the input. +Only called as a subroutine of _evaluate().

+
+
Parameters:
+
    +
  • x (np.array) – Values whose sector should be found.

  • +
  • y (np.array) – Values whose sector should be found. Should be same size as x.

  • +
+
+
Returns:
+

    +
  • x_pos (np.array) – Sector x-coordinates for each point of the input, of the same size.

  • +
  • y_pos (np.array) – Sector y-coordinates for each point of the input, of the same size.

  • +
+

+
+
+
+ +
+
+find_coords(x, y, x_pos, y_pos)#
+

Calculates the relative coordinates (alpha,beta) for each point (x,y), +given the sectors (x_pos,y_pos) in which they reside. Only called as +a subroutine of __call__().

+
+
Parameters:
+
    +
  • x (np.array) – Values whose sector should be found.

  • +
  • y (np.array) – Values whose sector should be found. Should be same size as x.

  • +
  • x_pos (np.array) – Sector x-coordinates for each point in (x,y), of the same size.

  • +
  • y_pos (np.array) – Sector y-coordinates for each point in (x,y), of the same size.

  • +
+
+
Returns:
+

    +
  • alpha (np.array) – Relative “horizontal” position of the input in their respective sectors.

  • +
  • beta (np.array) – Relative “vertical” position of the input in their respective sectors.

  • +
+

+
+
+
+ +
+ +
+
+class HARK.interpolation.DiscreteInterp(index_interp, discrete_vals)#
+

Bases: MetricObject

+

An interpolator for variables that can only take a discrete set of values.

+

If the function we wish to interpolate, f(args) can take on the list of +values discrete_vals, this class expects an interpolator for the index of +f’s value in discrete_vals. +E.g., if f(a,b,c) = discrete_vals[5], then index_interp(a,b,c) = 5.

+
+
Parameters:
+
    +
  • index_interp (HARKInterpolator) – An interpolator giving an approximation to the index of the value in +discrete_vals that corresponds to a given set of arguments.

  • +
  • discrete_vals (numpy.array) – A 1D array containing the values in the range of the discrete function +to be interpolated.

  • +
+
+
+
+
+distance_criteria = ['index_interp']#
+
+ +
+ +
+
+HARK.interpolation.calc_log_sum_choice_probs(Vals, sigma)#
+

Returns the final optimal value and choice probabilities given the choice +specific value functions Vals. Probabilities are degenerate if sigma == 0.0. +:param Vals: A numpy.array that holds choice specific values at common grid points. +:type Vals: [numpy.array] +:param sigma: A number that controls the variance of the taste shocks +:type sigma: float

+
+
Returns:
+

    +
  • V ([numpy.array]) – A numpy.array that holds the integrated value function.

  • +
  • P ([numpy.array]) – A numpy.array that holds the discrete choice probabilities

  • +
+

+
+
+
+ +
+
+HARK.interpolation.calc_choice_probs(Vals, sigma)#
+

Returns the choice probabilities given the choice specific value functions +Vals. Probabilities are degenerate if sigma == 0.0. +:param Vals: A numpy.array that holds choice specific values at common grid points. +:type Vals: [numpy.array] +:param sigma: A number that controls the variance of the taste shocks +:type sigma: float

+
+
Returns:
+

Probs – A numpy.array that holds the discrete choice probabilities

+
+
Return type:
+

[numpy.array]

+
+
+
+ +
+
+HARK.interpolation.calc_log_sum(Vals, sigma)#
+

Returns the optimal value given the choice specific value functions Vals. +:param Vals: A numpy.array that holds choice specific values at common grid points. +:type Vals: [numpy.array] +:param sigma: A number that controls the variance of the taste shocks +:type sigma: float

+
+
Returns:
+

V – A numpy.array that holds the integrated value function.

+
+
Return type:
+

[numpy.array]

+
+
+
+ +
+
+class HARK.interpolation.ValueFuncCRRA(vFuncNvrs, CRRA)#
+

Bases: MetricObject

+

A class for representing a value function. The underlying interpolation is +in the space of (state,u_inv(v)); this class “re-curves” to the value function.

+
+
Parameters:
+
    +
  • vFuncNvrs (function) – A real function representing the value function composed with the +inverse utility function, defined on the state: u_inv(vFunc(state))

  • +
  • CRRA (float) – Coefficient of relative risk aversion.

  • +
+
+
+
+
+distance_criteria = ['func', 'CRRA']#
+
+ +
+
+gradient(*args)#
+
+ +
+ +
+
+class HARK.interpolation.MargValueFuncCRRA(cFunc, CRRA)#
+

Bases: MetricObject

+

A class for representing a marginal value function in models where the +standard envelope condition of dvdm(state) = u’(c(state)) holds (with CRRA utility).

+
+
Parameters:
+
    +
  • cFunc (function.) – Its first argument must be normalized market resources m. +A real function representing the marginal value function composed +with the inverse marginal utility function, defined on the state +variables: uP_inv(dvdmFunc(state)). Called cFunc because when standard +envelope condition applies, uP_inv(dvdm(state)) = cFunc(state).

  • +
  • CRRA (float) – Coefficient of relative risk aversion.

  • +
+
+
+
+
+distance_criteria = ['cFunc', 'CRRA']#
+
+ +
+
+derivativeX(*cFuncArgs)#
+

Evaluate the derivative of the marginal value function with respect to +market resources at given state; this is the marginal marginal value +function.

+
+
Parameters:
+

cFuncArgs (floats or np.arrays) – State variables.

+
+
Returns:
+

vPP – Marginal marginal lifetime value of beginning this period with +state cFuncArgs; has same size as inputs.

+
+
Return type:
+

float or np.array

+
+
+
+ +
+ +
+
+class HARK.interpolation.MargMargValueFuncCRRA(cFunc, CRRA)#
+

Bases: MetricObject

+

A class for representing a marginal marginal value function in models where +the standard envelope condition of dvdm = u’(c(state)) holds (with CRRA utility).

+
+
Parameters:
+
    +
  • cFunc (function.) – Its first argument must be normalized market resources m. +A real function representing the marginal value function composed +with the inverse marginal utility function, defined on the state +variables: uP_inv(dvdmFunc(state)). Called cFunc because when standard +envelope condition applies, uP_inv(dvdm(state)) = cFunc(state).

  • +
  • CRRA (float) – Coefficient of relative risk aversion.

  • +
+
+
+
+
+distance_criteria = ['cFunc', 'CRRA']#
+
+ +
+ +
+
+HARK.interpolation.main()#
+
+ +
+ + +
+ + + + + + + +
+ + + + +
+ + +
+ + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/Documentation/reference/tools/model.html b/Documentation/reference/tools/model.html new file mode 100644 index 000000000..04b4cdff4 --- /dev/null +++ b/Documentation/reference/tools/model.html @@ -0,0 +1,897 @@ + + + + + + + + + + + Model — HARK latest documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+
+ + + + +
+ + + + + + + + + + + + + +
+ +
+ + +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ +
+

Model#

+

Tools for crafting models.

+
+
+class HARK.model.Aggregate(dist: Distribution)#
+

Bases: object

+

Used to designate a shock as an aggregate shock. +If so designated, draws from the shock will be scalar rather +than array valued.

+
+ +
+
+class HARK.model.Control(args)#
+

Bases: object

+

Used to designate a variabel that is a control variable.

+
+
Parameters:
+

args (list of str) – The labels of the variables that are in the information set of this control.

+
+
+
+ +
+
+HARK.model.discretized_shock_dstn(shocks, disc_params)#
+

Discretizes a collection of independent shocks and combines +them into one DiscreteDistributionLabeled.

+

Shocks are discretized only if they have a corresponding +element of disc_params defined.

+
+
Parameters:
+
    +
  • shocks (dict of Distribution) – A dictionary of Distributions, representing independent exogenous shocks.

  • +
  • disc_params (dict of dict) – A dictionary of dictionaries with arguments to Distribution.discretize. +Keys of this dictionary should be shared with the shocks argument.

  • +
+
+
+
+ +
+
+HARK.model.construct_shocks(shock_data, scope)#
+

Returns a dictionary from shock labels to Distributions.

+

When the corresponding value in shock_data contains +a distribution constructor and input information, +any symbolic expressions used in the inputs are +evaluated in the provided scope.

+
+
Parameters:
+

shock_data (Mapping(str, Distribution or tuple)) –

A mapping from variable names to Distribution objects, +representing exogenous shocks.

+

Optionally, the mapping can be to tuples of Distribution +constructors and dictionary of input arguments. +In this case, the dictionary can map argument names to +numbers, or to strings. The strings are parsed as +mathematical expressions and evaluated in the scope +of a calibration dictionary.

+

+
+
+
+
scope: dict(str, values)

Variables assigned to numerical values. +The scope in which expressions will be evaluated

+
+
+
+ +
+
+HARK.model.simulate_dynamics(dynamics: Mapping[str, Callable | Control], pre: Mapping[str, Any], dr: Mapping[str, Callable])#
+

From the beginning-of-period state (pre), follow the dynamics, +including any decision rules, to compute the end-of-period state.

+
+
Parameters:
+

dynamics (Mapping[str, Callable]) – Maps variable names to functions from variables to values. +Can include Controls +## TODO: Make collection of equations into a named type

+
+
+
+
preMapping[str, Any]

Bound values for all variables that must be known before beginning the period’s dynamics.

+
+
drMapping[str, Callable]

Decision rules for all the Control variables in the dynamics.

+
+
+
+ +
+
+class HARK.model.Block#
+

Bases: object

+
+ +
+
+class HARK.model.DBlock(name: str = '', description: str = '', shocks: dict = <factory>, dynamics: dict = <factory>, reward: dict = <factory>)#
+

Bases: Block

+

Represents a ‘block’ of model behavior. +It prioritizes a representation of the dynamics of the block. +Control variables are designated by the appropriate dynamic rule.

+
+
Parameters:
+
    +
  • shocks (Mapping(str, Distribution or tuple)) –

    A mapping from variable names to Distribution objects, +representing exogenous shocks.

    +

    Optionally, the mapping can be to tuples of Distribution +constructors and dictionary of input arguments. +In this case, the dictionary can map argument names to +numbers, or to strings. The strings are parsed as +mathematical expressions and evaluated in the scope +of a calibration dictionary.

    +

  • +
  • dynamics (Mapping(str, str or callable)) – A dictionary mapping variable names to mathematical expressions. +These expressions can be simple functions, in which case the +argument names should match the variable inputs. +Or these can be strings, which are parsed into functions.

  • +
+
+
+
+
+name: str = ''#
+
+ +
+
+description: str = ''#
+
+ +
+
+shocks: dict#
+
+ +
+
+dynamics: dict#
+
+ +
+
+reward: dict#
+
+ +
+
+construct_shocks(calibration)#
+

Constructs all shocks given calibration. +This method mutates the DBlock.

+
+ +
+
+discretize(disc_params)#
+

Returns a new DBlock which is a copy of this one, but with shock discretized.

+
+ +
+
+get_shocks()#
+
+ +
+
+get_dynamics()#
+
+ +
+
+get_vars()#
+
+ +
+
+transition(pre, dr)#
+

Returns variable values given previous values and decision rule for all controls.

+
+ +
+
+calc_reward(vals)#
+

Computes the reward for a given set of variable values

+
+ +
+
+get_state_rule_value_function_from_continuation(continuation)#
+

Given a continuation value function, returns a state-rule value +function: the value for each state and decision rule. +This value includes both the reward for executing the rule +‘this period’, and the continuation value of the resulting states.

+
+ +
+
+get_decision_value_function(dr, continuation)#
+

Given a decision rule and a continuation value function, +return a function for the value at the decision step/tac, +after the shock have been realized.

+
+ +
+
+get_arrival_value_function(disc_params, dr, continuation)#
+

Returns an arrival value function, which is the value of the states +upon arrival into the block.

+

This involves taking an expectation over shocks (which must +first be discretized), a decision rule, and a continuation +value function.)

+
+ +
+ +
+
+class HARK.model.RBlock(name: str = '', description: str = '', blocks: ~typing.List[~HARK.model.Block] = <factory>)#
+

Bases: Block

+

A recursive block.

+
+
Parameters:
+

...

+
+
+
+
+name: str = ''#
+
+ +
+
+description: str = ''#
+
+ +
+
+blocks: List[Block]#
+
+ +
+
+construct_shocks(calibration)#
+

Construct all shocks given a calibration dictionary.

+
+ +
+
+discretize(disc_params)#
+

Recursively discretizes all the blocks. +It replaces any DBlocks with new blocks with discretized shocks.

+
+ +
+
+get_shocks()#
+
+ +
+
+get_controls()#
+
+ +
+
+get_dynamics()#
+
+ +
+
+get_vars()#
+
+ +
+ +
+ + +
+ + + + + + + +
+ + + + + + + +
+ + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/Documentation/reference/tools/numba_tools.html b/Documentation/reference/tools/numba_tools.html new file mode 100644 index 000000000..d0012c90f --- /dev/null +++ b/Documentation/reference/tools/numba_tools.html @@ -0,0 +1,605 @@ + + + + + + + + + + + Numba Tools — HARK latest documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+
+ + + + +
+ + + + + + + + + + + + + +
+ +
+ + +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ +
+

Numba Tools#

+
+
+HARK.numba_tools.linear_interp_fast(x0, x_list, y_list, intercept_limit=None, slope_limit=None, lower_extrap=False)#
+
+ +
+
+HARK.numba_tools.linear_interp_deriv_fast(x0, x_list, y_list, intercept_limit=None, slope_limit=None, lower_extrap=False)#
+
+ +
+
+HARK.numba_tools.cubic_interp_fast(x0, x_list, y_list, dydx_list, intercept_limit=None, slope_limit=None, lower_extrap=False)#
+
+ +
+ + +
+ + + + + + + +
+ + + + + + + +
+ + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/Documentation/reference/tools/parallel.html b/Documentation/reference/tools/parallel.html new file mode 100644 index 000000000..10a64fbd8 --- /dev/null +++ b/Documentation/reference/tools/parallel.html @@ -0,0 +1,650 @@ + + + + + + + + + + + Parallel — HARK latest documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+
+ + + + +
+ + + + + + + + + + + + + +
+ +
+ + +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ +
+

Parallel#

+
+
+HARK.parallel.multi_thread_commands_fake(agent_list: List, command_list: List, num_jobs=None) None#
+

Executes the list of commands in command_list for each AgentType in agent_list +in an ordinary, single-threaded loop. Each command should be a method of +that AgentType subclass. This function exists so as to easily disable +multithreading, as it uses the same syntax as multi_thread_commands.

+
+
Parameters:
+
    +
  • agent_list ([AgentType]) – A list of instances of AgentType on which the commands will be run.

  • +
  • command_list ([string]) – A list of commands to run for each AgentType.

  • +
  • num_jobs (None) – Dummy input to match syntax of multi_thread_commands. Does nothing.

  • +
+
+
Return type:
+

none

+
+
+
+ +
+
+HARK.parallel.multi_thread_commands(agent_list: List, command_list: List, num_jobs=None) None#
+

Executes the list of commands in command_list for each AgentType in agent_list +using a multithreaded system. Each command should be a method of that AgentType subclass.

+
+
Parameters:
+
    +
  • agent_list ([AgentType]) – A list of instances of AgentType on which the commands will be run.

  • +
  • command_list ([string]) – A list of commands to run for each AgentType in agent_list.

  • +
+
+
Return type:
+

None

+
+
+
+ +
+
+HARK.parallel.run_commands(agent: Any, command_list: List) Any#
+

Executes each command in command_list on a given AgentType. The commands +should be methods of that AgentType’s subclass.

+
+
Parameters:
+
    +
  • agent (AgentType) – An instance of AgentType on which the commands will be run.

  • +
  • command_list ([string]) – A list of commands that the agent should run, as methods.

  • +
+
+
Returns:
+

agent – The same AgentType instance passed as input, after running the commands.

+
+
Return type:
+

AgentType

+
+
+
+ +
+ + +
+ + + + + + + +
+ + + + + + + +
+ + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/Documentation/reference/tools/rewards.html b/Documentation/reference/tools/rewards.html new file mode 100644 index 000000000..96eca05b4 --- /dev/null +++ b/Documentation/reference/tools/rewards.html @@ -0,0 +1,1471 @@ + + + + + + + + + + + Rewards — HARK latest documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+
+ + + + +
+ + + + + + + + + + + + + +
+ +
+ + +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ +
+

Rewards#

+
+
+HARK.rewards.CRRAutility(c, rho)#
+

Evaluates constant relative risk aversion (CRRA) utility of consumption c +given risk aversion parameter rho.

+
+
Parameters:
+
    +
  • c (float) – Consumption value

  • +
  • rho (float) – Risk aversion

  • +
+
+
Returns:
+

    +
  • (unnamed) (float) – Utility

  • +
  • Tests

  • +
  • —–

  • +
  • Test a value which should pass

  • +
  • >>> c, CRRA = 1.0, 2.0 # Set two values at once with Python syntax

  • +
  • >>> CRRAutility(c=c, rho=CRRA)

  • +
  • -1.0

  • +
+

+
+
+
+ +
+
+HARK.rewards.CRRAutilityP(c, rho)#
+

Evaluates constant relative risk aversion (CRRA) marginal utility of consumption +c given risk aversion parameter rho.

+
+
Parameters:
+
    +
  • c (float) – Consumption value

  • +
  • rho (float) – Risk aversion

  • +
+
+
Returns:
+

(unnamed) – Marginal utility

+
+
Return type:
+

float

+
+
+
+ +
+
+HARK.rewards.CRRAutilityPP(c, rho)#
+

Evaluates constant relative risk aversion (CRRA) marginal marginal utility of +consumption c given risk aversion parameter rho.

+
+
Parameters:
+
    +
  • c (float) – Consumption value

  • +
  • rho (float) – Risk aversion

  • +
+
+
Returns:
+

(unnamed) – Marginal marginal utility

+
+
Return type:
+

float

+
+
+
+ +
+
+HARK.rewards.CRRAutilityPPP(c, rho)#
+

Evaluates constant relative risk aversion (CRRA) marginal marginal marginal +utility of consumption c given risk aversion parameter rho.

+
+
Parameters:
+
    +
  • c (float) – Consumption value

  • +
  • rho (float) – Risk aversion

  • +
+
+
Returns:
+

(unnamed) – Marginal marginal marginal utility

+
+
Return type:
+

float

+
+
+
+ +
+
+HARK.rewards.CRRAutilityPPPP(c, rho)#
+

Evaluates constant relative risk aversion (CRRA) marginal marginal marginal +marginal utility of consumption c given risk aversion parameter rho.

+
+
Parameters:
+
    +
  • c (float) – Consumption value

  • +
  • rho (float) – Risk aversion

  • +
+
+
Returns:
+

(unnamed) – Marginal marginal marginal marginal utility

+
+
Return type:
+

float

+
+
+
+ +
+
+HARK.rewards.CRRAutility_inv(u, rho)#
+

Evaluates the inverse of the CRRA utility function (with risk aversion para- +meter rho) at a given utility level u.

+
+
Parameters:
+
    +
  • u (float) – Utility value

  • +
  • rho (float) – Risk aversion

  • +
+
+
Returns:
+

(unnamed) – Consumption corresponding to given utility value

+
+
Return type:
+

float

+
+
+
+ +
+
+HARK.rewards.CRRAutilityP_inv(uP, rho)#
+

Evaluates the inverse of the CRRA marginal utility function (with risk aversion +parameter rho) at a given marginal utility level uP.

+
+
Parameters:
+
    +
  • uP (float) – Marginal utility value

  • +
  • rho (float) – Risk aversion

  • +
+
+
Returns:
+

(unnamed) – Consumption corresponding to given marginal utility value.

+
+
Return type:
+

float

+
+
+
+ +
+
+HARK.rewards.CRRAutility_invP(u, rho)#
+

Evaluates the derivative of the inverse of the CRRA utility function (with +risk aversion parameter rho) at a given utility level u.

+
+
Parameters:
+
    +
  • u (float) – Utility value

  • +
  • rho (float) – Risk aversion

  • +
+
+
Returns:
+

(unnamed) – Marginal consumption corresponding to given utility value

+
+
Return type:
+

float

+
+
+
+ +
+
+HARK.rewards.CRRAutilityP_invP(uP, rho)#
+

Evaluates the derivative of the inverse of the CRRA marginal utility function +(with risk aversion parameter rho) at a given marginal utility level uP.

+
+
Parameters:
+
    +
  • uP (float) – Marginal utility value

  • +
  • rho (float) – Risk aversion

  • +
+
+
Returns:
+

(unnamed) – Consumption corresponding to given marginal utility value

+
+
Return type:
+

float

+
+
+
+ +
+
+HARK.rewards.StoneGearyCRRAutility(c, rho, shifter, factor=1.0)#
+

Evaluates Stone-Geary version of a constant relative risk aversion (CRRA) +utility of consumption c with given risk aversion parameter rho and +Stone-Geary intercept parameter shifter

+
+
Parameters:
+
    +
  • c (float) – Consumption value

  • +
  • rho (float) – Relative risk aversion

  • +
  • shifter (float) – Intercept in Stone-Geary utility

  • +
+
+
Returns:
+

    +
  • (unnamed) (float) – Utility

  • +
  • Tests

  • +
  • —–

  • +
  • Test a value which should pass

  • +
  • >>> c, CRRA, stone_geary = 1.0, 2.0, 0.0

  • +
  • >>> StoneGearyCRRAutility(c=c, rho=CRRA, shifter=stone_geary)

  • +
  • -1.0

  • +
+

+
+
+
+ +
+
+HARK.rewards.StoneGearyCRRAutilityP(c, rho, shifter, factor=1.0)#
+

Marginal utility of Stone-Geary version of a constant relative risk aversion (CRRA) +utility of consumption c with a given risk aversion parameter rho and +Stone-Geary intercept parameter shifter

+
+
Parameters:
+
    +
  • c (float) – Consumption value

  • +
  • rho (float) – Relative risk aversion

  • +
  • shifter (float) – Intercept in Stone-Geary utility

  • +
+
+
Returns:
+

(unnamed) – marginal utility

+
+
Return type:
+

float

+
+
+
+ +
+
+HARK.rewards.StoneGearyCRRAutilityPP(c, rho, shifter, factor=1.0)#
+

Marginal marginal utility of Stone-Geary version of a CRRA utilty function +with risk aversion parameter rho and Stone-Geary intercept parameter shifter

+
+
Parameters:
+
    +
  • c (float) – Consumption value

  • +
  • rho (float) – Relative risk aversion

  • +
  • shifter (float) – Intercept in Stone-Geary utility

  • +
+
+
Returns:
+

(unnamed) – marginal utility

+
+
Return type:
+

float

+
+
+
+ +
+
+HARK.rewards.StoneGearyCRRAutility_inv(u, rho, shifter, factor=1.0)#
+
+ +
+
+HARK.rewards.StoneGearyCRRAutilityP_inv(uP, rho, shifter, factor=1.0)#
+
+ +
+
+HARK.rewards.StoneGearyCRRAutility_invP(u, rho, shifter, factor=1.0)#
+
+ +
+
+HARK.rewards.StoneGearyCRRAutilityP_invP(uP, rho, shifter, factor=1.0)#
+
+ +
+
+HARK.rewards.CARAutility(c, alpha)#
+

Evaluates constant absolute risk aversion (CARA) utility of consumption c +given risk aversion parameter alpha.

+
+
Parameters:
+
    +
  • c (float) – Consumption value

  • +
  • alpha (float) – Risk aversion

  • +
+
+
Returns:
+

(unnamed) – Utility

+
+
Return type:
+

float

+
+
+
+ +
+
+HARK.rewards.CARAutilityP(c, alpha)#
+

Evaluates constant absolute risk aversion (CARA) marginal utility of +consumption c given risk aversion parameter alpha.

+
+
Parameters:
+
    +
  • c (float) – Consumption value

  • +
  • alpha (float) – Risk aversion

  • +
+
+
Returns:
+

(unnamed) – Marginal utility

+
+
Return type:
+

float

+
+
+
+ +
+
+HARK.rewards.CARAutilityPP(c, alpha)#
+

Evaluates constant absolute risk aversion (CARA) marginal marginal utility +of consumption c given risk aversion parameter alpha.

+
+
Parameters:
+
    +
  • c (float) – Consumption value

  • +
  • alpha (float) – Risk aversion

  • +
+
+
Returns:
+

(unnamed) – Marginal marginal utility

+
+
Return type:
+

float

+
+
+
+ +
+
+HARK.rewards.CARAutilityPPP(c, alpha)#
+

Evaluates constant absolute risk aversion (CARA) marginal marginal marginal +utility of consumption c given risk aversion parameter alpha.

+
+
Parameters:
+
    +
  • c (float) – Consumption value

  • +
  • alpha (float) – Risk aversion

  • +
+
+
Returns:
+

(unnamed) – Marginal marginal marginal utility

+
+
Return type:
+

float

+
+
+
+ +
+
+HARK.rewards.CARAutility_inv(u, alpha)#
+

Evaluates inverse of constant absolute risk aversion (CARA) utility function +at utility level u given risk aversion parameter alpha.

+
+
Parameters:
+
    +
  • u (float) – Utility value

  • +
  • alpha (float) – Risk aversion

  • +
+
+
Returns:
+

(unnamed) – Consumption value corresponding to u

+
+
Return type:
+

float

+
+
+
+ +
+
+HARK.rewards.CARAutilityP_inv(u, alpha)#
+

Evaluates the inverse of constant absolute risk aversion (CARA) marginal +utility function at marginal utility uP given risk aversion parameter alpha.

+
+
Parameters:
+
    +
  • u (float) – Utility value

  • +
  • alpha (float) – Risk aversion

  • +
+
+
Returns:
+

(unnamed) – Consumption value corresponding to uP

+
+
Return type:
+

float

+
+
+
+ +
+
+HARK.rewards.CARAutility_invP(u, alpha)#
+

Evaluates the derivative of inverse of constant absolute risk aversion (CARA) +utility function at utility level u given risk aversion parameter alpha.

+
+
Parameters:
+
    +
  • u (float) – Utility value

  • +
  • alpha (float) – Risk aversion

  • +
+
+
Returns:
+

(unnamed) – Marginal onsumption value corresponding to u

+
+
Return type:
+

float

+
+
+
+ +
+
+HARK.rewards.cobb_douglas(x, zeta, factor)#
+

Evaluates Cobb Douglas utility at quantities of goods consumed x +given elasticity parameters zeta and efficiency parameter factor.

+
+
Parameters:
+
    +
  • x (np.ndarray) – Quantities of goods consumed. First axis must index goods.

  • +
  • zeta (np.ndarray) – Elasticity parameters for each good. Must be consistent with x.

  • +
  • factor (float) – Multiplicative efficiency parameter. (e.g. TFP in production function)

  • +
+
+
Returns:
+

(unnamed) – Utility

+
+
Return type:
+

np.ndarray

+
+
+
+ +
+
+HARK.rewards.cobb_douglas_p(x, zeta, factor, arg=0)#
+

Evaluates the marginal utility of consumption indexed by arg good at +quantities of goods consumed x given elasticity parameters zeta +and efficiency parameter factor.

+
+
Parameters:
+
    +
  • x (np.ndarray) – Quantities of goods consumed. First axis must index goods.

  • +
  • zeta (np.ndarray) – Elasticity parameters for each good. Must be consistent with x.

  • +
  • factor (float) – Multiplicative efficiency parameter.

  • +
  • arg (int) – Index of good to evaluate marginal utility.

  • +
+
+
Returns:
+

(unnamed) – Utility

+
+
Return type:
+

np.ndarray

+
+
+
+ +
+
+HARK.rewards.cobb_douglas_pp(x, zeta, factor, args=(0, 1))#
+

Evaluates the marginal marginal utility of consumption indexed by args +at quantities of goods consumed x given elasticity parameters zeta +and efficiency parameter factor.

+
+
Parameters:
+
    +
  • x (np.ndarray) – Quantities of goods consumed. First axis must index goods.

  • +
  • zeta (np.ndarray) – Elasticity parameters for each good. Must be consistent with x.

  • +
  • factor (float) – Multiplicative efficiency parameter.

  • +
  • args (tuple(int)) – Indexes of goods to evaluate marginal utility. args[0] is the +index of the first derivative taken, and args[1] is the index of +the second derivative taken.

  • +
+
+
Returns:
+

(unnamed) – Utility

+
+
Return type:
+

np.ndarray

+
+
+
+ +
+
+HARK.rewards.cobb_douglas_pn(x, zeta, factor, args=())#
+

Evaluates the nth marginal utility of consumption indexed by args +at quantities of goods consumed x given elasticity parameters zeta +and efficiency parameter factor.

+
+
Parameters:
+
    +
  • x (np.ndarray) – Quantities of goods consumed. First axis must index goods.

  • +
  • zeta (np.ndarray) – Elasticity parameters for each good. Must be consistent with x.

  • +
  • factor (float) – Multiplicative efficiency parameter.

  • +
  • args (tuple(int)) – Indexes of goods to evaluate marginal utility. args[0] is the +index of the first derivative taken, and args[1] is the index of +the second derivative taken. This function works by recursively taking +derivatives, so args can be of any length.

  • +
+
+
Returns:
+

(unnamed) – Utility

+
+
Return type:
+

np.ndarray

+
+
+
+ +
+
+HARK.rewards.const_elast_subs(x, zeta, subs, factor, power)#
+

Evaluates Constant Elasticity of Substitution utility at quantities of +goods consumed x given parameters alpha, ‘subs’, ‘factor’, and ‘power’.

+
+
Parameters:
+
    +
  • x (np.ndarray) – Quantities of goods consumed. First axis must index goods.

  • +
  • zeta (Sequence[float]) – Share parameter for each good. Must be consistent with x.

  • +
  • subs (float) – Substitution parameter.

  • +
  • factor (float) – Factor productivity parameter. (e.g. TFP in production function)

  • +
  • power (float) – degree of homogeneity of the utility function

  • +
+
+
Returns:
+

CES utility.

+
+
Return type:
+

np.ndarray

+
+
+
+ +
+
+HARK.rewards.const_elast_subs_p(x, zeta, subs, factor, power, arg=0)#
+

Evaluates the marginal utility of consumption indexed by arg good at quantities +of goods consumed x given parameters alpha, ‘subs’, ‘factor’, and ‘power’.

+
+
Parameters:
+
    +
  • x (np.ndarray) – Quantities of goods consumed. First axis must index goods.

  • +
  • zeta (Sequence[float]) – Share parameter for each good. Must be consistent with x.

  • +
  • subs (float) – Substitution parameter.

  • +
  • factor (float) – Factor productivity parameter. (e.g. TFP in production function)

  • +
  • power (float) – degree of homogeneity of the utility function

  • +
+
+
Returns:
+

CES marginal utility.

+
+
Return type:
+

np.ndarray

+
+
+
+ +
+
+class HARK.rewards.UtilityFunction(eval_func, der_func=None, inv_func=None)#
+

Bases: MetricObject

+
+
+distance_criteria = ['eval_func']#
+
+ +
+
+derivative(*args, **kwargs)#
+
+ +
+
+inverse(*args, **kwargs)#
+
+ +
+
+der(*args, **kwargs)#
+
+ +
+
+inv(*args, **kwargs)#
+
+ +
+ +
+
+class HARK.rewards.UtilityFuncCRRA(CRRA)#
+

Bases: UtilityFunction

+

A class for representing a CRRA utility function.

+
+
Parameters:
+

CRRA (float) – The coefficient of constant relative risk aversion.

+
+
+
+
+distance_criteria = ['CRRA']#
+
+ +
+
+derivative(c, order=1)#
+

The derivative of the utility function at a given level of consumption c.

+
+
Parameters:
+
    +
  • c (float or np.ndarray) – Consumption level(s).

  • +
  • order (int, optional) – Order of derivative. For example, order == 1 returns the +first derivative of utility of consumption, and so on. By default 1.

  • +
+
+
Returns:
+

Derivative of CRRA utility evaluated at given consumption level(s).

+
+
Return type:
+

float or np.ndarray

+
+
Raises:
+

ValueError – Derivative of order higher than 4 is not supported.

+
+
+
+ +
+
+inverse(u, order=(0, 0))#
+

The inverse of the utility function at a given level of utility u.

+
+
Parameters:
+
    +
  • u (float or np.ndarray) – Utility level(s).

  • +
  • order (tuple, optional) – Order of derivatives. For example, order == (1,1) represents +the first derivative of utility, inverted, and then differentiated +once. For a simple mnemonic, order refers to the number of P`s in +the function `CRRAutility[#1]_inv[#2]. By default (0, 0), +which is just the inverse of utility.

  • +
+
+
Returns:
+

Inverse of CRRA utility evaluated at given utility level(s).

+
+
Return type:
+

float or np.ndarray

+
+
Raises:
+

ValueError – Higher order derivatives are not supported.

+
+
+
+ +
+
+derinv(u, order=(1, 0))#
+

Short alias for inverse with default order = (1,0). See self.inverse.

+
+ +
+ +
+
+class HARK.rewards.UtilityFuncStoneGeary(CRRA, factor=1.0, shifter=0.0)#
+

Bases: UtilityFuncCRRA

+
+
+derivative(c, order=1)#
+

The derivative of the utility function at a given level of consumption c.

+
+
Parameters:
+
    +
  • c (float or np.ndarray) – Consumption level(s).

  • +
  • order (int, optional) – Order of derivative. For example, order == 1 returns the +first derivative of utility of consumption, and so on. By default 1.

  • +
+
+
Returns:
+

Derivative of CRRA utility evaluated at given consumption level(s).

+
+
Return type:
+

float or np.ndarray

+
+
Raises:
+

ValueError – Derivative of order higher than 4 is not supported.

+
+
+
+ +
+
+inverse(u, order=(0, 0))#
+

The inverse of the utility function at a given level of utility u.

+
+
Parameters:
+
    +
  • u (float or np.ndarray) – Utility level(s).

  • +
  • order (tuple, optional) – Order of derivatives. For example, order == (1,1) represents +the first derivative of utility, inverted, and then differentiated +once. For a simple mnemonic, order refers to the number of P`s in +the function `CRRAutility[#1]_inv[#2]. By default (0, 0), +which is just the inverse of utility.

  • +
+
+
Returns:
+

Inverse of CRRA utility evaluated at given utility level(s).

+
+
Return type:
+

float or np.ndarray

+
+
Raises:
+

ValueError – Higher order derivatives are not supported.

+
+
+
+ +
+ +
+
+class HARK.rewards.UtilityFuncCobbDouglas(EOS, factor=1.0)#
+

Bases: UtilityFunction

+

A class for representing a Cobb-Douglas utility function.

+

TODO: Add inverse methods.

+
+
Parameters:
+
    +
  • EOS (float) – The coefficient for elasticity of substitution.

  • +
  • factor (float) – Factor productivity parameter. (e.g. TFP in production function)

  • +
+
+
+
+
+distance_criteria = ['EOS', 'factor']#
+
+ +
+
+derivative(x, args=())#
+
+ +
+ +
+
+class HARK.rewards.UtilityFuncCobbDouglasCRRA(EOS, factor, CRRA)#
+

Bases: UtilityFuncCobbDouglas

+

A class for representing a Cobb-Douglas aggregated CRRA utility function.

+

TODO: Add derivative and inverse methods.

+
+
Parameters:
+
    +
  • EOS (float) – The coefficient for elasticity of substitution.

  • +
  • factor (float) – Factor productivity parameter. (e.g. TFP in production function)

  • +
  • CRRA (float) – Coefficient of relative risk aversion.

  • +
+
+
+
+
+distance_criteria = ['EOS', 'factor', 'CRRA']#
+
+ +
+ +
+
+class HARK.rewards.UtilityFuncConstElastSubs(shares, subs, homogeneity=1.0, factor=1.0)#
+

Bases: UtilityFunction

+

A class for representing a constant elasticity of substitution utility function.

+

TODO: Add derivative and inverse methods.

+
+
Parameters:
+
    +
  • shares (Sequence[float]) – Share parameter for each good. Must be consistent with x.

  • +
  • subs (float) – Substitution parameter.

  • +
  • factor (float) – Factor productivity parameter. (e.g. TFP in production function)

  • +
  • homogeneity (float) – degree of homogeneity of the utility function

  • +
+
+
+
+
+distance_criteria = ['shares', 'subs', 'factor', 'homogeneity']#
+
+ +
+
+derivative(x, arg=0)#
+
+ +
+ +
+ + +
+ + + + + + + +
+ + + + + + + +
+ + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/Documentation/reference/tools/simulation.html b/Documentation/reference/tools/simulation.html new file mode 100644 index 000000000..c85945f15 --- /dev/null +++ b/Documentation/reference/tools/simulation.html @@ -0,0 +1,773 @@ + + + + + + + + + + + Simulation — HARK latest documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+
+ + + + +
+ + + + + + + + + + + + + +
+ +
+ + +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ +
+

Simulation#

+

Functions to support Monte Carlo simulation of models.

+
+
+HARK.simulation.monte_carlo.draw_shocks(shocks: Mapping[str, Distribution], conditions: Sequence[int])#
+

Draw from each shock distribution values, subject to given conditions.

+
+
Parameters:
+
    +
  • Mapping[str (shocks) – A dictionary-like mapping from shock names to distributions from which to draw

  • +
  • Distribution] – A dictionary-like mapping from shock names to distributions from which to draw

  • +
  • conditions (Sequence[int]) – An array of conditions, one for each agent. +Typically these will be agent ages.

  • +
  • draws (Mapping[str, Sequence]) – A mapping from shock names to drawn shock values.

  • +
+
+
+
+ +
+
+HARK.simulation.monte_carlo.calibration_by_age(ages, calibration)#
+

Returns calibration for this model, but with vectorized +values which map age-varying values to agent ages.

+
+
Parameters:
+
    +
  • ages (np.array) – An array of agent ages.

  • +
  • calibration (dict) – A calibration dictionary

  • +
+
+
Returns:
+

aged_calibration – A dictionary of parameter values. +If a parameter is age-varying, the value is a vector +corresponding to the values for each input age.

+
+
Return type:
+

dict

+
+
+
+ +
+
+class HARK.simulation.monte_carlo.Simulator#
+

Bases: object

+
+ +
+
+class HARK.simulation.monte_carlo.AgentTypeMonteCarloSimulator(calibration, block: DBlock, dr, initial, seed=0, agent_count=1, T_sim=10)#
+

Bases: Simulator

+

A Monte Carlo simulation engine based on the HARK.core.AgentType framework.

+

Unlike HARK.core.AgentType, this class does not do any model solving, +and depends on dynamic equations, shocks, and decision rules paased into it.

+

The purpose of this class is to provide a way to simulate models without +relying on inheritance from the AgentType class.

+

This simulator makes assumptions about population birth and mortality which +are not generic. All agents are replaced with newborns when they expire.

+
+
Parameters:
+
    +
  • calibration (Mapping[str, Any])

  • +
  • block (DBlock) – Has shocks, dynamics, and rewards

  • +
  • dr (Mapping[str, Callable])

  • +
  • initial (dict)

  • +
  • seed (int) – A seed for this instance’s random number generator.

  • +
+
+
Attributes:
+
    +
  • agent_count (int) – The number of agents of this type to use in simulation.

  • +
  • T_sim (int) – The number of periods to simulate.

  • +
+
+
+
+
+state_vars = []#
+
+ +
+
+reset_rng()#
+

Reset the random number generator for this type.

+
+ +
+
+initialize_sim()#
+

Prepares for a new simulation. Resets the internal random number generator, +makes initial states for all agents (using sim_birth), clears histories of tracked variables.

+
+ +
+
+sim_one_period()#
+

Simulates one period for this type. Calls the methods get_mortality(), get_shocks() or +read_shocks, get_states(), get_controls(), and get_poststates(). These should be defined for +AgentType subclasses, except get_mortality (define its components sim_death and sim_birth +instead) and read_shocks.

+
+ +
+
+make_shock_history()#
+

Makes a pre-specified history of shocks for the simulation. Shock variables should be named +in self.shock, a mapping from shock names to distributions. This method runs a subset +of the standard simulation loop by simulating only mortality and shocks; each variable named +in shocks is stored in a T_sim x agent_count array in history dictionary self.history[X]. +Automatically sets self.read_shocks to True so that these pre-specified shocks are used for +all subsequent calls to simulate().

+
+
Returns:
+

shock_history – The subset of simulation history that are the shocks for each agent and time.

+
+
Return type:
+

dict

+
+
+
+ +
+
+get_mortality()#
+

Simulates mortality or agent turnover. +Agents die when their states live is less than or equal to zero.

+
+ +
+
+sim_birth(which_agents)#
+

Makes new agents for the simulation. Takes a boolean array as an input, indicating which +agent indices are to be “born”. Does nothing by default, must be overwritten by a subclass.

+
+
Parameters:
+

which_agents (np.array(Bool)) – Boolean array of size self.agent_count indicating which agents should be “born”.

+
+
Return type:
+

None

+
+
+
+ +
+
+simulate(sim_periods=None)#
+

Simulates this agent type for a given number of periods. Defaults to +self.T_sim if no input. +Records histories of attributes named in self.track_vars in +self.history[varname].

+
+
Parameters:
+

None

+
+
Returns:
+

history – The history tracked during the simulation.

+
+
Return type:
+

dict

+
+
+
+ +
+
+clear_history()#
+

Clears the histories.

+
+ +
+ +
+ + +
+ + + + + + + +
+ + + + + + + +
+ + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/Documentation/reference/tools/utilities.html b/Documentation/reference/tools/utilities.html new file mode 100644 index 000000000..394f180bd --- /dev/null +++ b/Documentation/reference/tools/utilities.html @@ -0,0 +1,1169 @@ + + + + + + + + + + + Utilities — HARK latest documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+
+ + + + +
+ + + + + + + + + + + + + +
+ +
+ + +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ +
+

Utilities#

+

General purpose / miscellaneous functions. Includes functions to approximate +continuous distributions with discrete ones, utility functions (and their +derivatives), manipulation of discrete distributions, and basic plotting tools.

+
+
+HARK.utilities.memoize(obj)#
+

A decorator to (potentially) make functions more efficient.

+

With this decorator, functions will “remember” if they have been evaluated with given inputs +before. If they have, they will “remember” the outputs that have already been calculated +for those inputs, rather than calculating them again.

+
+ +
+
+HARK.utilities.get_arg_names(function)#
+

Returns a list of strings naming all of the arguments for the passed function.

+
+
Parameters:
+

function (function) – A function whose argument names are wanted.

+
+
Returns:
+

argNames – The names of the arguments of function.

+
+
Return type:
+

[string]

+
+
+
+ +
+
+class HARK.utilities.NullFunc#
+

Bases: object

+

A trivial class that acts as a placeholder “do nothing” function.

+
+
+distance(other)#
+

Trivial distance metric that only cares whether the other object is also +an instance of NullFunc. Intentionally does not inherit from HARKobject +as this might create dependency problems.

+
+
Parameters:
+

other (any) – Any object for comparison to this instance of NullFunc.

+
+
Returns:
+

(unnamed) – The distance between self and other. Returns 0 if other is also a +NullFunc; otherwise returns an arbitrary high number.

+
+
Return type:
+

float

+
+
+
+ +
+ +
+
+HARK.utilities.make_assets_grid(aXtraMin, aXtraMax, aXtraCount, aXtraExtra, aXtraNestFac)#
+

Constructs the base grid of post-decision states, representing end-of-period +assets above the absolute minimum. Has three modes, depending on aXtraNestFac:

+

aXtraNestFac = -1 : Uniformly spaced grid. +aXtraNestFac = 0 : Ordinary exponentially spaced grid. +aXtraNestFac >= 1 : Multi-exponentially nested grid.

+

See HARK.utilities.make_grid_exp_mult() for more info

+
+
Parameters:
+
    +
  • aXtraMin (float) – Minimum value for the assets-above-minimum grid.

  • +
  • aXtraMax (float) – Maximum value for the assets-above-minimum grid.

  • +
  • aXtraCount (int) – Number of nodes in the assets-above-minimum grid, not counting extra values.

  • +
  • aXtraExtra ([float]) – Additional values to insert in the assets-above-minimum grid.

  • +
  • aXtraNestFac (int) – Level of exponential nesting for grid. If -1, the grid is linearly spaced.

  • +
+
+
Returns:
+

aXtraGrid – Base array of values for the post-decision-state grid.

+
+
Return type:
+

np.ndarray

+
+
+
+ +
+
+HARK.utilities.make_grid_exp_mult(ming, maxg, ng, timestonest=20)#
+

Makes a multi-exponentially spaced grid. +If the function \(\ln(1+x)\) were applied timestonest times, +the grid would become linearly spaced. +If timestonest is 0, the grid is exponentially spaced.

+
+
Parameters:
+
    +
  • ming (float) – Minimum value of the grid

  • +
  • maxg (float) – Maximum value of the grid

  • +
  • ng (int) – The number of grid points

  • +
  • timestonest (int) – the number of times to nest the exponentiation

  • +
+
+
Returns:
+

points – A multi-exponentially spaced grid

+
+
Return type:
+

np.array

+
+
+

Notes

+

Original Matab code can be found in Chris Carroll’s +[Solution Methods for Microeconomic Dynamic Optimization Problems] +(https://www.econ2.jhu.edu/people/ccarroll/solvingmicrodsops/) toolkit. +Latest update: 01 May 2015

+
+ +
+
+HARK.utilities.calc_weighted_avg(data, weights)#
+

Generates a weighted average of simulated data. The Nth row of data is averaged +and then weighted by the Nth element of weights in an aggregate average.

+
+
Parameters:
+
    +
  • data (numpy.array) – An array of data with N rows of J floats

  • +
  • weights (numpy.array) – A length N array of weights for the N rows of data.

  • +
+
+
Returns:
+

weighted_sum – The weighted sum of the data.

+
+
Return type:
+

float

+
+
+
+ +
+
+HARK.utilities.get_percentiles(data, weights=None, percentiles=None, presorted=False)#
+

Calculates the requested percentiles of (weighted) data. Median by default.

+
+
Parameters:
+
    +
  • data (numpy.array) – A 1D array of float data.

  • +
  • weights (np.array) – A weighting vector for the data.

  • +
  • percentiles ([float]) – A list or numpy.array of percentiles to calculate for the data. Each element should +be in (0,1).

  • +
  • presorted (boolean) – Indicator for whether data has already been sorted.

  • +
+
+
Returns:
+

pctl_out – The requested percentiles of the data.

+
+
Return type:
+

numpy.array

+
+
+
+ +
+
+HARK.utilities.get_lorenz_shares(data, weights=None, percentiles=None, presorted=False)#
+

Calculates the Lorenz curve at the requested percentiles of (weighted) data. +Median by default.

+
+
Parameters:
+
    +
  • data (numpy.array) – A 1D array of float data.

  • +
  • weights (numpy.array) – A weighting vector for the data.

  • +
  • percentiles ([float]) – A list or numpy.array of percentiles to calculate for the data. Each element should +be in (0,1).

  • +
  • presorted (boolean) – Indicator for whether data has already been sorted.

  • +
+
+
Returns:
+

lorenz_out – The requested Lorenz curve points of the data.

+
+
Return type:
+

numpy.array

+
+
+
+ +
+
+HARK.utilities.calc_subpop_avg(data, reference, cutoffs, weights=None)#
+

Calculates the average of (weighted) data between cutoff percentiles of a +reference variable.

+
+
Parameters:
+
    +
  • data (numpy.array) – A 1D array of float data.

  • +
  • reference (numpy.array) – A 1D array of float data of the same length as data.

  • +
  • cutoffs ([(float,float)]) – A list of doubles with the lower and upper percentile bounds (should be +in [0,1]).

  • +
  • weights (numpy.array) – A weighting vector for the data.

  • +
+
+
Returns:
+

The (weighted) average of data that falls within the cutoff percentiles +of reference.

+
+
Return type:
+

slice_avg

+
+
+
+ +
+
+HARK.utilities.kernel_regression(x, y, bot=None, top=None, N=500, h=None)#
+

Performs a non-parametric Nadaraya-Watson 1D kernel regression on given data +with optionally specified range, number of points, and kernel bandwidth.

+
+
Parameters:
+
    +
  • x (np.array) – The independent variable in the kernel regression.

  • +
  • y (np.array) – The dependent variable in the kernel regression.

  • +
  • bot (float) – Minimum value of interest in the regression; defaults to min(x).

  • +
  • top (float) – Maximum value of interest in the regression; defaults to max(y).

  • +
  • N (int) – Number of points to compute.

  • +
  • h (float) – The bandwidth of the (Epanechnikov) kernel. To-do: GENERALIZE.

  • +
+
+
Returns:
+

regression – A piecewise locally linear kernel regression: y = f(x).

+
+
Return type:
+

LinearInterp

+
+
+
+ +
+
+HARK.utilities.epanechnikov_kernel(x, ref_x, h=1.0)#
+

The Epanechnikov kernel.

+
+
Parameters:
+
    +
  • x (np.array) – Values at which to evaluate the kernel

  • +
  • x_ref (float) – The reference point

  • +
  • h (float) – Kernel bandwidth

  • +
+
+
Returns:
+

out – Kernel values at each value of x

+
+
Return type:
+

np.array

+
+
+
+ +
+
+HARK.utilities.make_polynomial_params(coeffs, T, offset=0.0, step=1.0)#
+

Make a T-length array of parameters using polynomial coefficients.

+
+
Parameters:
+
    +
  • coeffs ([float]) – Arbitrary length list of polynomial coefficients.

  • +
  • T (int) – Number of elements in the output.

  • +
  • offset (float, optional) – Value at which the X values should start. The default is 0.0.

  • +
  • step (float, optional) – Increment of the X values. The default is 1.0.

  • +
+
+
Returns:
+

param_vals – T-length array of parameter values calculated using the polynomial coefficients.

+
+
Return type:
+

np.array

+
+
+
+ +
+
+HARK.utilities.jump_to_grid_1D(m_vals, probs, Dist_mGrid)#
+

Distributes values onto a predefined grid, maintaining the means.

+
+
Parameters:
+
    +
  • m_vals (np.array) – Market resource values

  • +
  • probs (np.array) – Shock probabilities associated with combinations of m_vals. +Can be thought of as the probability mass function of (m_vals).

  • +
  • dist_mGrid (np.array) – Grid over normalized market resources

  • +
+
+
Returns:
+

probGrid.flatten() – Probabilities of each gridpoint on the combined grid of market resources

+
+
Return type:
+

np.array

+
+
+
+ +
+
+HARK.utilities.jump_to_grid_2D(m_vals, perm_vals, probs, dist_mGrid, dist_pGrid)#
+

Distributes values onto a predefined grid, maintaining the means. m_vals and perm_vals are realizations of market resources and permanent income while +dist_mGrid and dist_pGrid are the predefined grids of market resources and permanent income, respectively. That is, m_vals and perm_vals do not necesarily lie on their +respective grids. Returns probabilities of each gridpoint on the combined grid of market resources and permanent income.

+
+
Parameters:
+
    +
  • m_vals (np.array) – Market resource values

  • +
  • perm_vals (np.array) – Permanent income values

  • +
  • probs (np.array) – Shock probabilities associated with combinations of m_vals and perm_vals. +Can be thought of as the probability mass function of (m_vals, perm_vals).

  • +
  • dist_mGrid (np.array) – Grid over normalized market resources

  • +
  • dist_pGrid (np.array) – Grid over permanent income

  • +
+
+
Returns:
+

probGrid.flatten() – Probabilities of each gridpoint on the combined grid of market resources and permanent income

+
+
Return type:
+

np.array

+
+
+
+ +
+
+HARK.utilities.gen_tran_matrix_1D(dist_mGrid, bNext, shk_prbs, perm_shks, tran_shks, LivPrb, NewBornDist)#
+

Computes Transition Matrix across normalized market resources. +This function is built to non-stochastic simulate the IndShockConsumerType. +This function is used exclusively when Harmenberg Neutral Measure is applied and/or if permanent income is not a state variable +For more information, see https://econ-ark.org/materials/harmenberg-aggregation?launch

+
+
Parameters:
+
    +
  • dist_mGrid (np.array) – Grid over normalized market resources

  • +
  • bNext (np.array) – Grid over bank balances

  • +
  • shk_prbs (np.array) – Array of shock probabilities over combinations of permanent and transitory shocks

  • +
  • perm_shks (np.array) – Array of shocks to permanent income. Shocks should follow Harmenberg neutral measure

  • +
  • tran_shks (np.array) – Array of shocks to transitory

  • +
  • LivPrb (float) – Probability of not dying

  • +
  • NewBornDist (np.array) – array representing distribution of newborns across grid of normalized market resources and grid of permanent income.

  • +
+
+
Returns:
+

TranMatrix – Transition Matrix over normalized market resources grid.

+
+
Return type:
+

np.array

+
+
+
+ +
+
+HARK.utilities.gen_tran_matrix_2D(dist_mGrid, dist_pGrid, bNext, shk_prbs, perm_shks, tran_shks, LivPrb, NewBornDist)#
+

Computes Transition Matrix over normalized market resources and permanent income. +This function is built to non-stochastic simulate the IndShockConsumerType.

+
+
Parameters:
+
    +
  • dist_mGrid (np.array) – Grid over normalized market resources

  • +
  • dist_pGrid (np.array) – Grid over permanent income

  • +
  • bNext (np.array) – Grid over bank balances

  • +
  • shk_prbs (np.array) – Array of shock probabilities over combinations of perm and tran shocks

  • +
  • perm_shks (np.array) – Array of shocks to permanent income

  • +
  • tran_shks (np.array) – Array of shocks to transitory income

  • +
  • LivPrb (float) – Probability of not dying

  • +
  • NewBornDist (np.array) – array representing distribution of newborns across grid of normalized market resources and grid of permanent income.

  • +
+
+
Returns:
+

TranMatrix – Transition Matrix over normalized market resources grid and permanent income grid

+
+
Return type:
+

np.array

+
+
+
+ +
+
+HARK.utilities.plot_funcs(functions, bottom, top, N=1000, legend_kwds=None)#
+

Plots 1D function(s) over a given range.

+
+
Parameters:
+
    +
  • functions ([function] or function) – A single function, or a list of functions, to be plotted.

  • +
  • bottom (float) – The lower limit of the domain to be plotted.

  • +
  • top (float) – The upper limit of the domain to be plotted.

  • +
  • N (int) – Number of points in the domain to evaluate.

  • +
  • legend_kwds (None, or dictionary) – If not None, the keyword dictionary to pass to plt.legend

  • +
+
+
Return type:
+

none

+
+
+
+ +
+
+HARK.utilities.plot_funcs_der(functions, bottom, top, N=1000, legend_kwds=None)#
+

Plots the first derivative of 1D function(s) over a given range.

+
+
Parameters:
+
    +
  • function (function) – A function or list of functions, the derivatives of which are to be plotted.

  • +
  • bottom (float) – The lower limit of the domain to be plotted.

  • +
  • top (float) – The upper limit of the domain to be plotted.

  • +
  • N (int) – Number of points in the domain to evaluate.

  • +
  • legend_kwds (None, or dictionary) – If not None, the keyword dictionary to pass to plt.legend

  • +
+
+
Return type:
+

none

+
+
+
+ +
+
+HARK.utilities.determine_platform()#
+

Utility function to return the platform currenlty in use.

+
+
Returns:
+

pf – ‘darwin’ (MacOS), ‘debian’(debian Linux) or ‘win’ (windows)

+
+
Return type:
+

str

+
+
+
+ +
+
+HARK.utilities.test_latex_installation(pf)#
+

Test to check if latex is installed on the machine.

+
+
Parameters:
+

pf (str (platform)) – output of determine_platform()

+
+
Returns:
+

bool – True if latex found, else installed in the case of debian +otherwise ImportError raised to direct user to install latex manually

+
+
Return type:
+

Boolean

+
+
+
+ +
+
+HARK.utilities.in_ipynb()#
+

If the ipython process contains ‘terminal’ assume not in a notebook.

+
+
Returns:
+

bool – True if called from a jupyter notebook, else False

+
+
Return type:
+

Boolean

+
+
+
+ +
+
+HARK.utilities.setup_latex_env_notebook(pf, latexExists)#
+

This is needed for use of the latex_envs notebook extension +which allows the use of environments in Markdown.

+
+
Parameters:
+

pf (str (platform)) – output of determine_platform()

+
+
+
+ +
+
+HARK.utilities.make_figs(figure_name, saveFigs, drawFigs, target_dir='Figures')#
+

Utility function to save figure in multiple formats and display the image.

+
+
Parameters:
+
    +
  • figure_name (str) – name of the figure

  • +
  • saveFigs (bool) – True if the figure needs to be written to disk else False

  • +
  • drawFigs (bool) – True if the figure should be displayed using plt.draw()

  • +
  • target_dir (str, default = 'Figures/') – Name of folder to save figures to in the current directory

  • +
+
+
+
+ +
+
+HARK.utilities.find_gui()#
+

Quick fix to check if matplotlib is running in a GUI environment.

+
+
Returns:
+

bool – True if it’s a GUI environment, False if not.

+
+
Return type:
+

Boolean

+
+
+
+ +
+
+HARK.utilities.benchmark(agent_type, sort_by='tottime', max_print=10, filename='restats', return_output=False)#
+

Profiling tool for HARK models. Calling benchmark on agents calls the solver for +the agents and provides time to solve as well as the top max_print function calls +in terms of sort_by. Optionally allows for saving a text copy of the profile +as well as returning the Stats object for further inspection.

+

For more details on the python profilers, see +https://docs.python.org/3/library/profile.html#the-stats-class

+
+
Parameters:
+
    +
  • agent_type (AgentType) – A HARK AgentType with a solve() method.

  • +
  • sort_by (string) – A string to sort the stats by.

  • +
  • max_print (int) – Number of lines to print

  • +
  • filename (string) – Optional filename to save output.

  • +
  • return_output (bool) – Boolean to determine whether Stats object should be returned.

  • +
+
+
Returns:
+

stats – Profiling object with call statistics.

+
+
Return type:
+

Stats (optional)

+
+
+
+ +
+
+HARK.utilities.mround(match)#
+
+ +
+
+HARK.utilities.round_in_file(filename)#
+
+ +
+
+HARK.utilities.files_in_dir(mypath)#
+
+ +
+ + +
+ + + + + + + +
+ + + + + + + +
+ + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/Documentation/reference/tools/validators.html b/Documentation/reference/tools/validators.html new file mode 100644 index 000000000..f112ed1ba --- /dev/null +++ b/Documentation/reference/tools/validators.html @@ -0,0 +1,595 @@ + + + + + + + + + + + Validators — HARK latest documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+
+ + + + +
+ + + + + + + + + + + + + +
+ +
+ + +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ +
+

Validators#

+

Decorators which can be used for validating arguments passed into decorated functions

+
+
+HARK.validators.non_empty(*parameter_names)#
+

Enforces arguments to parameters passed in have len > 0

+
+ +
+ + +
+ + + + + + + +
+ + + + +
+ + +
+ + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/_images/HARK-struct-2.png b/_images/HARK-struct-2.png new file mode 100644 index 000000000..376b70e22 Binary files /dev/null and b/_images/HARK-struct-2.png differ diff --git a/_images/HARK-struct-3.png b/_images/HARK-struct-3.png new file mode 100644 index 000000000..e71b9f2b9 Binary files /dev/null and b/_images/HARK-struct-3.png differ diff --git a/_images/HARK-struct-4.png b/_images/HARK-struct-4.png new file mode 100644 index 000000000..7ea46af57 Binary files /dev/null and b/_images/HARK-struct-4.png differ diff --git a/_images/examples_ConsIndShockModel_IndShockConsumerType_13_1.png b/_images/examples_ConsIndShockModel_IndShockConsumerType_13_1.png new file mode 100644 index 000000000..065126bdc Binary files /dev/null and b/_images/examples_ConsIndShockModel_IndShockConsumerType_13_1.png differ diff --git a/_images/examples_ConsIndShockModel_IndShockConsumerType_13_3.png b/_images/examples_ConsIndShockModel_IndShockConsumerType_13_3.png new file mode 100644 index 000000000..cb58f2742 Binary files /dev/null and b/_images/examples_ConsIndShockModel_IndShockConsumerType_13_3.png differ diff --git a/_images/examples_ConsIndShockModel_IndShockConsumerType_17_0.png b/_images/examples_ConsIndShockModel_IndShockConsumerType_17_0.png new file mode 100644 index 000000000..5383414b1 Binary files /dev/null and b/_images/examples_ConsIndShockModel_IndShockConsumerType_17_0.png differ diff --git a/_images/examples_ConsIndShockModel_IndShockConsumerType_21_0.png b/_images/examples_ConsIndShockModel_IndShockConsumerType_21_0.png new file mode 100644 index 000000000..2316414f8 Binary files /dev/null and b/_images/examples_ConsIndShockModel_IndShockConsumerType_21_0.png differ diff --git a/_images/examples_ConsIndShockModel_IndShockConsumerType_21_1.png b/_images/examples_ConsIndShockModel_IndShockConsumerType_21_1.png new file mode 100644 index 000000000..52c65f416 Binary files /dev/null and b/_images/examples_ConsIndShockModel_IndShockConsumerType_21_1.png differ diff --git a/_images/examples_ConsIndShockModel_IndShockConsumerType_23_0.png b/_images/examples_ConsIndShockModel_IndShockConsumerType_23_0.png new file mode 100644 index 000000000..5babc1b7c Binary files /dev/null and b/_images/examples_ConsIndShockModel_IndShockConsumerType_23_0.png differ diff --git a/_images/examples_ConsIndShockModel_KinkedRconsumerType_10_1.png b/_images/examples_ConsIndShockModel_KinkedRconsumerType_10_1.png new file mode 100644 index 000000000..ce4b04134 Binary files /dev/null and b/_images/examples_ConsIndShockModel_KinkedRconsumerType_10_1.png differ diff --git a/_images/examples_ConsIndShockModel_KinkedRconsumerType_10_3.png b/_images/examples_ConsIndShockModel_KinkedRconsumerType_10_3.png new file mode 100644 index 000000000..3636a94ea Binary files /dev/null and b/_images/examples_ConsIndShockModel_KinkedRconsumerType_10_3.png differ diff --git a/_images/examples_ConsIndShockModel_KinkedRconsumerType_14_0.png b/_images/examples_ConsIndShockModel_KinkedRconsumerType_14_0.png new file mode 100644 index 000000000..8853a9c1d Binary files /dev/null and b/_images/examples_ConsIndShockModel_KinkedRconsumerType_14_0.png differ diff --git a/_images/examples_ConsIndShockModel_KinkedRconsumerType_16_0.png b/_images/examples_ConsIndShockModel_KinkedRconsumerType_16_0.png new file mode 100644 index 000000000..c3dbd3888 Binary files /dev/null and b/_images/examples_ConsIndShockModel_KinkedRconsumerType_16_0.png differ diff --git a/_images/examples_ConsIndShockModel_PerfForesightConsumerType_14_1.png b/_images/examples_ConsIndShockModel_PerfForesightConsumerType_14_1.png new file mode 100644 index 000000000..0792c3061 Binary files /dev/null and b/_images/examples_ConsIndShockModel_PerfForesightConsumerType_14_1.png differ diff --git a/_images/examples_ConsIndShockModel_PerfForesightConsumerType_15_1.png b/_images/examples_ConsIndShockModel_PerfForesightConsumerType_15_1.png new file mode 100644 index 000000000..e477c9f8f Binary files /dev/null and b/_images/examples_ConsIndShockModel_PerfForesightConsumerType_15_1.png differ diff --git a/_images/examples_ConsIndShockModel_PerfForesightConsumerType_17_2.png b/_images/examples_ConsIndShockModel_PerfForesightConsumerType_17_2.png new file mode 100644 index 000000000..342b119dc Binary files /dev/null and b/_images/examples_ConsIndShockModel_PerfForesightConsumerType_17_2.png differ diff --git a/_images/examples_ConsIndShockModel_PerfForesightConsumerType_24_0.png b/_images/examples_ConsIndShockModel_PerfForesightConsumerType_24_0.png new file mode 100644 index 000000000..dfc6f41d4 Binary files /dev/null and b/_images/examples_ConsIndShockModel_PerfForesightConsumerType_24_0.png differ diff --git a/_images/examples_ConsIndShockModel_PerfForesightConsumerType_26_0.png b/_images/examples_ConsIndShockModel_PerfForesightConsumerType_26_0.png new file mode 100644 index 000000000..97b30915b Binary files /dev/null and b/_images/examples_ConsIndShockModel_PerfForesightConsumerType_26_0.png differ diff --git a/_images/examples_ConsIndShockModel_PerfForesightConsumerType_28_0.png b/_images/examples_ConsIndShockModel_PerfForesightConsumerType_28_0.png new file mode 100644 index 000000000..dfc6f41d4 Binary files /dev/null and b/_images/examples_ConsIndShockModel_PerfForesightConsumerType_28_0.png differ diff --git a/_images/examples_ConsNewKeynesianModel_Jacobian_Example_11_0.png b/_images/examples_ConsNewKeynesianModel_Jacobian_Example_11_0.png new file mode 100644 index 000000000..bad72cc25 Binary files /dev/null and b/_images/examples_ConsNewKeynesianModel_Jacobian_Example_11_0.png differ diff --git a/_images/examples_ConsNewKeynesianModel_Jacobian_Example_13_0.png b/_images/examples_ConsNewKeynesianModel_Jacobian_Example_13_0.png new file mode 100644 index 000000000..3b02677dc Binary files /dev/null and b/_images/examples_ConsNewKeynesianModel_Jacobian_Example_13_0.png differ diff --git a/_images/examples_ConsNewKeynesianModel_Jacobian_Example_17_0.png b/_images/examples_ConsNewKeynesianModel_Jacobian_Example_17_0.png new file mode 100644 index 000000000..749aa5a33 Binary files /dev/null and b/_images/examples_ConsNewKeynesianModel_Jacobian_Example_17_0.png differ diff --git a/_images/examples_ConsNewKeynesianModel_Jacobian_Example_19_0.png b/_images/examples_ConsNewKeynesianModel_Jacobian_Example_19_0.png new file mode 100644 index 000000000..d73733fb1 Binary files /dev/null and b/_images/examples_ConsNewKeynesianModel_Jacobian_Example_19_0.png differ diff --git a/_images/examples_ConsNewKeynesianModel_Jacobian_Example_22_0.png b/_images/examples_ConsNewKeynesianModel_Jacobian_Example_22_0.png new file mode 100644 index 000000000..98ecc7611 Binary files /dev/null and b/_images/examples_ConsNewKeynesianModel_Jacobian_Example_22_0.png differ diff --git a/_images/examples_ConsNewKeynesianModel_Jacobian_Example_23_0.png b/_images/examples_ConsNewKeynesianModel_Jacobian_Example_23_0.png new file mode 100644 index 000000000..70fe62f95 Binary files /dev/null and b/_images/examples_ConsNewKeynesianModel_Jacobian_Example_23_0.png differ diff --git a/_images/examples_ConsNewKeynesianModel_KS-HARK-presentation_23_0.png b/_images/examples_ConsNewKeynesianModel_KS-HARK-presentation_23_0.png new file mode 100644 index 000000000..226637dad Binary files /dev/null and b/_images/examples_ConsNewKeynesianModel_KS-HARK-presentation_23_0.png differ diff --git a/_images/examples_ConsNewKeynesianModel_KS-HARK-presentation_26_0.png b/_images/examples_ConsNewKeynesianModel_KS-HARK-presentation_26_0.png new file mode 100644 index 000000000..0cd7fd6f4 Binary files /dev/null and b/_images/examples_ConsNewKeynesianModel_KS-HARK-presentation_26_0.png differ diff --git a/_images/examples_ConsNewKeynesianModel_KS-HARK-presentation_35_0.png b/_images/examples_ConsNewKeynesianModel_KS-HARK-presentation_35_0.png new file mode 100644 index 000000000..1089859f6 Binary files /dev/null and b/_images/examples_ConsNewKeynesianModel_KS-HARK-presentation_35_0.png differ diff --git a/_images/examples_ConsNewKeynesianModel_KS-HARK-presentation_38_0.png b/_images/examples_ConsNewKeynesianModel_KS-HARK-presentation_38_0.png new file mode 100644 index 000000000..0bdc9f11c Binary files /dev/null and b/_images/examples_ConsNewKeynesianModel_KS-HARK-presentation_38_0.png differ diff --git a/_images/examples_ConsNewKeynesianModel_SSJ_example_15_0.png b/_images/examples_ConsNewKeynesianModel_SSJ_example_15_0.png new file mode 100644 index 000000000..f33e03771 Binary files /dev/null and b/_images/examples_ConsNewKeynesianModel_SSJ_example_15_0.png differ diff --git a/_images/examples_ConsNewKeynesianModel_SSJ_example_16_0.png b/_images/examples_ConsNewKeynesianModel_SSJ_example_16_0.png new file mode 100644 index 000000000..e6da28726 Binary files /dev/null and b/_images/examples_ConsNewKeynesianModel_SSJ_example_16_0.png differ diff --git a/_images/examples_ConsNewKeynesianModel_SSJ_example_26_0.png b/_images/examples_ConsNewKeynesianModel_SSJ_example_26_0.png new file mode 100644 index 000000000..e0b3b1a18 Binary files /dev/null and b/_images/examples_ConsNewKeynesianModel_SSJ_example_26_0.png differ diff --git a/_images/examples_ConsNewKeynesianModel_SSJ_example_30_0.png b/_images/examples_ConsNewKeynesianModel_SSJ_example_30_0.png new file mode 100644 index 000000000..9aca3e389 Binary files /dev/null and b/_images/examples_ConsNewKeynesianModel_SSJ_example_30_0.png differ diff --git a/_images/examples_ConsNewKeynesianModel_SSJ_example_31_0.png b/_images/examples_ConsNewKeynesianModel_SSJ_example_31_0.png new file mode 100644 index 000000000..858f5f574 Binary files /dev/null and b/_images/examples_ConsNewKeynesianModel_SSJ_example_31_0.png differ diff --git a/_images/examples_ConsNewKeynesianModel_SSJ_example_42_0.png b/_images/examples_ConsNewKeynesianModel_SSJ_example_42_0.png new file mode 100644 index 000000000..cf51e738a Binary files /dev/null and b/_images/examples_ConsNewKeynesianModel_SSJ_example_42_0.png differ diff --git a/_images/examples_ConsNewKeynesianModel_SSJ_example_47_0.png b/_images/examples_ConsNewKeynesianModel_SSJ_example_47_0.png new file mode 100644 index 000000000..ea4724139 Binary files /dev/null and b/_images/examples_ConsNewKeynesianModel_SSJ_example_47_0.png differ diff --git a/_images/examples_ConsNewKeynesianModel_Transition_Matrix_Example_19_0.png b/_images/examples_ConsNewKeynesianModel_Transition_Matrix_Example_19_0.png new file mode 100644 index 000000000..0bcb90983 Binary files /dev/null and b/_images/examples_ConsNewKeynesianModel_Transition_Matrix_Example_19_0.png differ diff --git a/_images/examples_ConsNewKeynesianModel_Transition_Matrix_Example_22_0.png b/_images/examples_ConsNewKeynesianModel_Transition_Matrix_Example_22_0.png new file mode 100644 index 000000000..01a96df50 Binary files /dev/null and b/_images/examples_ConsNewKeynesianModel_Transition_Matrix_Example_22_0.png differ diff --git a/_images/examples_ConsNewKeynesianModel_Transition_Matrix_Example_24_0.png b/_images/examples_ConsNewKeynesianModel_Transition_Matrix_Example_24_0.png new file mode 100644 index 000000000..dca8a022b Binary files /dev/null and b/_images/examples_ConsNewKeynesianModel_Transition_Matrix_Example_24_0.png differ diff --git a/_images/examples_ConsNewKeynesianModel_Transition_Matrix_Example_28_1.png b/_images/examples_ConsNewKeynesianModel_Transition_Matrix_Example_28_1.png new file mode 100644 index 000000000..861103337 Binary files /dev/null and b/_images/examples_ConsNewKeynesianModel_Transition_Matrix_Example_28_1.png differ diff --git a/_images/examples_ConsNewKeynesianModel_Transition_Matrix_Example_30_1.png b/_images/examples_ConsNewKeynesianModel_Transition_Matrix_Example_30_1.png new file mode 100644 index 000000000..4f5f6acea Binary files /dev/null and b/_images/examples_ConsNewKeynesianModel_Transition_Matrix_Example_30_1.png differ diff --git a/_images/examples_ConsNewKeynesianModel_Transition_Matrix_Example_38_0.png b/_images/examples_ConsNewKeynesianModel_Transition_Matrix_Example_38_0.png new file mode 100644 index 000000000..3767b8047 Binary files /dev/null and b/_images/examples_ConsNewKeynesianModel_Transition_Matrix_Example_38_0.png differ diff --git a/_images/examples_ConsNewKeynesianModel_Transition_Matrix_Example_41_0.png b/_images/examples_ConsNewKeynesianModel_Transition_Matrix_Example_41_0.png new file mode 100644 index 000000000..e5749124a Binary files /dev/null and b/_images/examples_ConsNewKeynesianModel_Transition_Matrix_Example_41_0.png differ diff --git a/_images/examples_ConsNewKeynesianModel_Transition_Matrix_Example_58_0.png b/_images/examples_ConsNewKeynesianModel_Transition_Matrix_Example_58_0.png new file mode 100644 index 000000000..381f02407 Binary files /dev/null and b/_images/examples_ConsNewKeynesianModel_Transition_Matrix_Example_58_0.png differ diff --git a/_images/examples_ConsNewKeynesianModel_Transition_Matrix_Example_60_0.png b/_images/examples_ConsNewKeynesianModel_Transition_Matrix_Example_60_0.png new file mode 100644 index 000000000..cf4039647 Binary files /dev/null and b/_images/examples_ConsNewKeynesianModel_Transition_Matrix_Example_60_0.png differ diff --git a/_images/examples_ConsPortfolioModel_example_ConsPortfolioModel_11_1.png b/_images/examples_ConsPortfolioModel_example_ConsPortfolioModel_11_1.png new file mode 100644 index 000000000..5804eef12 Binary files /dev/null and b/_images/examples_ConsPortfolioModel_example_ConsPortfolioModel_11_1.png differ diff --git a/_images/examples_ConsPortfolioModel_example_ConsPortfolioModel_11_3.png b/_images/examples_ConsPortfolioModel_example_ConsPortfolioModel_11_3.png new file mode 100644 index 000000000..ba9f08b0f Binary files /dev/null and b/_images/examples_ConsPortfolioModel_example_ConsPortfolioModel_11_3.png differ diff --git a/_images/examples_ConsPortfolioModel_example_ConsPortfolioModel_16_1.png b/_images/examples_ConsPortfolioModel_example_ConsPortfolioModel_16_1.png new file mode 100644 index 000000000..799c78853 Binary files /dev/null and b/_images/examples_ConsPortfolioModel_example_ConsPortfolioModel_16_1.png differ diff --git a/_images/examples_ConsPortfolioModel_example_ConsPortfolioModel_17_1.png b/_images/examples_ConsPortfolioModel_example_ConsPortfolioModel_17_1.png new file mode 100644 index 000000000..9bd739fdc Binary files /dev/null and b/_images/examples_ConsPortfolioModel_example_ConsPortfolioModel_17_1.png differ diff --git a/_images/examples_ConsPortfolioModel_example_ConsPortfolioModel_18_1.png b/_images/examples_ConsPortfolioModel_example_ConsPortfolioModel_18_1.png new file mode 100644 index 000000000..884737949 Binary files /dev/null and b/_images/examples_ConsPortfolioModel_example_ConsPortfolioModel_18_1.png differ diff --git a/_images/examples_ConsPortfolioModel_example_ConsPortfolioModel_23_1.png b/_images/examples_ConsPortfolioModel_example_ConsPortfolioModel_23_1.png new file mode 100644 index 000000000..2316cf7ad Binary files /dev/null and b/_images/examples_ConsPortfolioModel_example_ConsPortfolioModel_23_1.png differ diff --git a/_images/examples_ConsPortfolioModel_example_ConsPortfolioModel_23_3.png b/_images/examples_ConsPortfolioModel_example_ConsPortfolioModel_23_3.png new file mode 100644 index 000000000..c55c8d2af Binary files /dev/null and b/_images/examples_ConsPortfolioModel_example_ConsPortfolioModel_23_3.png differ diff --git a/_images/examples_ConsPortfolioModel_example_ConsPortfolioModel_27_0.png b/_images/examples_ConsPortfolioModel_example_ConsPortfolioModel_27_0.png new file mode 100644 index 000000000..5016cc05a Binary files /dev/null and b/_images/examples_ConsPortfolioModel_example_ConsPortfolioModel_27_0.png differ diff --git a/_images/examples_ConsPortfolioModel_example_ConsPortfolioModel_27_1.png b/_images/examples_ConsPortfolioModel_example_ConsPortfolioModel_27_1.png new file mode 100644 index 000000000..01479f788 Binary files /dev/null and b/_images/examples_ConsPortfolioModel_example_ConsPortfolioModel_27_1.png differ diff --git a/_images/examples_ConsPortfolioModel_example_ConsPortfolioModel_27_2.png b/_images/examples_ConsPortfolioModel_example_ConsPortfolioModel_27_2.png new file mode 100644 index 000000000..ee49e2e5d Binary files /dev/null and b/_images/examples_ConsPortfolioModel_example_ConsPortfolioModel_27_2.png differ diff --git a/_images/examples_ConsPortfolioModel_example_ConsPortfolioModel_5_1.png b/_images/examples_ConsPortfolioModel_example_ConsPortfolioModel_5_1.png new file mode 100644 index 000000000..cba4b7b3c Binary files /dev/null and b/_images/examples_ConsPortfolioModel_example_ConsPortfolioModel_5_1.png differ diff --git a/_images/examples_ConsPortfolioModel_example_ConsPortfolioModel_5_3.png b/_images/examples_ConsPortfolioModel_example_ConsPortfolioModel_5_3.png new file mode 100644 index 000000000..3d7f31007 Binary files /dev/null and b/_images/examples_ConsPortfolioModel_example_ConsPortfolioModel_5_3.png differ diff --git a/_images/examples_GenIncProcessModel_GenIncProcessModel_12_1.png b/_images/examples_GenIncProcessModel_GenIncProcessModel_12_1.png new file mode 100644 index 000000000..59098ccf0 Binary files /dev/null and b/_images/examples_GenIncProcessModel_GenIncProcessModel_12_1.png differ diff --git a/_images/examples_GenIncProcessModel_GenIncProcessModel_15_1.png b/_images/examples_GenIncProcessModel_GenIncProcessModel_15_1.png new file mode 100644 index 000000000..2c4c8858a Binary files /dev/null and b/_images/examples_GenIncProcessModel_GenIncProcessModel_15_1.png differ diff --git a/_images/examples_GenIncProcessModel_GenIncProcessModel_15_3.png b/_images/examples_GenIncProcessModel_GenIncProcessModel_15_3.png new file mode 100644 index 000000000..e5082bfbd Binary files /dev/null and b/_images/examples_GenIncProcessModel_GenIncProcessModel_15_3.png differ diff --git a/_images/examples_GenIncProcessModel_GenIncProcessModel_17_0.png b/_images/examples_GenIncProcessModel_GenIncProcessModel_17_0.png new file mode 100644 index 000000000..e6552c8c8 Binary files /dev/null and b/_images/examples_GenIncProcessModel_GenIncProcessModel_17_0.png differ diff --git a/_images/examples_GenIncProcessModel_GenIncProcessModel_18_0.png b/_images/examples_GenIncProcessModel_GenIncProcessModel_18_0.png new file mode 100644 index 000000000..ce600dc84 Binary files /dev/null and b/_images/examples_GenIncProcessModel_GenIncProcessModel_18_0.png differ diff --git a/_images/examples_GenIncProcessModel_GenIncProcessModel_23_1.png b/_images/examples_GenIncProcessModel_GenIncProcessModel_23_1.png new file mode 100644 index 000000000..159fe4b26 Binary files /dev/null and b/_images/examples_GenIncProcessModel_GenIncProcessModel_23_1.png differ diff --git a/_images/examples_GenIncProcessModel_GenIncProcessModel_24_0.png b/_images/examples_GenIncProcessModel_GenIncProcessModel_24_0.png new file mode 100644 index 000000000..6c58a25bb Binary files /dev/null and b/_images/examples_GenIncProcessModel_GenIncProcessModel_24_0.png differ diff --git a/_images/examples_GenIncProcessModel_GenIncProcessModel_25_0.png b/_images/examples_GenIncProcessModel_GenIncProcessModel_25_0.png new file mode 100644 index 000000000..c8cbbdf96 Binary files /dev/null and b/_images/examples_GenIncProcessModel_GenIncProcessModel_25_0.png differ diff --git a/_images/examples_Gentle-Intro_Gentle-Intro-To-HARK_13_0.png b/_images/examples_Gentle-Intro_Gentle-Intro-To-HARK_13_0.png new file mode 100644 index 000000000..751a59477 Binary files /dev/null and b/_images/examples_Gentle-Intro_Gentle-Intro-To-HARK_13_0.png differ diff --git a/_images/examples_Gentle-Intro_Gentle-Intro-To-HARK_17_0.png b/_images/examples_Gentle-Intro_Gentle-Intro-To-HARK_17_0.png new file mode 100644 index 000000000..32bda3f07 Binary files /dev/null and b/_images/examples_Gentle-Intro_Gentle-Intro-To-HARK_17_0.png differ diff --git a/_images/examples_Gentle-Intro_Gentle-Intro-To-HARK_21_0.png b/_images/examples_Gentle-Intro_Gentle-Intro-To-HARK_21_0.png new file mode 100644 index 000000000..ca5515a19 Binary files /dev/null and b/_images/examples_Gentle-Intro_Gentle-Intro-To-HARK_21_0.png differ diff --git a/_images/examples_Gentle-Intro_Gentle-Intro-To-HARK_23_0.png b/_images/examples_Gentle-Intro_Gentle-Intro-To-HARK_23_0.png new file mode 100644 index 000000000..6433bb480 Binary files /dev/null and b/_images/examples_Gentle-Intro_Gentle-Intro-To-HARK_23_0.png differ diff --git a/_images/examples_Gentle-Intro_Gentle-Intro-To-HARK_29_0.png b/_images/examples_Gentle-Intro_Gentle-Intro-To-HARK_29_0.png new file mode 100644 index 000000000..eb5bfa1be Binary files /dev/null and b/_images/examples_Gentle-Intro_Gentle-Intro-To-HARK_29_0.png differ diff --git a/_images/examples_HowWeSolveIndShockConsumerType_HowWeSolveIndShockConsumerType_13_0.png b/_images/examples_HowWeSolveIndShockConsumerType_HowWeSolveIndShockConsumerType_13_0.png new file mode 100644 index 000000000..dfd72274f Binary files /dev/null and b/_images/examples_HowWeSolveIndShockConsumerType_HowWeSolveIndShockConsumerType_13_0.png differ diff --git a/_images/examples_HowWeSolveIndShockConsumerType_HowWeSolveIndShockConsumerType_23_0.png b/_images/examples_HowWeSolveIndShockConsumerType_HowWeSolveIndShockConsumerType_23_0.png new file mode 100644 index 000000000..9335833ca Binary files /dev/null and b/_images/examples_HowWeSolveIndShockConsumerType_HowWeSolveIndShockConsumerType_23_0.png differ diff --git a/_images/examples_HowWeSolveIndShockConsumerType_HowWeSolveIndShockConsumerType_5_0.png b/_images/examples_HowWeSolveIndShockConsumerType_HowWeSolveIndShockConsumerType_5_0.png new file mode 100644 index 000000000..b5e96be02 Binary files /dev/null and b/_images/examples_HowWeSolveIndShockConsumerType_HowWeSolveIndShockConsumerType_5_0.png differ diff --git a/_images/examples_Journeys_Journey-PhD_15_1.png b/_images/examples_Journeys_Journey-PhD_15_1.png new file mode 100644 index 000000000..8e1f25db8 Binary files /dev/null and b/_images/examples_Journeys_Journey-PhD_15_1.png differ diff --git a/_images/examples_Journeys_Journey-PhD_7_1.png b/_images/examples_Journeys_Journey-PhD_7_1.png new file mode 100644 index 000000000..6b7b57fcd Binary files /dev/null and b/_images/examples_Journeys_Journey-PhD_7_1.png differ diff --git a/_images/examples_LifecycleModel_Cycles_tutorial_17_1.png b/_images/examples_LifecycleModel_Cycles_tutorial_17_1.png new file mode 100644 index 000000000..76b4e3484 Binary files /dev/null and b/_images/examples_LifecycleModel_Cycles_tutorial_17_1.png differ diff --git a/_images/examples_LifecycleModel_Cycles_tutorial_21_1.png b/_images/examples_LifecycleModel_Cycles_tutorial_21_1.png new file mode 100644 index 000000000..4daced3b9 Binary files /dev/null and b/_images/examples_LifecycleModel_Cycles_tutorial_21_1.png differ diff --git a/_images/examples_LifecycleModel_Cycles_tutorial_8_1.png b/_images/examples_LifecycleModel_Cycles_tutorial_8_1.png new file mode 100644 index 000000000..767f6bcc0 Binary files /dev/null and b/_images/examples_LifecycleModel_Cycles_tutorial_8_1.png differ diff --git a/_images/examples_LifecycleModel_LifecycleModel_5_1.png b/_images/examples_LifecycleModel_LifecycleModel_5_1.png new file mode 100644 index 000000000..384cf00b4 Binary files /dev/null and b/_images/examples_LifecycleModel_LifecycleModel_5_1.png differ diff --git a/_images/examples_LifecycleModel_LifecycleModel_9_0.png b/_images/examples_LifecycleModel_LifecycleModel_9_0.png new file mode 100644 index 000000000..f93eb879b Binary files /dev/null and b/_images/examples_LifecycleModel_LifecycleModel_9_0.png differ diff --git a/_sphinx_design_static/design-tabs.js b/_sphinx_design_static/design-tabs.js new file mode 100644 index 000000000..b25bd6a4f --- /dev/null +++ b/_sphinx_design_static/design-tabs.js @@ -0,0 +1,101 @@ +// @ts-check + +// Extra JS capability for selected tabs to be synced +// The selection is stored in local storage so that it persists across page loads. + +/** + * @type {Record} + */ +let sd_id_to_elements = {}; +const storageKeyPrefix = "sphinx-design-tab-id-"; + +/** + * Create a key for a tab element. + * @param {HTMLElement} el - The tab element. + * @returns {[string, string, string] | null} - The key. + * + */ +function create_key(el) { + let syncId = el.getAttribute("data-sync-id"); + let syncGroup = el.getAttribute("data-sync-group"); + if (!syncId || !syncGroup) return null; + return [syncGroup, syncId, syncGroup + "--" + syncId]; +} + +/** + * Initialize the tab selection. + * + */ +function ready() { + // Find all tabs with sync data + + /** @type {string[]} */ + let groups = []; + + document.querySelectorAll(".sd-tab-label").forEach((label) => { + if (label instanceof HTMLElement) { + let data = create_key(label); + if (data) { + let [group, id, key] = data; + + // add click event listener + // @ts-ignore + label.onclick = onSDLabelClick; + + // store map of key to elements + if (!sd_id_to_elements[key]) { + sd_id_to_elements[key] = []; + } + sd_id_to_elements[key].push(label); + + if (groups.indexOf(group) === -1) { + groups.push(group); + // Check if a specific tab has been selected via URL parameter + const tabParam = new URLSearchParams(window.location.search).get( + group + ); + if (tabParam) { + console.log( + "sphinx-design: Selecting tab id for group '" + + group + + "' from URL parameter: " + + tabParam + ); + window.sessionStorage.setItem(storageKeyPrefix + group, tabParam); + } + } + + // Check is a specific tab has been selected previously + let previousId = window.sessionStorage.getItem( + storageKeyPrefix + group + ); + if (previousId === id) { + // console.log( + // "sphinx-design: Selecting tab from session storage: " + id + // ); + // @ts-ignore + label.previousElementSibling.checked = true; + } + } + } + }); +} + +/** + * Activate other tabs with the same sync id. + * + * @this {HTMLElement} - The element that was clicked. + */ +function onSDLabelClick() { + let data = create_key(this); + if (!data) return; + let [group, id, key] = data; + for (const label of sd_id_to_elements[key]) { + if (label === this) continue; + // @ts-ignore + label.previousElementSibling.checked = true; + } + window.sessionStorage.setItem(storageKeyPrefix + group, id); +} + +document.addEventListener("DOMContentLoaded", ready, false); diff --git a/_sphinx_design_static/sphinx-design.min.css b/_sphinx_design_static/sphinx-design.min.css new file mode 100644 index 000000000..860c36da0 --- /dev/null +++ b/_sphinx_design_static/sphinx-design.min.css @@ -0,0 +1 @@ +.sd-bg-primary{background-color:var(--sd-color-primary) !important}.sd-bg-text-primary{color:var(--sd-color-primary-text) !important}button.sd-bg-primary:focus,button.sd-bg-primary:hover{background-color:var(--sd-color-primary-highlight) !important}a.sd-bg-primary:focus,a.sd-bg-primary:hover{background-color:var(--sd-color-primary-highlight) !important}.sd-bg-secondary{background-color:var(--sd-color-secondary) !important}.sd-bg-text-secondary{color:var(--sd-color-secondary-text) !important}button.sd-bg-secondary:focus,button.sd-bg-secondary:hover{background-color:var(--sd-color-secondary-highlight) !important}a.sd-bg-secondary:focus,a.sd-bg-secondary:hover{background-color:var(--sd-color-secondary-highlight) !important}.sd-bg-success{background-color:var(--sd-color-success) !important}.sd-bg-text-success{color:var(--sd-color-success-text) !important}button.sd-bg-success:focus,button.sd-bg-success:hover{background-color:var(--sd-color-success-highlight) !important}a.sd-bg-success:focus,a.sd-bg-success:hover{background-color:var(--sd-color-success-highlight) !important}.sd-bg-info{background-color:var(--sd-color-info) !important}.sd-bg-text-info{color:var(--sd-color-info-text) !important}button.sd-bg-info:focus,button.sd-bg-info:hover{background-color:var(--sd-color-info-highlight) !important}a.sd-bg-info:focus,a.sd-bg-info:hover{background-color:var(--sd-color-info-highlight) !important}.sd-bg-warning{background-color:var(--sd-color-warning) !important}.sd-bg-text-warning{color:var(--sd-color-warning-text) !important}button.sd-bg-warning:focus,button.sd-bg-warning:hover{background-color:var(--sd-color-warning-highlight) !important}a.sd-bg-warning:focus,a.sd-bg-warning:hover{background-color:var(--sd-color-warning-highlight) !important}.sd-bg-danger{background-color:var(--sd-color-danger) !important}.sd-bg-text-danger{color:var(--sd-color-danger-text) !important}button.sd-bg-danger:focus,button.sd-bg-danger:hover{background-color:var(--sd-color-danger-highlight) !important}a.sd-bg-danger:focus,a.sd-bg-danger:hover{background-color:var(--sd-color-danger-highlight) !important}.sd-bg-light{background-color:var(--sd-color-light) !important}.sd-bg-text-light{color:var(--sd-color-light-text) !important}button.sd-bg-light:focus,button.sd-bg-light:hover{background-color:var(--sd-color-light-highlight) !important}a.sd-bg-light:focus,a.sd-bg-light:hover{background-color:var(--sd-color-light-highlight) !important}.sd-bg-muted{background-color:var(--sd-color-muted) !important}.sd-bg-text-muted{color:var(--sd-color-muted-text) !important}button.sd-bg-muted:focus,button.sd-bg-muted:hover{background-color:var(--sd-color-muted-highlight) !important}a.sd-bg-muted:focus,a.sd-bg-muted:hover{background-color:var(--sd-color-muted-highlight) !important}.sd-bg-dark{background-color:var(--sd-color-dark) !important}.sd-bg-text-dark{color:var(--sd-color-dark-text) !important}button.sd-bg-dark:focus,button.sd-bg-dark:hover{background-color:var(--sd-color-dark-highlight) !important}a.sd-bg-dark:focus,a.sd-bg-dark:hover{background-color:var(--sd-color-dark-highlight) !important}.sd-bg-black{background-color:var(--sd-color-black) !important}.sd-bg-text-black{color:var(--sd-color-black-text) !important}button.sd-bg-black:focus,button.sd-bg-black:hover{background-color:var(--sd-color-black-highlight) !important}a.sd-bg-black:focus,a.sd-bg-black:hover{background-color:var(--sd-color-black-highlight) !important}.sd-bg-white{background-color:var(--sd-color-white) !important}.sd-bg-text-white{color:var(--sd-color-white-text) !important}button.sd-bg-white:focus,button.sd-bg-white:hover{background-color:var(--sd-color-white-highlight) !important}a.sd-bg-white:focus,a.sd-bg-white:hover{background-color:var(--sd-color-white-highlight) !important}.sd-text-primary,.sd-text-primary>p{color:var(--sd-color-primary) !important}a.sd-text-primary:focus,a.sd-text-primary:hover{color:var(--sd-color-primary-highlight) !important}.sd-text-secondary,.sd-text-secondary>p{color:var(--sd-color-secondary) !important}a.sd-text-secondary:focus,a.sd-text-secondary:hover{color:var(--sd-color-secondary-highlight) !important}.sd-text-success,.sd-text-success>p{color:var(--sd-color-success) !important}a.sd-text-success:focus,a.sd-text-success:hover{color:var(--sd-color-success-highlight) !important}.sd-text-info,.sd-text-info>p{color:var(--sd-color-info) !important}a.sd-text-info:focus,a.sd-text-info:hover{color:var(--sd-color-info-highlight) !important}.sd-text-warning,.sd-text-warning>p{color:var(--sd-color-warning) !important}a.sd-text-warning:focus,a.sd-text-warning:hover{color:var(--sd-color-warning-highlight) !important}.sd-text-danger,.sd-text-danger>p{color:var(--sd-color-danger) !important}a.sd-text-danger:focus,a.sd-text-danger:hover{color:var(--sd-color-danger-highlight) !important}.sd-text-light,.sd-text-light>p{color:var(--sd-color-light) !important}a.sd-text-light:focus,a.sd-text-light:hover{color:var(--sd-color-light-highlight) !important}.sd-text-muted,.sd-text-muted>p{color:var(--sd-color-muted) !important}a.sd-text-muted:focus,a.sd-text-muted:hover{color:var(--sd-color-muted-highlight) !important}.sd-text-dark,.sd-text-dark>p{color:var(--sd-color-dark) !important}a.sd-text-dark:focus,a.sd-text-dark:hover{color:var(--sd-color-dark-highlight) !important}.sd-text-black,.sd-text-black>p{color:var(--sd-color-black) !important}a.sd-text-black:focus,a.sd-text-black:hover{color:var(--sd-color-black-highlight) !important}.sd-text-white,.sd-text-white>p{color:var(--sd-color-white) !important}a.sd-text-white:focus,a.sd-text-white:hover{color:var(--sd-color-white-highlight) !important}.sd-outline-primary{border-color:var(--sd-color-primary) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-primary:focus,a.sd-outline-primary:hover{border-color:var(--sd-color-primary-highlight) !important}.sd-outline-secondary{border-color:var(--sd-color-secondary) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-secondary:focus,a.sd-outline-secondary:hover{border-color:var(--sd-color-secondary-highlight) !important}.sd-outline-success{border-color:var(--sd-color-success) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-success:focus,a.sd-outline-success:hover{border-color:var(--sd-color-success-highlight) !important}.sd-outline-info{border-color:var(--sd-color-info) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-info:focus,a.sd-outline-info:hover{border-color:var(--sd-color-info-highlight) !important}.sd-outline-warning{border-color:var(--sd-color-warning) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-warning:focus,a.sd-outline-warning:hover{border-color:var(--sd-color-warning-highlight) !important}.sd-outline-danger{border-color:var(--sd-color-danger) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-danger:focus,a.sd-outline-danger:hover{border-color:var(--sd-color-danger-highlight) !important}.sd-outline-light{border-color:var(--sd-color-light) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-light:focus,a.sd-outline-light:hover{border-color:var(--sd-color-light-highlight) !important}.sd-outline-muted{border-color:var(--sd-color-muted) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-muted:focus,a.sd-outline-muted:hover{border-color:var(--sd-color-muted-highlight) !important}.sd-outline-dark{border-color:var(--sd-color-dark) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-dark:focus,a.sd-outline-dark:hover{border-color:var(--sd-color-dark-highlight) !important}.sd-outline-black{border-color:var(--sd-color-black) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-black:focus,a.sd-outline-black:hover{border-color:var(--sd-color-black-highlight) !important}.sd-outline-white{border-color:var(--sd-color-white) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-white:focus,a.sd-outline-white:hover{border-color:var(--sd-color-white-highlight) !important}.sd-bg-transparent{background-color:transparent !important}.sd-outline-transparent{border-color:transparent !important}.sd-text-transparent{color:transparent !important}.sd-p-0{padding:0 !important}.sd-pt-0,.sd-py-0{padding-top:0 !important}.sd-pr-0,.sd-px-0{padding-right:0 !important}.sd-pb-0,.sd-py-0{padding-bottom:0 !important}.sd-pl-0,.sd-px-0{padding-left:0 !important}.sd-p-1{padding:.25rem !important}.sd-pt-1,.sd-py-1{padding-top:.25rem !important}.sd-pr-1,.sd-px-1{padding-right:.25rem !important}.sd-pb-1,.sd-py-1{padding-bottom:.25rem !important}.sd-pl-1,.sd-px-1{padding-left:.25rem !important}.sd-p-2{padding:.5rem !important}.sd-pt-2,.sd-py-2{padding-top:.5rem !important}.sd-pr-2,.sd-px-2{padding-right:.5rem !important}.sd-pb-2,.sd-py-2{padding-bottom:.5rem !important}.sd-pl-2,.sd-px-2{padding-left:.5rem !important}.sd-p-3{padding:1rem !important}.sd-pt-3,.sd-py-3{padding-top:1rem !important}.sd-pr-3,.sd-px-3{padding-right:1rem !important}.sd-pb-3,.sd-py-3{padding-bottom:1rem !important}.sd-pl-3,.sd-px-3{padding-left:1rem !important}.sd-p-4{padding:1.5rem !important}.sd-pt-4,.sd-py-4{padding-top:1.5rem !important}.sd-pr-4,.sd-px-4{padding-right:1.5rem !important}.sd-pb-4,.sd-py-4{padding-bottom:1.5rem !important}.sd-pl-4,.sd-px-4{padding-left:1.5rem !important}.sd-p-5{padding:3rem !important}.sd-pt-5,.sd-py-5{padding-top:3rem !important}.sd-pr-5,.sd-px-5{padding-right:3rem !important}.sd-pb-5,.sd-py-5{padding-bottom:3rem !important}.sd-pl-5,.sd-px-5{padding-left:3rem !important}.sd-m-auto{margin:auto !important}.sd-mt-auto,.sd-my-auto{margin-top:auto !important}.sd-mr-auto,.sd-mx-auto{margin-right:auto !important}.sd-mb-auto,.sd-my-auto{margin-bottom:auto !important}.sd-ml-auto,.sd-mx-auto{margin-left:auto !important}.sd-m-0{margin:0 !important}.sd-mt-0,.sd-my-0{margin-top:0 !important}.sd-mr-0,.sd-mx-0{margin-right:0 !important}.sd-mb-0,.sd-my-0{margin-bottom:0 !important}.sd-ml-0,.sd-mx-0{margin-left:0 !important}.sd-m-1{margin:.25rem !important}.sd-mt-1,.sd-my-1{margin-top:.25rem !important}.sd-mr-1,.sd-mx-1{margin-right:.25rem !important}.sd-mb-1,.sd-my-1{margin-bottom:.25rem !important}.sd-ml-1,.sd-mx-1{margin-left:.25rem !important}.sd-m-2{margin:.5rem !important}.sd-mt-2,.sd-my-2{margin-top:.5rem !important}.sd-mr-2,.sd-mx-2{margin-right:.5rem !important}.sd-mb-2,.sd-my-2{margin-bottom:.5rem !important}.sd-ml-2,.sd-mx-2{margin-left:.5rem !important}.sd-m-3{margin:1rem !important}.sd-mt-3,.sd-my-3{margin-top:1rem !important}.sd-mr-3,.sd-mx-3{margin-right:1rem !important}.sd-mb-3,.sd-my-3{margin-bottom:1rem !important}.sd-ml-3,.sd-mx-3{margin-left:1rem !important}.sd-m-4{margin:1.5rem !important}.sd-mt-4,.sd-my-4{margin-top:1.5rem !important}.sd-mr-4,.sd-mx-4{margin-right:1.5rem !important}.sd-mb-4,.sd-my-4{margin-bottom:1.5rem !important}.sd-ml-4,.sd-mx-4{margin-left:1.5rem !important}.sd-m-5{margin:3rem !important}.sd-mt-5,.sd-my-5{margin-top:3rem !important}.sd-mr-5,.sd-mx-5{margin-right:3rem !important}.sd-mb-5,.sd-my-5{margin-bottom:3rem !important}.sd-ml-5,.sd-mx-5{margin-left:3rem !important}.sd-w-25{width:25% !important}.sd-w-50{width:50% !important}.sd-w-75{width:75% !important}.sd-w-100{width:100% !important}.sd-w-auto{width:auto !important}.sd-h-25{height:25% !important}.sd-h-50{height:50% !important}.sd-h-75{height:75% !important}.sd-h-100{height:100% !important}.sd-h-auto{height:auto !important}.sd-d-none{display:none !important}.sd-d-inline{display:inline !important}.sd-d-inline-block{display:inline-block !important}.sd-d-block{display:block !important}.sd-d-grid{display:grid !important}.sd-d-flex-row{display:-ms-flexbox !important;display:flex !important;flex-direction:row !important}.sd-d-flex-column{display:-ms-flexbox !important;display:flex !important;flex-direction:column !important}.sd-d-inline-flex{display:-ms-inline-flexbox !important;display:inline-flex !important}@media(min-width: 576px){.sd-d-sm-none{display:none !important}.sd-d-sm-inline{display:inline !important}.sd-d-sm-inline-block{display:inline-block !important}.sd-d-sm-block{display:block !important}.sd-d-sm-grid{display:grid !important}.sd-d-sm-flex{display:-ms-flexbox !important;display:flex !important}.sd-d-sm-inline-flex{display:-ms-inline-flexbox !important;display:inline-flex !important}}@media(min-width: 768px){.sd-d-md-none{display:none !important}.sd-d-md-inline{display:inline !important}.sd-d-md-inline-block{display:inline-block !important}.sd-d-md-block{display:block !important}.sd-d-md-grid{display:grid !important}.sd-d-md-flex{display:-ms-flexbox !important;display:flex !important}.sd-d-md-inline-flex{display:-ms-inline-flexbox !important;display:inline-flex !important}}@media(min-width: 992px){.sd-d-lg-none{display:none !important}.sd-d-lg-inline{display:inline !important}.sd-d-lg-inline-block{display:inline-block !important}.sd-d-lg-block{display:block !important}.sd-d-lg-grid{display:grid !important}.sd-d-lg-flex{display:-ms-flexbox !important;display:flex !important}.sd-d-lg-inline-flex{display:-ms-inline-flexbox !important;display:inline-flex !important}}@media(min-width: 1200px){.sd-d-xl-none{display:none !important}.sd-d-xl-inline{display:inline !important}.sd-d-xl-inline-block{display:inline-block !important}.sd-d-xl-block{display:block !important}.sd-d-xl-grid{display:grid !important}.sd-d-xl-flex{display:-ms-flexbox !important;display:flex !important}.sd-d-xl-inline-flex{display:-ms-inline-flexbox !important;display:inline-flex !important}}.sd-align-major-start{justify-content:flex-start !important}.sd-align-major-end{justify-content:flex-end !important}.sd-align-major-center{justify-content:center !important}.sd-align-major-justify{justify-content:space-between !important}.sd-align-major-spaced{justify-content:space-evenly !important}.sd-align-minor-start{align-items:flex-start !important}.sd-align-minor-end{align-items:flex-end !important}.sd-align-minor-center{align-items:center !important}.sd-align-minor-stretch{align-items:stretch !important}.sd-text-justify{text-align:justify !important}.sd-text-left{text-align:left !important}.sd-text-right{text-align:right !important}.sd-text-center{text-align:center !important}.sd-font-weight-light{font-weight:300 !important}.sd-font-weight-lighter{font-weight:lighter !important}.sd-font-weight-normal{font-weight:400 !important}.sd-font-weight-bold{font-weight:700 !important}.sd-font-weight-bolder{font-weight:bolder !important}.sd-font-italic{font-style:italic !important}.sd-text-decoration-none{text-decoration:none !important}.sd-text-lowercase{text-transform:lowercase !important}.sd-text-uppercase{text-transform:uppercase !important}.sd-text-capitalize{text-transform:capitalize !important}.sd-text-wrap{white-space:normal !important}.sd-text-nowrap{white-space:nowrap !important}.sd-text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sd-fs-1,.sd-fs-1>p{font-size:calc(1.375rem + 1.5vw) !important;line-height:unset !important}.sd-fs-2,.sd-fs-2>p{font-size:calc(1.325rem + 0.9vw) !important;line-height:unset !important}.sd-fs-3,.sd-fs-3>p{font-size:calc(1.3rem + 0.6vw) !important;line-height:unset !important}.sd-fs-4,.sd-fs-4>p{font-size:calc(1.275rem + 0.3vw) !important;line-height:unset !important}.sd-fs-5,.sd-fs-5>p{font-size:1.25rem !important;line-height:unset !important}.sd-fs-6,.sd-fs-6>p{font-size:1rem !important;line-height:unset !important}.sd-border-0{border:0 solid !important}.sd-border-top-0{border-top:0 solid !important}.sd-border-bottom-0{border-bottom:0 solid !important}.sd-border-right-0{border-right:0 solid !important}.sd-border-left-0{border-left:0 solid !important}.sd-border-1{border:1px solid !important}.sd-border-top-1{border-top:1px solid !important}.sd-border-bottom-1{border-bottom:1px solid !important}.sd-border-right-1{border-right:1px solid !important}.sd-border-left-1{border-left:1px solid !important}.sd-border-2{border:2px solid !important}.sd-border-top-2{border-top:2px solid !important}.sd-border-bottom-2{border-bottom:2px solid !important}.sd-border-right-2{border-right:2px solid !important}.sd-border-left-2{border-left:2px solid !important}.sd-border-3{border:3px solid !important}.sd-border-top-3{border-top:3px solid !important}.sd-border-bottom-3{border-bottom:3px solid !important}.sd-border-right-3{border-right:3px solid !important}.sd-border-left-3{border-left:3px solid !important}.sd-border-4{border:4px solid !important}.sd-border-top-4{border-top:4px solid !important}.sd-border-bottom-4{border-bottom:4px solid !important}.sd-border-right-4{border-right:4px solid !important}.sd-border-left-4{border-left:4px solid !important}.sd-border-5{border:5px solid !important}.sd-border-top-5{border-top:5px solid !important}.sd-border-bottom-5{border-bottom:5px solid !important}.sd-border-right-5{border-right:5px solid !important}.sd-border-left-5{border-left:5px solid !important}.sd-rounded-0{border-radius:0 !important}.sd-rounded-1{border-radius:.2rem !important}.sd-rounded-2{border-radius:.3rem !important}.sd-rounded-3{border-radius:.5rem !important}.sd-rounded-pill{border-radius:50rem !important}.sd-rounded-circle{border-radius:50% !important}.shadow-none{box-shadow:none !important}.sd-shadow-sm{box-shadow:0 .125rem .25rem var(--sd-color-shadow) !important}.sd-shadow-md{box-shadow:0 .5rem 1rem var(--sd-color-shadow) !important}.sd-shadow-lg{box-shadow:0 1rem 3rem var(--sd-color-shadow) !important}@keyframes sd-slide-from-left{0%{transform:translateX(-100%)}100%{transform:translateX(0)}}@keyframes sd-slide-from-right{0%{transform:translateX(200%)}100%{transform:translateX(0)}}@keyframes sd-grow100{0%{transform:scale(0);opacity:.5}100%{transform:scale(1);opacity:1}}@keyframes sd-grow50{0%{transform:scale(0.5);opacity:.5}100%{transform:scale(1);opacity:1}}@keyframes sd-grow50-rot20{0%{transform:scale(0.5) rotateZ(-20deg);opacity:.5}75%{transform:scale(1) rotateZ(5deg);opacity:1}95%{transform:scale(1) rotateZ(-1deg);opacity:1}100%{transform:scale(1) rotateZ(0);opacity:1}}.sd-animate-slide-from-left{animation:1s ease-out 0s 1 normal none running sd-slide-from-left}.sd-animate-slide-from-right{animation:1s ease-out 0s 1 normal none running sd-slide-from-right}.sd-animate-grow100{animation:1s ease-out 0s 1 normal none running sd-grow100}.sd-animate-grow50{animation:1s ease-out 0s 1 normal none running sd-grow50}.sd-animate-grow50-rot20{animation:1s ease-out 0s 1 normal none running sd-grow50-rot20}.sd-badge{display:inline-block;padding:.35em .65em;font-size:.75em;font-weight:700;line-height:1;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25rem}.sd-badge:empty{display:none}a.sd-badge{text-decoration:none}.sd-btn .sd-badge{position:relative;top:-1px}.sd-btn{background-color:transparent;border:1px solid transparent;border-radius:.25rem;cursor:pointer;display:inline-block;font-weight:400;font-size:1rem;line-height:1.5;padding:.375rem .75rem;text-align:center;text-decoration:none;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;vertical-align:middle;user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none}.sd-btn:hover{text-decoration:none}@media(prefers-reduced-motion: reduce){.sd-btn{transition:none}}.sd-btn-primary,.sd-btn-outline-primary:hover,.sd-btn-outline-primary:focus{color:var(--sd-color-primary-text) !important;background-color:var(--sd-color-primary) !important;border-color:var(--sd-color-primary) !important;border-width:1px !important;border-style:solid !important}.sd-btn-primary:hover,.sd-btn-primary:focus{color:var(--sd-color-primary-text) !important;background-color:var(--sd-color-primary-highlight) !important;border-color:var(--sd-color-primary-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-primary{color:var(--sd-color-primary) !important;border-color:var(--sd-color-primary) !important;border-width:1px !important;border-style:solid !important}.sd-btn-secondary,.sd-btn-outline-secondary:hover,.sd-btn-outline-secondary:focus{color:var(--sd-color-secondary-text) !important;background-color:var(--sd-color-secondary) !important;border-color:var(--sd-color-secondary) !important;border-width:1px !important;border-style:solid !important}.sd-btn-secondary:hover,.sd-btn-secondary:focus{color:var(--sd-color-secondary-text) !important;background-color:var(--sd-color-secondary-highlight) !important;border-color:var(--sd-color-secondary-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-secondary{color:var(--sd-color-secondary) !important;border-color:var(--sd-color-secondary) !important;border-width:1px !important;border-style:solid !important}.sd-btn-success,.sd-btn-outline-success:hover,.sd-btn-outline-success:focus{color:var(--sd-color-success-text) !important;background-color:var(--sd-color-success) !important;border-color:var(--sd-color-success) !important;border-width:1px !important;border-style:solid !important}.sd-btn-success:hover,.sd-btn-success:focus{color:var(--sd-color-success-text) !important;background-color:var(--sd-color-success-highlight) !important;border-color:var(--sd-color-success-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-success{color:var(--sd-color-success) !important;border-color:var(--sd-color-success) !important;border-width:1px !important;border-style:solid !important}.sd-btn-info,.sd-btn-outline-info:hover,.sd-btn-outline-info:focus{color:var(--sd-color-info-text) !important;background-color:var(--sd-color-info) !important;border-color:var(--sd-color-info) !important;border-width:1px !important;border-style:solid !important}.sd-btn-info:hover,.sd-btn-info:focus{color:var(--sd-color-info-text) !important;background-color:var(--sd-color-info-highlight) !important;border-color:var(--sd-color-info-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-info{color:var(--sd-color-info) !important;border-color:var(--sd-color-info) !important;border-width:1px !important;border-style:solid !important}.sd-btn-warning,.sd-btn-outline-warning:hover,.sd-btn-outline-warning:focus{color:var(--sd-color-warning-text) !important;background-color:var(--sd-color-warning) !important;border-color:var(--sd-color-warning) !important;border-width:1px !important;border-style:solid !important}.sd-btn-warning:hover,.sd-btn-warning:focus{color:var(--sd-color-warning-text) !important;background-color:var(--sd-color-warning-highlight) !important;border-color:var(--sd-color-warning-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-warning{color:var(--sd-color-warning) !important;border-color:var(--sd-color-warning) !important;border-width:1px !important;border-style:solid !important}.sd-btn-danger,.sd-btn-outline-danger:hover,.sd-btn-outline-danger:focus{color:var(--sd-color-danger-text) !important;background-color:var(--sd-color-danger) !important;border-color:var(--sd-color-danger) !important;border-width:1px !important;border-style:solid !important}.sd-btn-danger:hover,.sd-btn-danger:focus{color:var(--sd-color-danger-text) !important;background-color:var(--sd-color-danger-highlight) !important;border-color:var(--sd-color-danger-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-danger{color:var(--sd-color-danger) !important;border-color:var(--sd-color-danger) !important;border-width:1px !important;border-style:solid !important}.sd-btn-light,.sd-btn-outline-light:hover,.sd-btn-outline-light:focus{color:var(--sd-color-light-text) !important;background-color:var(--sd-color-light) !important;border-color:var(--sd-color-light) !important;border-width:1px !important;border-style:solid !important}.sd-btn-light:hover,.sd-btn-light:focus{color:var(--sd-color-light-text) !important;background-color:var(--sd-color-light-highlight) !important;border-color:var(--sd-color-light-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-light{color:var(--sd-color-light) !important;border-color:var(--sd-color-light) !important;border-width:1px !important;border-style:solid !important}.sd-btn-muted,.sd-btn-outline-muted:hover,.sd-btn-outline-muted:focus{color:var(--sd-color-muted-text) !important;background-color:var(--sd-color-muted) !important;border-color:var(--sd-color-muted) !important;border-width:1px !important;border-style:solid !important}.sd-btn-muted:hover,.sd-btn-muted:focus{color:var(--sd-color-muted-text) !important;background-color:var(--sd-color-muted-highlight) !important;border-color:var(--sd-color-muted-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-muted{color:var(--sd-color-muted) !important;border-color:var(--sd-color-muted) !important;border-width:1px !important;border-style:solid !important}.sd-btn-dark,.sd-btn-outline-dark:hover,.sd-btn-outline-dark:focus{color:var(--sd-color-dark-text) !important;background-color:var(--sd-color-dark) !important;border-color:var(--sd-color-dark) !important;border-width:1px !important;border-style:solid !important}.sd-btn-dark:hover,.sd-btn-dark:focus{color:var(--sd-color-dark-text) !important;background-color:var(--sd-color-dark-highlight) !important;border-color:var(--sd-color-dark-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-dark{color:var(--sd-color-dark) !important;border-color:var(--sd-color-dark) !important;border-width:1px !important;border-style:solid !important}.sd-btn-black,.sd-btn-outline-black:hover,.sd-btn-outline-black:focus{color:var(--sd-color-black-text) !important;background-color:var(--sd-color-black) !important;border-color:var(--sd-color-black) !important;border-width:1px !important;border-style:solid !important}.sd-btn-black:hover,.sd-btn-black:focus{color:var(--sd-color-black-text) !important;background-color:var(--sd-color-black-highlight) !important;border-color:var(--sd-color-black-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-black{color:var(--sd-color-black) !important;border-color:var(--sd-color-black) !important;border-width:1px !important;border-style:solid !important}.sd-btn-white,.sd-btn-outline-white:hover,.sd-btn-outline-white:focus{color:var(--sd-color-white-text) !important;background-color:var(--sd-color-white) !important;border-color:var(--sd-color-white) !important;border-width:1px !important;border-style:solid !important}.sd-btn-white:hover,.sd-btn-white:focus{color:var(--sd-color-white-text) !important;background-color:var(--sd-color-white-highlight) !important;border-color:var(--sd-color-white-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-white{color:var(--sd-color-white) !important;border-color:var(--sd-color-white) !important;border-width:1px !important;border-style:solid !important}.sd-stretched-link::after{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;content:""}.sd-hide-link-text{font-size:0}.sd-octicon,.sd-material-icon{display:inline-block;fill:currentColor;vertical-align:middle}.sd-avatar-xs{border-radius:50%;object-fit:cover;object-position:center;width:1rem;height:1rem}.sd-avatar-sm{border-radius:50%;object-fit:cover;object-position:center;width:3rem;height:3rem}.sd-avatar-md{border-radius:50%;object-fit:cover;object-position:center;width:5rem;height:5rem}.sd-avatar-lg{border-radius:50%;object-fit:cover;object-position:center;width:7rem;height:7rem}.sd-avatar-xl{border-radius:50%;object-fit:cover;object-position:center;width:10rem;height:10rem}.sd-avatar-inherit{border-radius:50%;object-fit:cover;object-position:center;width:inherit;height:inherit}.sd-avatar-initial{border-radius:50%;object-fit:cover;object-position:center;width:initial;height:initial}.sd-card{background-clip:border-box;background-color:var(--sd-color-card-background);border:1px solid var(--sd-color-card-border);border-radius:.25rem;color:var(--sd-color-card-text);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;min-width:0;position:relative;word-wrap:break-word}.sd-card>hr{margin-left:0;margin-right:0}.sd-card-hover:hover{border-color:var(--sd-color-card-border-hover);transform:scale(1.01)}.sd-card-body{-ms-flex:1 1 auto;flex:1 1 auto;padding:1rem 1rem}.sd-card-title{margin-bottom:.5rem}.sd-card-subtitle{margin-top:-0.25rem;margin-bottom:0}.sd-card-text:last-child{margin-bottom:0}.sd-card-link:hover{text-decoration:none}.sd-card-link+.card-link{margin-left:1rem}.sd-card-header{padding:.5rem 1rem;margin-bottom:0;background-color:var(--sd-color-card-header);border-bottom:1px solid var(--sd-color-card-border)}.sd-card-header:first-child{border-radius:calc(0.25rem - 1px) calc(0.25rem - 1px) 0 0}.sd-card-footer{padding:.5rem 1rem;background-color:var(--sd-color-card-footer);border-top:1px solid var(--sd-color-card-border)}.sd-card-footer:last-child{border-radius:0 0 calc(0.25rem - 1px) calc(0.25rem - 1px)}.sd-card-header-tabs{margin-right:-0.5rem;margin-bottom:-0.5rem;margin-left:-0.5rem;border-bottom:0}.sd-card-header-pills{margin-right:-0.5rem;margin-left:-0.5rem}.sd-card-img-overlay{position:absolute;top:0;right:0;bottom:0;left:0;padding:1rem;border-radius:calc(0.25rem - 1px)}.sd-card-img,.sd-card-img-bottom,.sd-card-img-top{width:100%}.sd-card-img,.sd-card-img-top{border-top-left-radius:calc(0.25rem - 1px);border-top-right-radius:calc(0.25rem - 1px)}.sd-card-img,.sd-card-img-bottom{border-bottom-left-radius:calc(0.25rem - 1px);border-bottom-right-radius:calc(0.25rem - 1px)}.sd-cards-carousel{width:100%;display:flex;flex-wrap:nowrap;-ms-flex-direction:row;flex-direction:row;overflow-x:hidden;scroll-snap-type:x mandatory}.sd-cards-carousel.sd-show-scrollbar{overflow-x:auto}.sd-cards-carousel:hover,.sd-cards-carousel:focus{overflow-x:auto}.sd-cards-carousel>.sd-card{flex-shrink:0;scroll-snap-align:start}.sd-cards-carousel>.sd-card:not(:last-child){margin-right:3px}.sd-card-cols-1>.sd-card{width:90%}.sd-card-cols-2>.sd-card{width:45%}.sd-card-cols-3>.sd-card{width:30%}.sd-card-cols-4>.sd-card{width:22.5%}.sd-card-cols-5>.sd-card{width:18%}.sd-card-cols-6>.sd-card{width:15%}.sd-card-cols-7>.sd-card{width:12.8571428571%}.sd-card-cols-8>.sd-card{width:11.25%}.sd-card-cols-9>.sd-card{width:10%}.sd-card-cols-10>.sd-card{width:9%}.sd-card-cols-11>.sd-card{width:8.1818181818%}.sd-card-cols-12>.sd-card{width:7.5%}.sd-container,.sd-container-fluid,.sd-container-lg,.sd-container-md,.sd-container-sm,.sd-container-xl{margin-left:auto;margin-right:auto;padding-left:var(--sd-gutter-x, 0.75rem);padding-right:var(--sd-gutter-x, 0.75rem);width:100%}@media(min-width: 576px){.sd-container-sm,.sd-container{max-width:540px}}@media(min-width: 768px){.sd-container-md,.sd-container-sm,.sd-container{max-width:720px}}@media(min-width: 992px){.sd-container-lg,.sd-container-md,.sd-container-sm,.sd-container{max-width:960px}}@media(min-width: 1200px){.sd-container-xl,.sd-container-lg,.sd-container-md,.sd-container-sm,.sd-container{max-width:1140px}}.sd-row{--sd-gutter-x: 1.5rem;--sd-gutter-y: 0;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-top:calc(var(--sd-gutter-y) * -1);margin-right:calc(var(--sd-gutter-x) * -0.5);margin-left:calc(var(--sd-gutter-x) * -0.5)}.sd-row>*{box-sizing:border-box;flex-shrink:0;width:100%;max-width:100%;padding-right:calc(var(--sd-gutter-x) * 0.5);padding-left:calc(var(--sd-gutter-x) * 0.5);margin-top:var(--sd-gutter-y)}.sd-col{flex:1 0 0%;-ms-flex:1 0 0%}.sd-row-cols-auto>*{flex:0 0 auto;width:auto}.sd-row-cols-1>*{flex:0 0 auto;-ms-flex:0 0 auto;width:100%}.sd-row-cols-2>*{flex:0 0 auto;-ms-flex:0 0 auto;width:50%}.sd-row-cols-3>*{flex:0 0 auto;-ms-flex:0 0 auto;width:33.3333333333%}.sd-row-cols-4>*{flex:0 0 auto;-ms-flex:0 0 auto;width:25%}.sd-row-cols-5>*{flex:0 0 auto;-ms-flex:0 0 auto;width:20%}.sd-row-cols-6>*{flex:0 0 auto;-ms-flex:0 0 auto;width:16.6666666667%}.sd-row-cols-7>*{flex:0 0 auto;-ms-flex:0 0 auto;width:14.2857142857%}.sd-row-cols-8>*{flex:0 0 auto;-ms-flex:0 0 auto;width:12.5%}.sd-row-cols-9>*{flex:0 0 auto;-ms-flex:0 0 auto;width:11.1111111111%}.sd-row-cols-10>*{flex:0 0 auto;-ms-flex:0 0 auto;width:10%}.sd-row-cols-11>*{flex:0 0 auto;-ms-flex:0 0 auto;width:9.0909090909%}.sd-row-cols-12>*{flex:0 0 auto;-ms-flex:0 0 auto;width:8.3333333333%}@media(min-width: 576px){.sd-col-sm{flex:1 0 0%;-ms-flex:1 0 0%}.sd-row-cols-sm-auto{flex:1 0 auto;-ms-flex:1 0 auto;width:100%}.sd-row-cols-sm-1>*{flex:0 0 auto;-ms-flex:0 0 auto;width:100%}.sd-row-cols-sm-2>*{flex:0 0 auto;-ms-flex:0 0 auto;width:50%}.sd-row-cols-sm-3>*{flex:0 0 auto;-ms-flex:0 0 auto;width:33.3333333333%}.sd-row-cols-sm-4>*{flex:0 0 auto;-ms-flex:0 0 auto;width:25%}.sd-row-cols-sm-5>*{flex:0 0 auto;-ms-flex:0 0 auto;width:20%}.sd-row-cols-sm-6>*{flex:0 0 auto;-ms-flex:0 0 auto;width:16.6666666667%}.sd-row-cols-sm-7>*{flex:0 0 auto;-ms-flex:0 0 auto;width:14.2857142857%}.sd-row-cols-sm-8>*{flex:0 0 auto;-ms-flex:0 0 auto;width:12.5%}.sd-row-cols-sm-9>*{flex:0 0 auto;-ms-flex:0 0 auto;width:11.1111111111%}.sd-row-cols-sm-10>*{flex:0 0 auto;-ms-flex:0 0 auto;width:10%}.sd-row-cols-sm-11>*{flex:0 0 auto;-ms-flex:0 0 auto;width:9.0909090909%}.sd-row-cols-sm-12>*{flex:0 0 auto;-ms-flex:0 0 auto;width:8.3333333333%}}@media(min-width: 768px){.sd-col-md{flex:1 0 0%;-ms-flex:1 0 0%}.sd-row-cols-md-auto{flex:1 0 auto;-ms-flex:1 0 auto;width:100%}.sd-row-cols-md-1>*{flex:0 0 auto;-ms-flex:0 0 auto;width:100%}.sd-row-cols-md-2>*{flex:0 0 auto;-ms-flex:0 0 auto;width:50%}.sd-row-cols-md-3>*{flex:0 0 auto;-ms-flex:0 0 auto;width:33.3333333333%}.sd-row-cols-md-4>*{flex:0 0 auto;-ms-flex:0 0 auto;width:25%}.sd-row-cols-md-5>*{flex:0 0 auto;-ms-flex:0 0 auto;width:20%}.sd-row-cols-md-6>*{flex:0 0 auto;-ms-flex:0 0 auto;width:16.6666666667%}.sd-row-cols-md-7>*{flex:0 0 auto;-ms-flex:0 0 auto;width:14.2857142857%}.sd-row-cols-md-8>*{flex:0 0 auto;-ms-flex:0 0 auto;width:12.5%}.sd-row-cols-md-9>*{flex:0 0 auto;-ms-flex:0 0 auto;width:11.1111111111%}.sd-row-cols-md-10>*{flex:0 0 auto;-ms-flex:0 0 auto;width:10%}.sd-row-cols-md-11>*{flex:0 0 auto;-ms-flex:0 0 auto;width:9.0909090909%}.sd-row-cols-md-12>*{flex:0 0 auto;-ms-flex:0 0 auto;width:8.3333333333%}}@media(min-width: 992px){.sd-col-lg{flex:1 0 0%;-ms-flex:1 0 0%}.sd-row-cols-lg-auto{flex:1 0 auto;-ms-flex:1 0 auto;width:100%}.sd-row-cols-lg-1>*{flex:0 0 auto;-ms-flex:0 0 auto;width:100%}.sd-row-cols-lg-2>*{flex:0 0 auto;-ms-flex:0 0 auto;width:50%}.sd-row-cols-lg-3>*{flex:0 0 auto;-ms-flex:0 0 auto;width:33.3333333333%}.sd-row-cols-lg-4>*{flex:0 0 auto;-ms-flex:0 0 auto;width:25%}.sd-row-cols-lg-5>*{flex:0 0 auto;-ms-flex:0 0 auto;width:20%}.sd-row-cols-lg-6>*{flex:0 0 auto;-ms-flex:0 0 auto;width:16.6666666667%}.sd-row-cols-lg-7>*{flex:0 0 auto;-ms-flex:0 0 auto;width:14.2857142857%}.sd-row-cols-lg-8>*{flex:0 0 auto;-ms-flex:0 0 auto;width:12.5%}.sd-row-cols-lg-9>*{flex:0 0 auto;-ms-flex:0 0 auto;width:11.1111111111%}.sd-row-cols-lg-10>*{flex:0 0 auto;-ms-flex:0 0 auto;width:10%}.sd-row-cols-lg-11>*{flex:0 0 auto;-ms-flex:0 0 auto;width:9.0909090909%}.sd-row-cols-lg-12>*{flex:0 0 auto;-ms-flex:0 0 auto;width:8.3333333333%}}@media(min-width: 1200px){.sd-col-xl{flex:1 0 0%;-ms-flex:1 0 0%}.sd-row-cols-xl-auto{flex:1 0 auto;-ms-flex:1 0 auto;width:100%}.sd-row-cols-xl-1>*{flex:0 0 auto;-ms-flex:0 0 auto;width:100%}.sd-row-cols-xl-2>*{flex:0 0 auto;-ms-flex:0 0 auto;width:50%}.sd-row-cols-xl-3>*{flex:0 0 auto;-ms-flex:0 0 auto;width:33.3333333333%}.sd-row-cols-xl-4>*{flex:0 0 auto;-ms-flex:0 0 auto;width:25%}.sd-row-cols-xl-5>*{flex:0 0 auto;-ms-flex:0 0 auto;width:20%}.sd-row-cols-xl-6>*{flex:0 0 auto;-ms-flex:0 0 auto;width:16.6666666667%}.sd-row-cols-xl-7>*{flex:0 0 auto;-ms-flex:0 0 auto;width:14.2857142857%}.sd-row-cols-xl-8>*{flex:0 0 auto;-ms-flex:0 0 auto;width:12.5%}.sd-row-cols-xl-9>*{flex:0 0 auto;-ms-flex:0 0 auto;width:11.1111111111%}.sd-row-cols-xl-10>*{flex:0 0 auto;-ms-flex:0 0 auto;width:10%}.sd-row-cols-xl-11>*{flex:0 0 auto;-ms-flex:0 0 auto;width:9.0909090909%}.sd-row-cols-xl-12>*{flex:0 0 auto;-ms-flex:0 0 auto;width:8.3333333333%}}.sd-col-auto{flex:0 0 auto;-ms-flex:0 0 auto;width:auto}.sd-col-1{flex:0 0 auto;-ms-flex:0 0 auto;width:8.3333333333%}.sd-col-2{flex:0 0 auto;-ms-flex:0 0 auto;width:16.6666666667%}.sd-col-3{flex:0 0 auto;-ms-flex:0 0 auto;width:25%}.sd-col-4{flex:0 0 auto;-ms-flex:0 0 auto;width:33.3333333333%}.sd-col-5{flex:0 0 auto;-ms-flex:0 0 auto;width:41.6666666667%}.sd-col-6{flex:0 0 auto;-ms-flex:0 0 auto;width:50%}.sd-col-7{flex:0 0 auto;-ms-flex:0 0 auto;width:58.3333333333%}.sd-col-8{flex:0 0 auto;-ms-flex:0 0 auto;width:66.6666666667%}.sd-col-9{flex:0 0 auto;-ms-flex:0 0 auto;width:75%}.sd-col-10{flex:0 0 auto;-ms-flex:0 0 auto;width:83.3333333333%}.sd-col-11{flex:0 0 auto;-ms-flex:0 0 auto;width:91.6666666667%}.sd-col-12{flex:0 0 auto;-ms-flex:0 0 auto;width:100%}.sd-g-0,.sd-gy-0{--sd-gutter-y: 0}.sd-g-0,.sd-gx-0{--sd-gutter-x: 0}.sd-g-1,.sd-gy-1{--sd-gutter-y: 0.25rem}.sd-g-1,.sd-gx-1{--sd-gutter-x: 0.25rem}.sd-g-2,.sd-gy-2{--sd-gutter-y: 0.5rem}.sd-g-2,.sd-gx-2{--sd-gutter-x: 0.5rem}.sd-g-3,.sd-gy-3{--sd-gutter-y: 1rem}.sd-g-3,.sd-gx-3{--sd-gutter-x: 1rem}.sd-g-4,.sd-gy-4{--sd-gutter-y: 1.5rem}.sd-g-4,.sd-gx-4{--sd-gutter-x: 1.5rem}.sd-g-5,.sd-gy-5{--sd-gutter-y: 3rem}.sd-g-5,.sd-gx-5{--sd-gutter-x: 3rem}@media(min-width: 576px){.sd-col-sm-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.sd-col-sm-1{-ms-flex:0 0 auto;flex:0 0 auto;width:8.3333333333%}.sd-col-sm-2{-ms-flex:0 0 auto;flex:0 0 auto;width:16.6666666667%}.sd-col-sm-3{-ms-flex:0 0 auto;flex:0 0 auto;width:25%}.sd-col-sm-4{-ms-flex:0 0 auto;flex:0 0 auto;width:33.3333333333%}.sd-col-sm-5{-ms-flex:0 0 auto;flex:0 0 auto;width:41.6666666667%}.sd-col-sm-6{-ms-flex:0 0 auto;flex:0 0 auto;width:50%}.sd-col-sm-7{-ms-flex:0 0 auto;flex:0 0 auto;width:58.3333333333%}.sd-col-sm-8{-ms-flex:0 0 auto;flex:0 0 auto;width:66.6666666667%}.sd-col-sm-9{-ms-flex:0 0 auto;flex:0 0 auto;width:75%}.sd-col-sm-10{-ms-flex:0 0 auto;flex:0 0 auto;width:83.3333333333%}.sd-col-sm-11{-ms-flex:0 0 auto;flex:0 0 auto;width:91.6666666667%}.sd-col-sm-12{-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.sd-g-sm-0,.sd-gy-sm-0{--sd-gutter-y: 0}.sd-g-sm-0,.sd-gx-sm-0{--sd-gutter-x: 0}.sd-g-sm-1,.sd-gy-sm-1{--sd-gutter-y: 0.25rem}.sd-g-sm-1,.sd-gx-sm-1{--sd-gutter-x: 0.25rem}.sd-g-sm-2,.sd-gy-sm-2{--sd-gutter-y: 0.5rem}.sd-g-sm-2,.sd-gx-sm-2{--sd-gutter-x: 0.5rem}.sd-g-sm-3,.sd-gy-sm-3{--sd-gutter-y: 1rem}.sd-g-sm-3,.sd-gx-sm-3{--sd-gutter-x: 1rem}.sd-g-sm-4,.sd-gy-sm-4{--sd-gutter-y: 1.5rem}.sd-g-sm-4,.sd-gx-sm-4{--sd-gutter-x: 1.5rem}.sd-g-sm-5,.sd-gy-sm-5{--sd-gutter-y: 3rem}.sd-g-sm-5,.sd-gx-sm-5{--sd-gutter-x: 3rem}}@media(min-width: 768px){.sd-col-md-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.sd-col-md-1{-ms-flex:0 0 auto;flex:0 0 auto;width:8.3333333333%}.sd-col-md-2{-ms-flex:0 0 auto;flex:0 0 auto;width:16.6666666667%}.sd-col-md-3{-ms-flex:0 0 auto;flex:0 0 auto;width:25%}.sd-col-md-4{-ms-flex:0 0 auto;flex:0 0 auto;width:33.3333333333%}.sd-col-md-5{-ms-flex:0 0 auto;flex:0 0 auto;width:41.6666666667%}.sd-col-md-6{-ms-flex:0 0 auto;flex:0 0 auto;width:50%}.sd-col-md-7{-ms-flex:0 0 auto;flex:0 0 auto;width:58.3333333333%}.sd-col-md-8{-ms-flex:0 0 auto;flex:0 0 auto;width:66.6666666667%}.sd-col-md-9{-ms-flex:0 0 auto;flex:0 0 auto;width:75%}.sd-col-md-10{-ms-flex:0 0 auto;flex:0 0 auto;width:83.3333333333%}.sd-col-md-11{-ms-flex:0 0 auto;flex:0 0 auto;width:91.6666666667%}.sd-col-md-12{-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.sd-g-md-0,.sd-gy-md-0{--sd-gutter-y: 0}.sd-g-md-0,.sd-gx-md-0{--sd-gutter-x: 0}.sd-g-md-1,.sd-gy-md-1{--sd-gutter-y: 0.25rem}.sd-g-md-1,.sd-gx-md-1{--sd-gutter-x: 0.25rem}.sd-g-md-2,.sd-gy-md-2{--sd-gutter-y: 0.5rem}.sd-g-md-2,.sd-gx-md-2{--sd-gutter-x: 0.5rem}.sd-g-md-3,.sd-gy-md-3{--sd-gutter-y: 1rem}.sd-g-md-3,.sd-gx-md-3{--sd-gutter-x: 1rem}.sd-g-md-4,.sd-gy-md-4{--sd-gutter-y: 1.5rem}.sd-g-md-4,.sd-gx-md-4{--sd-gutter-x: 1.5rem}.sd-g-md-5,.sd-gy-md-5{--sd-gutter-y: 3rem}.sd-g-md-5,.sd-gx-md-5{--sd-gutter-x: 3rem}}@media(min-width: 992px){.sd-col-lg-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.sd-col-lg-1{-ms-flex:0 0 auto;flex:0 0 auto;width:8.3333333333%}.sd-col-lg-2{-ms-flex:0 0 auto;flex:0 0 auto;width:16.6666666667%}.sd-col-lg-3{-ms-flex:0 0 auto;flex:0 0 auto;width:25%}.sd-col-lg-4{-ms-flex:0 0 auto;flex:0 0 auto;width:33.3333333333%}.sd-col-lg-5{-ms-flex:0 0 auto;flex:0 0 auto;width:41.6666666667%}.sd-col-lg-6{-ms-flex:0 0 auto;flex:0 0 auto;width:50%}.sd-col-lg-7{-ms-flex:0 0 auto;flex:0 0 auto;width:58.3333333333%}.sd-col-lg-8{-ms-flex:0 0 auto;flex:0 0 auto;width:66.6666666667%}.sd-col-lg-9{-ms-flex:0 0 auto;flex:0 0 auto;width:75%}.sd-col-lg-10{-ms-flex:0 0 auto;flex:0 0 auto;width:83.3333333333%}.sd-col-lg-11{-ms-flex:0 0 auto;flex:0 0 auto;width:91.6666666667%}.sd-col-lg-12{-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.sd-g-lg-0,.sd-gy-lg-0{--sd-gutter-y: 0}.sd-g-lg-0,.sd-gx-lg-0{--sd-gutter-x: 0}.sd-g-lg-1,.sd-gy-lg-1{--sd-gutter-y: 0.25rem}.sd-g-lg-1,.sd-gx-lg-1{--sd-gutter-x: 0.25rem}.sd-g-lg-2,.sd-gy-lg-2{--sd-gutter-y: 0.5rem}.sd-g-lg-2,.sd-gx-lg-2{--sd-gutter-x: 0.5rem}.sd-g-lg-3,.sd-gy-lg-3{--sd-gutter-y: 1rem}.sd-g-lg-3,.sd-gx-lg-3{--sd-gutter-x: 1rem}.sd-g-lg-4,.sd-gy-lg-4{--sd-gutter-y: 1.5rem}.sd-g-lg-4,.sd-gx-lg-4{--sd-gutter-x: 1.5rem}.sd-g-lg-5,.sd-gy-lg-5{--sd-gutter-y: 3rem}.sd-g-lg-5,.sd-gx-lg-5{--sd-gutter-x: 3rem}}@media(min-width: 1200px){.sd-col-xl-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.sd-col-xl-1{-ms-flex:0 0 auto;flex:0 0 auto;width:8.3333333333%}.sd-col-xl-2{-ms-flex:0 0 auto;flex:0 0 auto;width:16.6666666667%}.sd-col-xl-3{-ms-flex:0 0 auto;flex:0 0 auto;width:25%}.sd-col-xl-4{-ms-flex:0 0 auto;flex:0 0 auto;width:33.3333333333%}.sd-col-xl-5{-ms-flex:0 0 auto;flex:0 0 auto;width:41.6666666667%}.sd-col-xl-6{-ms-flex:0 0 auto;flex:0 0 auto;width:50%}.sd-col-xl-7{-ms-flex:0 0 auto;flex:0 0 auto;width:58.3333333333%}.sd-col-xl-8{-ms-flex:0 0 auto;flex:0 0 auto;width:66.6666666667%}.sd-col-xl-9{-ms-flex:0 0 auto;flex:0 0 auto;width:75%}.sd-col-xl-10{-ms-flex:0 0 auto;flex:0 0 auto;width:83.3333333333%}.sd-col-xl-11{-ms-flex:0 0 auto;flex:0 0 auto;width:91.6666666667%}.sd-col-xl-12{-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.sd-g-xl-0,.sd-gy-xl-0{--sd-gutter-y: 0}.sd-g-xl-0,.sd-gx-xl-0{--sd-gutter-x: 0}.sd-g-xl-1,.sd-gy-xl-1{--sd-gutter-y: 0.25rem}.sd-g-xl-1,.sd-gx-xl-1{--sd-gutter-x: 0.25rem}.sd-g-xl-2,.sd-gy-xl-2{--sd-gutter-y: 0.5rem}.sd-g-xl-2,.sd-gx-xl-2{--sd-gutter-x: 0.5rem}.sd-g-xl-3,.sd-gy-xl-3{--sd-gutter-y: 1rem}.sd-g-xl-3,.sd-gx-xl-3{--sd-gutter-x: 1rem}.sd-g-xl-4,.sd-gy-xl-4{--sd-gutter-y: 1.5rem}.sd-g-xl-4,.sd-gx-xl-4{--sd-gutter-x: 1.5rem}.sd-g-xl-5,.sd-gy-xl-5{--sd-gutter-y: 3rem}.sd-g-xl-5,.sd-gx-xl-5{--sd-gutter-x: 3rem}}.sd-flex-row-reverse{flex-direction:row-reverse !important}details.sd-dropdown{position:relative;font-size:var(--sd-fontsize-dropdown)}details.sd-dropdown:hover{cursor:pointer}details.sd-dropdown .sd-summary-content{cursor:default}details.sd-dropdown summary.sd-summary-title{padding:.5em .6em .5em 1em;font-size:var(--sd-fontsize-dropdown-title);font-weight:var(--sd-fontweight-dropdown-title);user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;list-style:none;display:inline-flex;justify-content:space-between}details.sd-dropdown summary.sd-summary-title::-webkit-details-marker{display:none}details.sd-dropdown summary.sd-summary-title:focus{outline:none}details.sd-dropdown summary.sd-summary-title .sd-summary-icon{margin-right:.6em;display:inline-flex;align-items:center}details.sd-dropdown summary.sd-summary-title .sd-summary-icon svg{opacity:.8}details.sd-dropdown summary.sd-summary-title .sd-summary-text{flex-grow:1;line-height:1.5;padding-right:.5rem}details.sd-dropdown summary.sd-summary-title .sd-summary-state-marker{pointer-events:none;display:inline-flex;align-items:center}details.sd-dropdown summary.sd-summary-title .sd-summary-state-marker svg{opacity:.6}details.sd-dropdown summary.sd-summary-title:hover .sd-summary-state-marker svg{opacity:1;transform:scale(1.1)}details.sd-dropdown[open] summary .sd-octicon.no-title{visibility:hidden}details.sd-dropdown .sd-summary-chevron-right{transition:.25s}details.sd-dropdown[open]>.sd-summary-title .sd-summary-chevron-right{transform:rotate(90deg)}details.sd-dropdown[open]>.sd-summary-title .sd-summary-chevron-down{transform:rotate(180deg)}details.sd-dropdown:not([open]).sd-card{border:none}details.sd-dropdown:not([open])>.sd-card-header{border:1px solid var(--sd-color-card-border);border-radius:.25rem}details.sd-dropdown.sd-fade-in[open] summary~*{-moz-animation:sd-fade-in .5s ease-in-out;-webkit-animation:sd-fade-in .5s ease-in-out;animation:sd-fade-in .5s ease-in-out}details.sd-dropdown.sd-fade-in-slide-down[open] summary~*{-moz-animation:sd-fade-in .5s ease-in-out,sd-slide-down .5s ease-in-out;-webkit-animation:sd-fade-in .5s ease-in-out,sd-slide-down .5s ease-in-out;animation:sd-fade-in .5s ease-in-out,sd-slide-down .5s ease-in-out}.sd-col>.sd-dropdown{width:100%}.sd-summary-content>.sd-tab-set:first-child{margin-top:0}@keyframes sd-fade-in{0%{opacity:0}100%{opacity:1}}@keyframes sd-slide-down{0%{transform:translate(0, -10px)}100%{transform:translate(0, 0)}}.sd-tab-set{border-radius:.125rem;display:flex;flex-wrap:wrap;margin:1em 0;position:relative}.sd-tab-set>input{opacity:0;position:absolute}.sd-tab-set>input:checked+label{border-color:var(--sd-color-tabs-underline-active);color:var(--sd-color-tabs-label-active)}.sd-tab-set>input:checked+label+.sd-tab-content{display:block}.sd-tab-set>input:not(:checked)+label:hover{color:var(--sd-color-tabs-label-hover);border-color:var(--sd-color-tabs-underline-hover)}.sd-tab-set>input:focus+label{outline-style:auto}.sd-tab-set>input:not(.focus-visible)+label{outline:none;-webkit-tap-highlight-color:transparent}.sd-tab-set>label{border-bottom:.125rem solid transparent;margin-bottom:0;color:var(--sd-color-tabs-label-inactive);border-color:var(--sd-color-tabs-underline-inactive);cursor:pointer;font-size:var(--sd-fontsize-tabs-label);font-weight:700;padding:1em 1.25em .5em;transition:color 250ms;width:auto;z-index:1}html .sd-tab-set>label:hover{color:var(--sd-color-tabs-label-active)}.sd-col>.sd-tab-set{width:100%}.sd-tab-content{box-shadow:0 -0.0625rem var(--sd-color-tabs-overline),0 .0625rem var(--sd-color-tabs-underline);display:none;order:99;padding-bottom:.75rem;padding-top:.75rem;width:100%}.sd-tab-content>:first-child{margin-top:0 !important}.sd-tab-content>:last-child{margin-bottom:0 !important}.sd-tab-content>.sd-tab-set{margin:0}.sd-sphinx-override,.sd-sphinx-override *{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.sd-sphinx-override p{margin-top:0}:root{--sd-color-primary: #0071bc;--sd-color-secondary: #6c757d;--sd-color-success: #28a745;--sd-color-info: #17a2b8;--sd-color-warning: #f0b37e;--sd-color-danger: #dc3545;--sd-color-light: #f8f9fa;--sd-color-muted: #6c757d;--sd-color-dark: #212529;--sd-color-black: black;--sd-color-white: white;--sd-color-primary-highlight: #0060a0;--sd-color-secondary-highlight: #5c636a;--sd-color-success-highlight: #228e3b;--sd-color-info-highlight: #148a9c;--sd-color-warning-highlight: #cc986b;--sd-color-danger-highlight: #bb2d3b;--sd-color-light-highlight: #d3d4d5;--sd-color-muted-highlight: #5c636a;--sd-color-dark-highlight: #1c1f23;--sd-color-black-highlight: black;--sd-color-white-highlight: #d9d9d9;--sd-color-primary-bg: rgba(0, 113, 188, 0.2);--sd-color-secondary-bg: rgba(108, 117, 125, 0.2);--sd-color-success-bg: rgba(40, 167, 69, 0.2);--sd-color-info-bg: rgba(23, 162, 184, 0.2);--sd-color-warning-bg: rgba(240, 179, 126, 0.2);--sd-color-danger-bg: rgba(220, 53, 69, 0.2);--sd-color-light-bg: rgba(248, 249, 250, 0.2);--sd-color-muted-bg: rgba(108, 117, 125, 0.2);--sd-color-dark-bg: rgba(33, 37, 41, 0.2);--sd-color-black-bg: rgba(0, 0, 0, 0.2);--sd-color-white-bg: rgba(255, 255, 255, 0.2);--sd-color-primary-text: #fff;--sd-color-secondary-text: #fff;--sd-color-success-text: #fff;--sd-color-info-text: #fff;--sd-color-warning-text: #212529;--sd-color-danger-text: #fff;--sd-color-light-text: #212529;--sd-color-muted-text: #fff;--sd-color-dark-text: #fff;--sd-color-black-text: #fff;--sd-color-white-text: #212529;--sd-color-shadow: rgba(0, 0, 0, 0.15);--sd-color-card-border: rgba(0, 0, 0, 0.125);--sd-color-card-border-hover: hsla(231, 99%, 66%, 1);--sd-color-card-background: transparent;--sd-color-card-text: inherit;--sd-color-card-header: transparent;--sd-color-card-footer: transparent;--sd-color-tabs-label-active: hsla(231, 99%, 66%, 1);--sd-color-tabs-label-hover: hsla(231, 99%, 66%, 1);--sd-color-tabs-label-inactive: hsl(0, 0%, 66%);--sd-color-tabs-underline-active: hsla(231, 99%, 66%, 1);--sd-color-tabs-underline-hover: rgba(178, 206, 245, 0.62);--sd-color-tabs-underline-inactive: transparent;--sd-color-tabs-overline: rgb(222, 222, 222);--sd-color-tabs-underline: rgb(222, 222, 222);--sd-fontsize-tabs-label: 1rem;--sd-fontsize-dropdown: inherit;--sd-fontsize-dropdown-title: 1rem;--sd-fontweight-dropdown-title: 700} diff --git a/_static/basic.css b/_static/basic.css new file mode 100644 index 000000000..2a9e4114a --- /dev/null +++ b/_static/basic.css @@ -0,0 +1,914 @@ +/* + * Sphinx stylesheet -- basic theme. + */ + +/* -- main layout ----------------------------------------------------------- */ + +div.clearer { + clear: both; +} + +div.section::after { + display: block; + content: ''; + clear: left; +} + +/* -- relbar ---------------------------------------------------------------- */ + +div.related { + width: 100%; + font-size: 90%; +} + +div.related h3 { + display: none; +} + +div.related ul { + margin: 0; + padding: 0 0 0 10px; + list-style: none; +} + +div.related li { + display: inline; +} + +div.related li.right { + float: right; + margin-right: 5px; +} + +/* -- sidebar --------------------------------------------------------------- */ + +div.sphinxsidebarwrapper { + padding: 10px 5px 0 10px; +} + +div.sphinxsidebar { + float: left; + width: 270px; + margin-left: -100%; + font-size: 90%; + word-wrap: break-word; + overflow-wrap : break-word; +} + +div.sphinxsidebar ul { + list-style: none; +} + +div.sphinxsidebar ul ul, +div.sphinxsidebar ul.want-points { + margin-left: 20px; + list-style: square; +} + +div.sphinxsidebar ul ul { + margin-top: 0; + margin-bottom: 0; +} + +div.sphinxsidebar form { + margin-top: 10px; +} + +div.sphinxsidebar input { + border: 1px solid #98dbcc; + font-family: sans-serif; + font-size: 1em; +} + +div.sphinxsidebar #searchbox form.search { + overflow: hidden; +} + +div.sphinxsidebar #searchbox input[type="text"] { + float: left; + width: 80%; + padding: 0.25em; + box-sizing: border-box; +} + +div.sphinxsidebar #searchbox input[type="submit"] { + float: left; + width: 20%; + border-left: none; + padding: 0.25em; + box-sizing: border-box; +} + + +img { + border: 0; + max-width: 100%; +} + +/* -- search page ----------------------------------------------------------- */ + +ul.search { + margin-top: 10px; +} + +ul.search li { + padding: 5px 0; +} + +ul.search li a { + font-weight: bold; +} + +ul.search li p.context { + color: #888; + margin: 2px 0 0 30px; + text-align: left; +} + +ul.keywordmatches li.goodmatch a { + font-weight: bold; +} + +/* -- index page ------------------------------------------------------------ */ + +table.contentstable { + width: 90%; + margin-left: auto; + margin-right: auto; +} + +table.contentstable p.biglink { + line-height: 150%; +} + +a.biglink { + font-size: 1.3em; +} + +span.linkdescr { + font-style: italic; + padding-top: 5px; + font-size: 90%; +} + +/* -- general index --------------------------------------------------------- */ + +table.indextable { + width: 100%; +} + +table.indextable td { + text-align: left; + vertical-align: top; +} + +table.indextable ul { + margin-top: 0; + margin-bottom: 0; + list-style-type: none; +} + +table.indextable > tbody > tr > td > ul { + padding-left: 0em; +} + +table.indextable tr.pcap { + height: 10px; +} + +table.indextable tr.cap { + margin-top: 10px; + background-color: #f2f2f2; +} + +img.toggler { + margin-right: 3px; + margin-top: 3px; + cursor: pointer; +} + +div.modindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +div.genindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +/* -- domain module index --------------------------------------------------- */ + +table.modindextable td { + padding: 2px; + border-collapse: collapse; +} + +/* -- general body styles --------------------------------------------------- */ + +div.body { + min-width: 360px; + max-width: 800px; +} + +div.body p, div.body dd, div.body li, div.body blockquote { + -moz-hyphens: auto; + -ms-hyphens: auto; + -webkit-hyphens: auto; + hyphens: auto; +} + +a.headerlink { + visibility: hidden; +} + +a:visited { + color: #551A8B; +} + +h1:hover > a.headerlink, +h2:hover > a.headerlink, +h3:hover > a.headerlink, +h4:hover > a.headerlink, +h5:hover > a.headerlink, +h6:hover > a.headerlink, +dt:hover > a.headerlink, +caption:hover > a.headerlink, +p.caption:hover > a.headerlink, +div.code-block-caption:hover > a.headerlink { + visibility: visible; +} + +div.body p.caption { + text-align: inherit; +} + +div.body td { + text-align: left; +} + +.first { + margin-top: 0 !important; +} + +p.rubric { + margin-top: 30px; + font-weight: bold; +} + +img.align-left, figure.align-left, .figure.align-left, object.align-left { + clear: left; + float: left; + margin-right: 1em; +} + +img.align-right, figure.align-right, .figure.align-right, object.align-right { + clear: right; + float: right; + margin-left: 1em; +} + +img.align-center, figure.align-center, .figure.align-center, object.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + +img.align-default, figure.align-default, .figure.align-default { + display: block; + margin-left: auto; + margin-right: auto; +} + +.align-left { + text-align: left; +} + +.align-center { + text-align: center; +} + +.align-default { + text-align: center; +} + +.align-right { + text-align: right; +} + +/* -- sidebars -------------------------------------------------------------- */ + +div.sidebar, +aside.sidebar { + margin: 0 0 0.5em 1em; + border: 1px solid #ddb; + padding: 7px; + background-color: #ffe; + width: 40%; + float: right; + clear: right; + overflow-x: auto; +} + +p.sidebar-title { + font-weight: bold; +} + +nav.contents, +aside.topic, +div.admonition, div.topic, blockquote { + clear: left; +} + +/* -- topics ---------------------------------------------------------------- */ + +nav.contents, +aside.topic, +div.topic { + border: 1px solid #ccc; + padding: 7px; + margin: 10px 0 10px 0; +} + +p.topic-title { + font-size: 1.1em; + font-weight: bold; + margin-top: 10px; +} + +/* -- admonitions ----------------------------------------------------------- */ + +div.admonition { + margin-top: 10px; + margin-bottom: 10px; + padding: 7px; +} + +div.admonition dt { + font-weight: bold; +} + +p.admonition-title { + margin: 0px 10px 5px 0px; + font-weight: bold; +} + +div.body p.centered { + text-align: center; + margin-top: 25px; +} + +/* -- content of sidebars/topics/admonitions -------------------------------- */ + +div.sidebar > :last-child, +aside.sidebar > :last-child, +nav.contents > :last-child, +aside.topic > :last-child, +div.topic > :last-child, +div.admonition > :last-child { + margin-bottom: 0; +} + +div.sidebar::after, +aside.sidebar::after, +nav.contents::after, +aside.topic::after, +div.topic::after, +div.admonition::after, +blockquote::after { + display: block; + content: ''; + clear: both; +} + +/* -- tables ---------------------------------------------------------------- */ + +table.docutils { + margin-top: 10px; + margin-bottom: 10px; + border: 0; + border-collapse: collapse; +} + +table.align-center { + margin-left: auto; + margin-right: auto; +} + +table.align-default { + margin-left: auto; + margin-right: auto; +} + +table caption span.caption-number { + font-style: italic; +} + +table caption span.caption-text { +} + +table.docutils td, table.docutils th { + padding: 1px 8px 1px 5px; + border-top: 0; + border-left: 0; + border-right: 0; + border-bottom: 1px solid #aaa; +} + +th { + text-align: left; + padding-right: 5px; +} + +table.citation { + border-left: solid 1px gray; + margin-left: 1px; +} + +table.citation td { + border-bottom: none; +} + +th > :first-child, +td > :first-child { + margin-top: 0px; +} + +th > :last-child, +td > :last-child { + margin-bottom: 0px; +} + +/* -- figures --------------------------------------------------------------- */ + +div.figure, figure { + margin: 0.5em; + padding: 0.5em; +} + +div.figure p.caption, figcaption { + padding: 0.3em; +} + +div.figure p.caption span.caption-number, +figcaption span.caption-number { + font-style: italic; +} + +div.figure p.caption span.caption-text, +figcaption span.caption-text { +} + +/* -- field list styles ----------------------------------------------------- */ + +table.field-list td, table.field-list th { + border: 0 !important; +} + +.field-list ul { + margin: 0; + padding-left: 1em; +} + +.field-list p { + margin: 0; +} + +.field-name { + -moz-hyphens: manual; + -ms-hyphens: manual; + -webkit-hyphens: manual; + hyphens: manual; +} + +/* -- hlist styles ---------------------------------------------------------- */ + +table.hlist { + margin: 1em 0; +} + +table.hlist td { + vertical-align: top; +} + +/* -- object description styles --------------------------------------------- */ + +.sig { + font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace; +} + +.sig-name, code.descname { + background-color: transparent; + font-weight: bold; +} + +.sig-name { + font-size: 1.1em; +} + +code.descname { + font-size: 1.2em; +} + +.sig-prename, code.descclassname { + background-color: transparent; +} + +.optional { + font-size: 1.3em; +} + +.sig-paren { + font-size: larger; +} + +.sig-param.n { + font-style: italic; +} + +/* C++ specific styling */ + +.sig-inline.c-texpr, +.sig-inline.cpp-texpr { + font-family: unset; +} + +.sig.c .k, .sig.c .kt, +.sig.cpp .k, .sig.cpp .kt { + color: #0033B3; +} + +.sig.c .m, +.sig.cpp .m { + color: #1750EB; +} + +.sig.c .s, .sig.c .sc, +.sig.cpp .s, .sig.cpp .sc { + color: #067D17; +} + + +/* -- other body styles ----------------------------------------------------- */ + +ol.arabic { + list-style: decimal; +} + +ol.loweralpha { + list-style: lower-alpha; +} + +ol.upperalpha { + list-style: upper-alpha; +} + +ol.lowerroman { + list-style: lower-roman; +} + +ol.upperroman { + list-style: upper-roman; +} + +:not(li) > ol > li:first-child > :first-child, +:not(li) > ul > li:first-child > :first-child { + margin-top: 0px; +} + +:not(li) > ol > li:last-child > :last-child, +:not(li) > ul > li:last-child > :last-child { + margin-bottom: 0px; +} + +ol.simple ol p, +ol.simple ul p, +ul.simple ol p, +ul.simple ul p { + margin-top: 0; +} + +ol.simple > li:not(:first-child) > p, +ul.simple > li:not(:first-child) > p { + margin-top: 0; +} + +ol.simple p, +ul.simple p { + margin-bottom: 0; +} + +aside.footnote > span, +div.citation > span { + float: left; +} +aside.footnote > span:last-of-type, +div.citation > span:last-of-type { + padding-right: 0.5em; +} +aside.footnote > p { + margin-left: 2em; +} +div.citation > p { + margin-left: 4em; +} +aside.footnote > p:last-of-type, +div.citation > p:last-of-type { + margin-bottom: 0em; +} +aside.footnote > p:last-of-type:after, +div.citation > p:last-of-type:after { + content: ""; + clear: both; +} + +dl.field-list { + display: grid; + grid-template-columns: fit-content(30%) auto; +} + +dl.field-list > dt { + font-weight: bold; + word-break: break-word; + padding-left: 0.5em; + padding-right: 5px; +} + +dl.field-list > dd { + padding-left: 0.5em; + margin-top: 0em; + margin-left: 0em; + margin-bottom: 0em; +} + +dl { + margin-bottom: 15px; +} + +dd > :first-child { + margin-top: 0px; +} + +dd ul, dd table { + margin-bottom: 10px; +} + +dd { + margin-top: 3px; + margin-bottom: 10px; + margin-left: 30px; +} + +.sig dd { + margin-top: 0px; + margin-bottom: 0px; +} + +.sig dl { + margin-top: 0px; + margin-bottom: 0px; +} + +dl > dd:last-child, +dl > dd:last-child > :last-child { + margin-bottom: 0; +} + +dt:target, span.highlighted { + background-color: #fbe54e; +} + +rect.highlighted { + fill: #fbe54e; +} + +dl.glossary dt { + font-weight: bold; + font-size: 1.1em; +} + +.versionmodified { + font-style: italic; +} + +.system-message { + background-color: #fda; + padding: 5px; + border: 3px solid red; +} + +.footnote:target { + background-color: #ffa; +} + +.line-block { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} + +.line-block .line-block { + margin-top: 0; + margin-bottom: 0; + margin-left: 1.5em; +} + +.guilabel, .menuselection { + font-family: sans-serif; +} + +.accelerator { + text-decoration: underline; +} + +.classifier { + font-style: oblique; +} + +.classifier:before { + font-style: normal; + margin: 0 0.5em; + content: ":"; + display: inline-block; +} + +abbr, acronym { + border-bottom: dotted 1px; + cursor: help; +} + +.translated { + background-color: rgba(207, 255, 207, 0.2) +} + +.untranslated { + background-color: rgba(255, 207, 207, 0.2) +} + +/* -- code displays --------------------------------------------------------- */ + +pre { + overflow: auto; + overflow-y: hidden; /* fixes display issues on Chrome browsers */ +} + +pre, div[class*="highlight-"] { + clear: both; +} + +span.pre { + -moz-hyphens: none; + -ms-hyphens: none; + -webkit-hyphens: none; + hyphens: none; + white-space: nowrap; +} + +div[class*="highlight-"] { + margin: 1em 0; +} + +td.linenos pre { + border: 0; + background-color: transparent; + color: #aaa; +} + +table.highlighttable { + display: block; +} + +table.highlighttable tbody { + display: block; +} + +table.highlighttable tr { + display: flex; +} + +table.highlighttable td { + margin: 0; + padding: 0; +} + +table.highlighttable td.linenos { + padding-right: 0.5em; +} + +table.highlighttable td.code { + flex: 1; + overflow: hidden; +} + +.highlight .hll { + display: block; +} + +div.highlight pre, +table.highlighttable pre { + margin: 0; +} + +div.code-block-caption + div { + margin-top: 0; +} + +div.code-block-caption { + margin-top: 1em; + padding: 2px 5px; + font-size: small; +} + +div.code-block-caption code { + background-color: transparent; +} + +table.highlighttable td.linenos, +span.linenos, +div.highlight span.gp { /* gp: Generic.Prompt */ + user-select: none; + -webkit-user-select: text; /* Safari fallback only */ + -webkit-user-select: none; /* Chrome/Safari */ + -moz-user-select: none; /* Firefox */ + -ms-user-select: none; /* IE10+ */ +} + +div.code-block-caption span.caption-number { + padding: 0.1em 0.3em; + font-style: italic; +} + +div.code-block-caption span.caption-text { +} + +div.literal-block-wrapper { + margin: 1em 0; +} + +code.xref, a code { + background-color: transparent; + font-weight: bold; +} + +h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { + background-color: transparent; +} + +.viewcode-link { + float: right; +} + +.viewcode-back { + float: right; + font-family: sans-serif; +} + +div.viewcode-block:target { + margin: -1px -10px; + padding: 0 10px; +} + +/* -- math display ---------------------------------------------------------- */ + +img.math { + vertical-align: middle; +} + +div.body div.math p { + text-align: center; +} + +span.eqno { + float: right; +} + +span.eqno a.headerlink { + position: absolute; + z-index: 1; +} + +div.math:hover a.headerlink { + visibility: visible; +} + +/* -- printout stylesheet --------------------------------------------------- */ + +@media print { + div.document, + div.documentwrapper, + div.bodywrapper { + margin: 0 !important; + width: 100%; + } + + div.sphinxsidebar, + div.related, + div.footer, + #top-link { + display: none; + } +} \ No newline at end of file diff --git a/_static/check-solid.svg b/_static/check-solid.svg new file mode 100644 index 000000000..92fad4b5c --- /dev/null +++ b/_static/check-solid.svg @@ -0,0 +1,4 @@ + + + + diff --git a/_static/clipboard.min.js b/_static/clipboard.min.js new file mode 100644 index 000000000..54b3c4638 --- /dev/null +++ b/_static/clipboard.min.js @@ -0,0 +1,7 @@ +/*! + * clipboard.js v2.0.8 + * https://clipboardjs.com/ + * + * Licensed MIT © Zeno Rocha + */ +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return n={686:function(t,e,n){"use strict";n.d(e,{default:function(){return o}});var e=n(279),i=n.n(e),e=n(370),u=n.n(e),e=n(817),c=n.n(e);function a(t){try{return document.execCommand(t)}catch(t){return}}var f=function(t){t=c()(t);return a("cut"),t};var l=function(t){var e,n,o,r=1 + + + + diff --git a/_static/copybutton.css b/_static/copybutton.css new file mode 100644 index 000000000..f1916ec7d --- /dev/null +++ b/_static/copybutton.css @@ -0,0 +1,94 @@ +/* Copy buttons */ +button.copybtn { + position: absolute; + display: flex; + top: .3em; + right: .3em; + width: 1.7em; + height: 1.7em; + opacity: 0; + transition: opacity 0.3s, border .3s, background-color .3s; + user-select: none; + padding: 0; + border: none; + outline: none; + border-radius: 0.4em; + /* The colors that GitHub uses */ + border: #1b1f2426 1px solid; + background-color: #f6f8fa; + color: #57606a; +} + +button.copybtn.success { + border-color: #22863a; + color: #22863a; +} + +button.copybtn svg { + stroke: currentColor; + width: 1.5em; + height: 1.5em; + padding: 0.1em; +} + +div.highlight { + position: relative; +} + +/* Show the copybutton */ +.highlight:hover button.copybtn, button.copybtn.success { + opacity: 1; +} + +.highlight button.copybtn:hover { + background-color: rgb(235, 235, 235); +} + +.highlight button.copybtn:active { + background-color: rgb(187, 187, 187); +} + +/** + * A minimal CSS-only tooltip copied from: + * https://codepen.io/mildrenben/pen/rVBrpK + * + * To use, write HTML like the following: + * + *

Short

+ */ + .o-tooltip--left { + position: relative; + } + + .o-tooltip--left:after { + opacity: 0; + visibility: hidden; + position: absolute; + content: attr(data-tooltip); + padding: .2em; + font-size: .8em; + left: -.2em; + background: grey; + color: white; + white-space: nowrap; + z-index: 2; + border-radius: 2px; + transform: translateX(-102%) translateY(0); + transition: opacity 0.2s cubic-bezier(0.64, 0.09, 0.08, 1), transform 0.2s cubic-bezier(0.64, 0.09, 0.08, 1); +} + +.o-tooltip--left:hover:after { + display: block; + opacity: 1; + visibility: visible; + transform: translateX(-100%) translateY(0); + transition: opacity 0.2s cubic-bezier(0.64, 0.09, 0.08, 1), transform 0.2s cubic-bezier(0.64, 0.09, 0.08, 1); + transition-delay: .5s; +} + +/* By default the copy button shouldn't show up when printing a page */ +@media print { + button.copybtn { + display: none; + } +} diff --git a/_static/copybutton.js b/_static/copybutton.js new file mode 100644 index 000000000..2ea7ff3e2 --- /dev/null +++ b/_static/copybutton.js @@ -0,0 +1,248 @@ +// Localization support +const messages = { + 'en': { + 'copy': 'Copy', + 'copy_to_clipboard': 'Copy to clipboard', + 'copy_success': 'Copied!', + 'copy_failure': 'Failed to copy', + }, + 'es' : { + 'copy': 'Copiar', + 'copy_to_clipboard': 'Copiar al portapapeles', + 'copy_success': '¡Copiado!', + 'copy_failure': 'Error al copiar', + }, + 'de' : { + 'copy': 'Kopieren', + 'copy_to_clipboard': 'In die Zwischenablage kopieren', + 'copy_success': 'Kopiert!', + 'copy_failure': 'Fehler beim Kopieren', + }, + 'fr' : { + 'copy': 'Copier', + 'copy_to_clipboard': 'Copier dans le presse-papier', + 'copy_success': 'Copié !', + 'copy_failure': 'Échec de la copie', + }, + 'ru': { + 'copy': 'Скопировать', + 'copy_to_clipboard': 'Скопировать в буфер', + 'copy_success': 'Скопировано!', + 'copy_failure': 'Не удалось скопировать', + }, + 'zh-CN': { + 'copy': '复制', + 'copy_to_clipboard': '复制到剪贴板', + 'copy_success': '复制成功!', + 'copy_failure': '复制失败', + }, + 'it' : { + 'copy': 'Copiare', + 'copy_to_clipboard': 'Copiato negli appunti', + 'copy_success': 'Copiato!', + 'copy_failure': 'Errore durante la copia', + } +} + +let locale = 'en' +if( document.documentElement.lang !== undefined + && messages[document.documentElement.lang] !== undefined ) { + locale = document.documentElement.lang +} + +let doc_url_root = DOCUMENTATION_OPTIONS.URL_ROOT; +if (doc_url_root == '#') { + doc_url_root = ''; +} + +/** + * SVG files for our copy buttons + */ +let iconCheck = ` + ${messages[locale]['copy_success']} + + +` + +// If the user specified their own SVG use that, otherwise use the default +let iconCopy = ``; +if (!iconCopy) { + iconCopy = ` + ${messages[locale]['copy_to_clipboard']} + + + +` +} + +/** + * Set up copy/paste for code blocks + */ + +const runWhenDOMLoaded = cb => { + if (document.readyState != 'loading') { + cb() + } else if (document.addEventListener) { + document.addEventListener('DOMContentLoaded', cb) + } else { + document.attachEvent('onreadystatechange', function() { + if (document.readyState == 'complete') cb() + }) + } +} + +const codeCellId = index => `codecell${index}` + +// Clears selected text since ClipboardJS will select the text when copying +const clearSelection = () => { + if (window.getSelection) { + window.getSelection().removeAllRanges() + } else if (document.selection) { + document.selection.empty() + } +} + +// Changes tooltip text for a moment, then changes it back +// We want the timeout of our `success` class to be a bit shorter than the +// tooltip and icon change, so that we can hide the icon before changing back. +var timeoutIcon = 2000; +var timeoutSuccessClass = 1500; + +const temporarilyChangeTooltip = (el, oldText, newText) => { + el.setAttribute('data-tooltip', newText) + el.classList.add('success') + // Remove success a little bit sooner than we change the tooltip + // So that we can use CSS to hide the copybutton first + setTimeout(() => el.classList.remove('success'), timeoutSuccessClass) + setTimeout(() => el.setAttribute('data-tooltip', oldText), timeoutIcon) +} + +// Changes the copy button icon for two seconds, then changes it back +const temporarilyChangeIcon = (el) => { + el.innerHTML = iconCheck; + setTimeout(() => {el.innerHTML = iconCopy}, timeoutIcon) +} + +const addCopyButtonToCodeCells = () => { + // If ClipboardJS hasn't loaded, wait a bit and try again. This + // happens because we load ClipboardJS asynchronously. + if (window.ClipboardJS === undefined) { + setTimeout(addCopyButtonToCodeCells, 250) + return + } + + // Add copybuttons to all of our code cells + const COPYBUTTON_SELECTOR = 'div.highlight pre'; + const codeCells = document.querySelectorAll(COPYBUTTON_SELECTOR) + codeCells.forEach((codeCell, index) => { + const id = codeCellId(index) + codeCell.setAttribute('id', id) + + const clipboardButton = id => + `` + codeCell.insertAdjacentHTML('afterend', clipboardButton(id)) + }) + +function escapeRegExp(string) { + return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string +} + +/** + * Removes excluded text from a Node. + * + * @param {Node} target Node to filter. + * @param {string} exclude CSS selector of nodes to exclude. + * @returns {DOMString} Text from `target` with text removed. + */ +function filterText(target, exclude) { + const clone = target.cloneNode(true); // clone as to not modify the live DOM + if (exclude) { + // remove excluded nodes + clone.querySelectorAll(exclude).forEach(node => node.remove()); + } + return clone.innerText; +} + +// Callback when a copy button is clicked. Will be passed the node that was clicked +// should then grab the text and replace pieces of text that shouldn't be used in output +function formatCopyText(textContent, copybuttonPromptText, isRegexp = false, onlyCopyPromptLines = true, removePrompts = true, copyEmptyLines = true, lineContinuationChar = "", hereDocDelim = "") { + var regexp; + var match; + + // Do we check for line continuation characters and "HERE-documents"? + var useLineCont = !!lineContinuationChar + var useHereDoc = !!hereDocDelim + + // create regexp to capture prompt and remaining line + if (isRegexp) { + regexp = new RegExp('^(' + copybuttonPromptText + ')(.*)') + } else { + regexp = new RegExp('^(' + escapeRegExp(copybuttonPromptText) + ')(.*)') + } + + const outputLines = []; + var promptFound = false; + var gotLineCont = false; + var gotHereDoc = false; + const lineGotPrompt = []; + for (const line of textContent.split('\n')) { + match = line.match(regexp) + if (match || gotLineCont || gotHereDoc) { + promptFound = regexp.test(line) + lineGotPrompt.push(promptFound) + if (removePrompts && promptFound) { + outputLines.push(match[2]) + } else { + outputLines.push(line) + } + gotLineCont = line.endsWith(lineContinuationChar) & useLineCont + if (line.includes(hereDocDelim) & useHereDoc) + gotHereDoc = !gotHereDoc + } else if (!onlyCopyPromptLines) { + outputLines.push(line) + } else if (copyEmptyLines && line.trim() === '') { + outputLines.push(line) + } + } + + // If no lines with the prompt were found then just use original lines + if (lineGotPrompt.some(v => v === true)) { + textContent = outputLines.join('\n'); + } + + // Remove a trailing newline to avoid auto-running when pasting + if (textContent.endsWith("\n")) { + textContent = textContent.slice(0, -1) + } + return textContent +} + + +var copyTargetText = (trigger) => { + var target = document.querySelector(trigger.attributes['data-clipboard-target'].value); + + // get filtered text + let exclude = '.linenos'; + + let text = filterText(target, exclude); + return formatCopyText(text, '', false, true, true, true, '', '') +} + + // Initialize with a callback so we can modify the text before copy + const clipboard = new ClipboardJS('.copybtn', {text: copyTargetText}) + + // Update UI with error/success messages + clipboard.on('success', event => { + clearSelection() + temporarilyChangeTooltip(event.trigger, messages[locale]['copy'], messages[locale]['copy_success']) + temporarilyChangeIcon(event.trigger) + }) + + clipboard.on('error', event => { + temporarilyChangeTooltip(event.trigger, messages[locale]['copy'], messages[locale]['copy_failure']) + }) +} + +runWhenDOMLoaded(addCopyButtonToCodeCells) \ No newline at end of file diff --git a/_static/copybutton_funcs.js b/_static/copybutton_funcs.js new file mode 100644 index 000000000..dbe1aaad7 --- /dev/null +++ b/_static/copybutton_funcs.js @@ -0,0 +1,73 @@ +function escapeRegExp(string) { + return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string +} + +/** + * Removes excluded text from a Node. + * + * @param {Node} target Node to filter. + * @param {string} exclude CSS selector of nodes to exclude. + * @returns {DOMString} Text from `target` with text removed. + */ +export function filterText(target, exclude) { + const clone = target.cloneNode(true); // clone as to not modify the live DOM + if (exclude) { + // remove excluded nodes + clone.querySelectorAll(exclude).forEach(node => node.remove()); + } + return clone.innerText; +} + +// Callback when a copy button is clicked. Will be passed the node that was clicked +// should then grab the text and replace pieces of text that shouldn't be used in output +export function formatCopyText(textContent, copybuttonPromptText, isRegexp = false, onlyCopyPromptLines = true, removePrompts = true, copyEmptyLines = true, lineContinuationChar = "", hereDocDelim = "") { + var regexp; + var match; + + // Do we check for line continuation characters and "HERE-documents"? + var useLineCont = !!lineContinuationChar + var useHereDoc = !!hereDocDelim + + // create regexp to capture prompt and remaining line + if (isRegexp) { + regexp = new RegExp('^(' + copybuttonPromptText + ')(.*)') + } else { + regexp = new RegExp('^(' + escapeRegExp(copybuttonPromptText) + ')(.*)') + } + + const outputLines = []; + var promptFound = false; + var gotLineCont = false; + var gotHereDoc = false; + const lineGotPrompt = []; + for (const line of textContent.split('\n')) { + match = line.match(regexp) + if (match || gotLineCont || gotHereDoc) { + promptFound = regexp.test(line) + lineGotPrompt.push(promptFound) + if (removePrompts && promptFound) { + outputLines.push(match[2]) + } else { + outputLines.push(line) + } + gotLineCont = line.endsWith(lineContinuationChar) & useLineCont + if (line.includes(hereDocDelim) & useHereDoc) + gotHereDoc = !gotHereDoc + } else if (!onlyCopyPromptLines) { + outputLines.push(line) + } else if (copyEmptyLines && line.trim() === '') { + outputLines.push(line) + } + } + + // If no lines with the prompt were found then just use original lines + if (lineGotPrompt.some(v => v === true)) { + textContent = outputLines.join('\n'); + } + + // Remove a trailing newline to avoid auto-running when pasting + if (textContent.endsWith("\n")) { + textContent = textContent.slice(0, -1) + } + return textContent +} diff --git a/_static/design-tabs.js b/_static/design-tabs.js new file mode 100644 index 000000000..b25bd6a4f --- /dev/null +++ b/_static/design-tabs.js @@ -0,0 +1,101 @@ +// @ts-check + +// Extra JS capability for selected tabs to be synced +// The selection is stored in local storage so that it persists across page loads. + +/** + * @type {Record} + */ +let sd_id_to_elements = {}; +const storageKeyPrefix = "sphinx-design-tab-id-"; + +/** + * Create a key for a tab element. + * @param {HTMLElement} el - The tab element. + * @returns {[string, string, string] | null} - The key. + * + */ +function create_key(el) { + let syncId = el.getAttribute("data-sync-id"); + let syncGroup = el.getAttribute("data-sync-group"); + if (!syncId || !syncGroup) return null; + return [syncGroup, syncId, syncGroup + "--" + syncId]; +} + +/** + * Initialize the tab selection. + * + */ +function ready() { + // Find all tabs with sync data + + /** @type {string[]} */ + let groups = []; + + document.querySelectorAll(".sd-tab-label").forEach((label) => { + if (label instanceof HTMLElement) { + let data = create_key(label); + if (data) { + let [group, id, key] = data; + + // add click event listener + // @ts-ignore + label.onclick = onSDLabelClick; + + // store map of key to elements + if (!sd_id_to_elements[key]) { + sd_id_to_elements[key] = []; + } + sd_id_to_elements[key].push(label); + + if (groups.indexOf(group) === -1) { + groups.push(group); + // Check if a specific tab has been selected via URL parameter + const tabParam = new URLSearchParams(window.location.search).get( + group + ); + if (tabParam) { + console.log( + "sphinx-design: Selecting tab id for group '" + + group + + "' from URL parameter: " + + tabParam + ); + window.sessionStorage.setItem(storageKeyPrefix + group, tabParam); + } + } + + // Check is a specific tab has been selected previously + let previousId = window.sessionStorage.getItem( + storageKeyPrefix + group + ); + if (previousId === id) { + // console.log( + // "sphinx-design: Selecting tab from session storage: " + id + // ); + // @ts-ignore + label.previousElementSibling.checked = true; + } + } + } + }); +} + +/** + * Activate other tabs with the same sync id. + * + * @this {HTMLElement} - The element that was clicked. + */ +function onSDLabelClick() { + let data = create_key(this); + if (!data) return; + let [group, id, key] = data; + for (const label of sd_id_to_elements[key]) { + if (label === this) continue; + // @ts-ignore + label.previousElementSibling.checked = true; + } + window.sessionStorage.setItem(storageKeyPrefix + group, id); +} + +document.addEventListener("DOMContentLoaded", ready, false); diff --git a/_static/doctools.js b/_static/doctools.js new file mode 100644 index 000000000..0398ebb9f --- /dev/null +++ b/_static/doctools.js @@ -0,0 +1,149 @@ +/* + * Base JavaScript utilities for all Sphinx HTML documentation. + */ +"use strict"; + +const BLACKLISTED_KEY_CONTROL_ELEMENTS = new Set([ + "TEXTAREA", + "INPUT", + "SELECT", + "BUTTON", +]); + +const _ready = (callback) => { + if (document.readyState !== "loading") { + callback(); + } else { + document.addEventListener("DOMContentLoaded", callback); + } +}; + +/** + * Small JavaScript module for the documentation. + */ +const Documentation = { + init: () => { + Documentation.initDomainIndexTable(); + Documentation.initOnKeyListeners(); + }, + + /** + * i18n support + */ + TRANSLATIONS: {}, + PLURAL_EXPR: (n) => (n === 1 ? 0 : 1), + LOCALE: "unknown", + + // gettext and ngettext don't access this so that the functions + // can safely bound to a different name (_ = Documentation.gettext) + gettext: (string) => { + const translated = Documentation.TRANSLATIONS[string]; + switch (typeof translated) { + case "undefined": + return string; // no translation + case "string": + return translated; // translation exists + default: + return translated[0]; // (singular, plural) translation tuple exists + } + }, + + ngettext: (singular, plural, n) => { + const translated = Documentation.TRANSLATIONS[singular]; + if (typeof translated !== "undefined") + return translated[Documentation.PLURAL_EXPR(n)]; + return n === 1 ? singular : plural; + }, + + addTranslations: (catalog) => { + Object.assign(Documentation.TRANSLATIONS, catalog.messages); + Documentation.PLURAL_EXPR = new Function( + "n", + `return (${catalog.plural_expr})` + ); + Documentation.LOCALE = catalog.locale; + }, + + /** + * helper function to focus on search bar + */ + focusSearchBar: () => { + document.querySelectorAll("input[name=q]")[0]?.focus(); + }, + + /** + * Initialise the domain index toggle buttons + */ + initDomainIndexTable: () => { + const toggler = (el) => { + const idNumber = el.id.substr(7); + const toggledRows = document.querySelectorAll(`tr.cg-${idNumber}`); + if (el.src.substr(-9) === "minus.png") { + el.src = `${el.src.substr(0, el.src.length - 9)}plus.png`; + toggledRows.forEach((el) => (el.style.display = "none")); + } else { + el.src = `${el.src.substr(0, el.src.length - 8)}minus.png`; + toggledRows.forEach((el) => (el.style.display = "")); + } + }; + + const togglerElements = document.querySelectorAll("img.toggler"); + togglerElements.forEach((el) => + el.addEventListener("click", (event) => toggler(event.currentTarget)) + ); + togglerElements.forEach((el) => (el.style.display = "")); + if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) togglerElements.forEach(toggler); + }, + + initOnKeyListeners: () => { + // only install a listener if it is really needed + if ( + !DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS && + !DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS + ) + return; + + document.addEventListener("keydown", (event) => { + // bail for input elements + if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return; + // bail with special keys + if (event.altKey || event.ctrlKey || event.metaKey) return; + + if (!event.shiftKey) { + switch (event.key) { + case "ArrowLeft": + if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; + + const prevLink = document.querySelector('link[rel="prev"]'); + if (prevLink && prevLink.href) { + window.location.href = prevLink.href; + event.preventDefault(); + } + break; + case "ArrowRight": + if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; + + const nextLink = document.querySelector('link[rel="next"]'); + if (nextLink && nextLink.href) { + window.location.href = nextLink.href; + event.preventDefault(); + } + break; + } + } + + // some keyboard layouts may need Shift to get / + switch (event.key) { + case "/": + if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) break; + Documentation.focusSearchBar(); + event.preventDefault(); + } + }); + }, +}; + +// quick alias for translations +const _ = Documentation.gettext; + +_ready(Documentation.init); diff --git a/_static/documentation_options.js b/_static/documentation_options.js new file mode 100644 index 000000000..c6be1024f --- /dev/null +++ b/_static/documentation_options.js @@ -0,0 +1,13 @@ +const DOCUMENTATION_OPTIONS = { + VERSION: 'latest', + LANGUAGE: 'en', + COLLAPSE_INDEX: false, + BUILDER: 'html', + FILE_SUFFIX: '.html', + LINK_SUFFIX: '.html', + HAS_SOURCE: false, + SOURCELINK_SUFFIX: '.txt', + NAVIGATION_WITH_KEYS: false, + SHOW_SEARCH_SUMMARY: true, + ENABLE_SEARCH_SHORTCUTS: true, +}; \ No newline at end of file diff --git a/_static/econ-ark-logo.png b/_static/econ-ark-logo.png new file mode 100644 index 000000000..e9db35a23 Binary files /dev/null and b/_static/econ-ark-logo.png differ diff --git a/_static/file.png b/_static/file.png new file mode 100644 index 000000000..a858a410e Binary files /dev/null and b/_static/file.png differ diff --git a/_static/language_data.js b/_static/language_data.js new file mode 100644 index 000000000..c7fe6c6fa --- /dev/null +++ b/_static/language_data.js @@ -0,0 +1,192 @@ +/* + * This script contains the language-specific data used by searchtools.js, + * namely the list of stopwords, stemmer, scorer and splitter. + */ + +var stopwords = ["a", "and", "are", "as", "at", "be", "but", "by", "for", "if", "in", "into", "is", "it", "near", "no", "not", "of", "on", "or", "such", "that", "the", "their", "then", "there", "these", "they", "this", "to", "was", "will", "with"]; + + +/* Non-minified version is copied as a separate JS file, if available */ + +/** + * Porter Stemmer + */ +var Stemmer = function() { + + var step2list = { + ational: 'ate', + tional: 'tion', + enci: 'ence', + anci: 'ance', + izer: 'ize', + bli: 'ble', + alli: 'al', + entli: 'ent', + eli: 'e', + ousli: 'ous', + ization: 'ize', + ation: 'ate', + ator: 'ate', + alism: 'al', + iveness: 'ive', + fulness: 'ful', + ousness: 'ous', + aliti: 'al', + iviti: 'ive', + biliti: 'ble', + logi: 'log' + }; + + var step3list = { + icate: 'ic', + ative: '', + alize: 'al', + iciti: 'ic', + ical: 'ic', + ful: '', + ness: '' + }; + + var c = "[^aeiou]"; // consonant + var v = "[aeiouy]"; // vowel + var C = c + "[^aeiouy]*"; // consonant sequence + var V = v + "[aeiou]*"; // vowel sequence + + var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0 + var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1 + var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1 + var s_v = "^(" + C + ")?" + v; // vowel in stem + + this.stemWord = function (w) { + var stem; + var suffix; + var firstch; + var origword = w; + + if (w.length < 3) + return w; + + var re; + var re2; + var re3; + var re4; + + firstch = w.substr(0,1); + if (firstch == "y") + w = firstch.toUpperCase() + w.substr(1); + + // Step 1a + re = /^(.+?)(ss|i)es$/; + re2 = /^(.+?)([^s])s$/; + + if (re.test(w)) + w = w.replace(re,"$1$2"); + else if (re2.test(w)) + w = w.replace(re2,"$1$2"); + + // Step 1b + re = /^(.+?)eed$/; + re2 = /^(.+?)(ed|ing)$/; + if (re.test(w)) { + var fp = re.exec(w); + re = new RegExp(mgr0); + if (re.test(fp[1])) { + re = /.$/; + w = w.replace(re,""); + } + } + else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1]; + re2 = new RegExp(s_v); + if (re2.test(stem)) { + w = stem; + re2 = /(at|bl|iz)$/; + re3 = new RegExp("([^aeiouylsz])\\1$"); + re4 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + if (re2.test(w)) + w = w + "e"; + else if (re3.test(w)) { + re = /.$/; + w = w.replace(re,""); + } + else if (re4.test(w)) + w = w + "e"; + } + } + + // Step 1c + re = /^(.+?)y$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(s_v); + if (re.test(stem)) + w = stem + "i"; + } + + // Step 2 + re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = new RegExp(mgr0); + if (re.test(stem)) + w = stem + step2list[suffix]; + } + + // Step 3 + re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = new RegExp(mgr0); + if (re.test(stem)) + w = stem + step3list[suffix]; + } + + // Step 4 + re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; + re2 = /^(.+?)(s|t)(ion)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(mgr1); + if (re.test(stem)) + w = stem; + } + else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1] + fp[2]; + re2 = new RegExp(mgr1); + if (re2.test(stem)) + w = stem; + } + + // Step 5 + re = /^(.+?)e$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(mgr1); + re2 = new RegExp(meq1); + re3 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) + w = stem; + } + re = /ll$/; + re2 = new RegExp(mgr1); + if (re.test(w) && re2.test(w)) { + re = /.$/; + w = w.replace(re,""); + } + + // and turn initial Y back to y + if (firstch == "y") + w = firstch.toLowerCase() + w.substr(1); + return w; + } +} + diff --git a/_static/minus.png b/_static/minus.png new file mode 100644 index 000000000..d96755fda Binary files /dev/null and b/_static/minus.png differ diff --git a/_static/nbsphinx-broken-thumbnail.svg b/_static/nbsphinx-broken-thumbnail.svg new file mode 100644 index 000000000..4919ca882 --- /dev/null +++ b/_static/nbsphinx-broken-thumbnail.svg @@ -0,0 +1,9 @@ + + + + diff --git a/_static/nbsphinx-code-cells.css b/_static/nbsphinx-code-cells.css new file mode 100644 index 000000000..a3fb27c30 --- /dev/null +++ b/_static/nbsphinx-code-cells.css @@ -0,0 +1,259 @@ +/* remove conflicting styling from Sphinx themes */ +div.nbinput.container div.prompt *, +div.nboutput.container div.prompt *, +div.nbinput.container div.input_area pre, +div.nboutput.container div.output_area pre, +div.nbinput.container div.input_area .highlight, +div.nboutput.container div.output_area .highlight { + border: none; + padding: 0; + margin: 0; + box-shadow: none; +} + +div.nbinput.container > div[class*=highlight], +div.nboutput.container > div[class*=highlight] { + margin: 0; +} + +div.nbinput.container div.prompt *, +div.nboutput.container div.prompt * { + background: none; +} + +div.nboutput.container div.output_area .highlight, +div.nboutput.container div.output_area pre { + background: unset; +} + +div.nboutput.container div.output_area div.highlight { + color: unset; /* override Pygments text color */ +} + +/* avoid gaps between output lines */ +div.nboutput.container div[class*=highlight] pre { + line-height: normal; +} + +/* input/output containers */ +div.nbinput.container, +div.nboutput.container { + display: -webkit-flex; + display: flex; + align-items: flex-start; + margin: 0; + width: 100%; +} +@media (max-width: 540px) { + div.nbinput.container, + div.nboutput.container { + flex-direction: column; + } +} + +/* input container */ +div.nbinput.container { + padding-top: 5px; +} + +/* last container */ +div.nblast.container { + padding-bottom: 5px; +} + +/* input prompt */ +div.nbinput.container div.prompt pre, +/* for sphinx_immaterial theme: */ +div.nbinput.container div.prompt pre > code { + color: #307FC1; +} + +/* output prompt */ +div.nboutput.container div.prompt pre, +/* for sphinx_immaterial theme: */ +div.nboutput.container div.prompt pre > code { + color: #BF5B3D; +} + +/* all prompts */ +div.nbinput.container div.prompt, +div.nboutput.container div.prompt { + width: 4.5ex; + padding-top: 5px; + position: relative; + user-select: none; +} + +div.nbinput.container div.prompt > div, +div.nboutput.container div.prompt > div { + position: absolute; + right: 0; + margin-right: 0.3ex; +} + +@media (max-width: 540px) { + div.nbinput.container div.prompt, + div.nboutput.container div.prompt { + width: unset; + text-align: left; + padding: 0.4em; + } + div.nboutput.container div.prompt.empty { + padding: 0; + } + + div.nbinput.container div.prompt > div, + div.nboutput.container div.prompt > div { + position: unset; + } +} + +/* disable scrollbars and line breaks on prompts */ +div.nbinput.container div.prompt pre, +div.nboutput.container div.prompt pre { + overflow: hidden; + white-space: pre; +} + +/* input/output area */ +div.nbinput.container div.input_area, +div.nboutput.container div.output_area { + -webkit-flex: 1; + flex: 1; + overflow: auto; +} +@media (max-width: 540px) { + div.nbinput.container div.input_area, + div.nboutput.container div.output_area { + width: 100%; + } +} + +/* input area */ +div.nbinput.container div.input_area { + border: 1px solid #e0e0e0; + border-radius: 2px; + /*background: #f5f5f5;*/ +} + +/* override MathJax center alignment in output cells */ +div.nboutput.container div[class*=MathJax] { + text-align: left !important; +} + +/* override sphinx.ext.imgmath center alignment in output cells */ +div.nboutput.container div.math p { + text-align: left; +} + +/* standard error */ +div.nboutput.container div.output_area.stderr { + background: #fdd; +} + +/* ANSI colors */ +.ansi-black-fg { color: #3E424D; } +.ansi-black-bg { background-color: #3E424D; } +.ansi-black-intense-fg { color: #282C36; } +.ansi-black-intense-bg { background-color: #282C36; } +.ansi-red-fg { color: #E75C58; } +.ansi-red-bg { background-color: #E75C58; } +.ansi-red-intense-fg { color: #B22B31; } +.ansi-red-intense-bg { background-color: #B22B31; } +.ansi-green-fg { color: #00A250; } +.ansi-green-bg { background-color: #00A250; } +.ansi-green-intense-fg { color: #007427; } +.ansi-green-intense-bg { background-color: #007427; } +.ansi-yellow-fg { color: #DDB62B; } +.ansi-yellow-bg { background-color: #DDB62B; } +.ansi-yellow-intense-fg { color: #B27D12; } +.ansi-yellow-intense-bg { background-color: #B27D12; } +.ansi-blue-fg { color: #208FFB; } +.ansi-blue-bg { background-color: #208FFB; } +.ansi-blue-intense-fg { color: #0065CA; } +.ansi-blue-intense-bg { background-color: #0065CA; } +.ansi-magenta-fg { color: #D160C4; } +.ansi-magenta-bg { background-color: #D160C4; } +.ansi-magenta-intense-fg { color: #A03196; } +.ansi-magenta-intense-bg { background-color: #A03196; } +.ansi-cyan-fg { color: #60C6C8; } +.ansi-cyan-bg { background-color: #60C6C8; } +.ansi-cyan-intense-fg { color: #258F8F; } +.ansi-cyan-intense-bg { background-color: #258F8F; } +.ansi-white-fg { color: #C5C1B4; } +.ansi-white-bg { background-color: #C5C1B4; } +.ansi-white-intense-fg { color: #A1A6B2; } +.ansi-white-intense-bg { background-color: #A1A6B2; } + +.ansi-default-inverse-fg { color: #FFFFFF; } +.ansi-default-inverse-bg { background-color: #000000; } + +.ansi-bold { font-weight: bold; } +.ansi-underline { text-decoration: underline; } + + +div.nbinput.container div.input_area div[class*=highlight] > pre, +div.nboutput.container div.output_area div[class*=highlight] > pre, +div.nboutput.container div.output_area div[class*=highlight].math, +div.nboutput.container div.output_area.rendered_html, +div.nboutput.container div.output_area > div.output_javascript, +div.nboutput.container div.output_area:not(.rendered_html) > img{ + padding: 5px; + margin: 0; +} + +/* fix copybtn overflow problem in chromium (needed for 'sphinx_copybutton') */ +div.nbinput.container div.input_area > div[class^='highlight'], +div.nboutput.container div.output_area > div[class^='highlight']{ + overflow-y: hidden; +} + +/* hide copy button on prompts for 'sphinx_copybutton' extension ... */ +.prompt .copybtn, +/* ... and 'sphinx_immaterial' theme */ +.prompt .md-clipboard.md-icon { + display: none; +} + +/* Some additional styling taken form the Jupyter notebook CSS */ +.jp-RenderedHTMLCommon table, +div.rendered_html table { + border: none; + border-collapse: collapse; + border-spacing: 0; + color: black; + font-size: 12px; + table-layout: fixed; +} +.jp-RenderedHTMLCommon thead, +div.rendered_html thead { + border-bottom: 1px solid black; + vertical-align: bottom; +} +.jp-RenderedHTMLCommon tr, +.jp-RenderedHTMLCommon th, +.jp-RenderedHTMLCommon td, +div.rendered_html tr, +div.rendered_html th, +div.rendered_html td { + text-align: right; + vertical-align: middle; + padding: 0.5em 0.5em; + line-height: normal; + white-space: normal; + max-width: none; + border: none; +} +.jp-RenderedHTMLCommon th, +div.rendered_html th { + font-weight: bold; +} +.jp-RenderedHTMLCommon tbody tr:nth-child(odd), +div.rendered_html tbody tr:nth-child(odd) { + background: #f5f5f5; +} +.jp-RenderedHTMLCommon tbody tr:hover, +div.rendered_html tbody tr:hover { + background: rgba(66, 165, 245, 0.2); +} + diff --git a/_static/nbsphinx-gallery.css b/_static/nbsphinx-gallery.css new file mode 100644 index 000000000..365c27a96 --- /dev/null +++ b/_static/nbsphinx-gallery.css @@ -0,0 +1,31 @@ +.nbsphinx-gallery { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); + gap: 5px; + margin-top: 1em; + margin-bottom: 1em; +} + +.nbsphinx-gallery > a { + padding: 5px; + border: 1px dotted currentColor; + border-radius: 2px; + text-align: center; +} + +.nbsphinx-gallery > a:hover { + border-style: solid; +} + +.nbsphinx-gallery img { + max-width: 100%; + max-height: 100%; +} + +.nbsphinx-gallery > a > div:first-child { + display: flex; + align-items: start; + justify-content: center; + height: 120px; + margin-bottom: 5px; +} diff --git a/_static/nbsphinx-no-thumbnail.svg b/_static/nbsphinx-no-thumbnail.svg new file mode 100644 index 000000000..9dca7588f --- /dev/null +++ b/_static/nbsphinx-no-thumbnail.svg @@ -0,0 +1,9 @@ + + + + diff --git a/_static/plus.png b/_static/plus.png new file mode 100644 index 000000000..7107cec93 Binary files /dev/null and b/_static/plus.png differ diff --git a/_static/pygments.css b/_static/pygments.css new file mode 100644 index 000000000..012e6a00a --- /dev/null +++ b/_static/pygments.css @@ -0,0 +1,152 @@ +html[data-theme="light"] .highlight pre { line-height: 125%; } +html[data-theme="light"] .highlight td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } +html[data-theme="light"] .highlight span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } +html[data-theme="light"] .highlight td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } +html[data-theme="light"] .highlight span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } +html[data-theme="light"] .highlight .hll { background-color: #fae4c2 } +html[data-theme="light"] .highlight { background: #fefefe; color: #080808 } +html[data-theme="light"] .highlight .c { color: #515151 } /* Comment */ +html[data-theme="light"] .highlight .err { color: #a12236 } /* Error */ +html[data-theme="light"] .highlight .k { color: #6730c5 } /* Keyword */ +html[data-theme="light"] .highlight .l { color: #7f4707 } /* Literal */ +html[data-theme="light"] .highlight .n { color: #080808 } /* Name */ +html[data-theme="light"] .highlight .o { color: #00622f } /* Operator */ +html[data-theme="light"] .highlight .p { color: #080808 } /* Punctuation */ +html[data-theme="light"] .highlight .ch { color: #515151 } /* Comment.Hashbang */ +html[data-theme="light"] .highlight .cm { color: #515151 } /* Comment.Multiline */ +html[data-theme="light"] .highlight .cp { color: #515151 } /* Comment.Preproc */ +html[data-theme="light"] .highlight .cpf { color: #515151 } /* Comment.PreprocFile */ +html[data-theme="light"] .highlight .c1 { color: #515151 } /* Comment.Single */ +html[data-theme="light"] .highlight .cs { color: #515151 } /* Comment.Special */ +html[data-theme="light"] .highlight .gd { color: #005b82 } /* Generic.Deleted */ +html[data-theme="light"] .highlight .ge { font-style: italic } /* Generic.Emph */ +html[data-theme="light"] .highlight .gh { color: #005b82 } /* Generic.Heading */ +html[data-theme="light"] .highlight .gs { font-weight: bold } /* Generic.Strong */ +html[data-theme="light"] .highlight .gu { color: #005b82 } /* Generic.Subheading */ +html[data-theme="light"] .highlight .kc { color: #6730c5 } /* Keyword.Constant */ +html[data-theme="light"] .highlight .kd { color: #6730c5 } /* Keyword.Declaration */ +html[data-theme="light"] .highlight .kn { color: #6730c5 } /* Keyword.Namespace */ +html[data-theme="light"] .highlight .kp { color: #6730c5 } /* Keyword.Pseudo */ +html[data-theme="light"] .highlight .kr { color: #6730c5 } /* Keyword.Reserved */ +html[data-theme="light"] .highlight .kt { color: #7f4707 } /* Keyword.Type */ +html[data-theme="light"] .highlight .ld { color: #7f4707 } /* Literal.Date */ +html[data-theme="light"] .highlight .m { color: #7f4707 } /* Literal.Number */ +html[data-theme="light"] .highlight .s { color: #00622f } /* Literal.String */ +html[data-theme="light"] .highlight .na { color: #912583 } /* Name.Attribute */ +html[data-theme="light"] .highlight .nb { color: #7f4707 } /* Name.Builtin */ +html[data-theme="light"] .highlight .nc { color: #005b82 } /* Name.Class */ +html[data-theme="light"] .highlight .no { color: #005b82 } /* Name.Constant */ +html[data-theme="light"] .highlight .nd { color: #7f4707 } /* Name.Decorator */ +html[data-theme="light"] .highlight .ni { color: #00622f } /* Name.Entity */ +html[data-theme="light"] .highlight .ne { color: #6730c5 } /* Name.Exception */ +html[data-theme="light"] .highlight .nf { color: #005b82 } /* Name.Function */ +html[data-theme="light"] .highlight .nl { color: #7f4707 } /* Name.Label */ +html[data-theme="light"] .highlight .nn { color: #080808 } /* Name.Namespace */ +html[data-theme="light"] .highlight .nx { color: #080808 } /* Name.Other */ +html[data-theme="light"] .highlight .py { color: #005b82 } /* Name.Property */ +html[data-theme="light"] .highlight .nt { color: #005b82 } /* Name.Tag */ +html[data-theme="light"] .highlight .nv { color: #a12236 } /* Name.Variable */ +html[data-theme="light"] .highlight .ow { color: #6730c5 } /* Operator.Word */ +html[data-theme="light"] .highlight .pm { color: #080808 } /* Punctuation.Marker */ +html[data-theme="light"] .highlight .w { color: #080808 } /* Text.Whitespace */ +html[data-theme="light"] .highlight .mb { color: #7f4707 } /* Literal.Number.Bin */ +html[data-theme="light"] .highlight .mf { color: #7f4707 } /* Literal.Number.Float */ +html[data-theme="light"] .highlight .mh { color: #7f4707 } /* Literal.Number.Hex */ +html[data-theme="light"] .highlight .mi { color: #7f4707 } /* Literal.Number.Integer */ +html[data-theme="light"] .highlight .mo { color: #7f4707 } /* Literal.Number.Oct */ +html[data-theme="light"] .highlight .sa { color: #00622f } /* Literal.String.Affix */ +html[data-theme="light"] .highlight .sb { color: #00622f } /* Literal.String.Backtick */ +html[data-theme="light"] .highlight .sc { color: #00622f } /* Literal.String.Char */ +html[data-theme="light"] .highlight .dl { color: #00622f } /* Literal.String.Delimiter */ +html[data-theme="light"] .highlight .sd { color: #00622f } /* Literal.String.Doc */ +html[data-theme="light"] .highlight .s2 { color: #00622f } /* Literal.String.Double */ +html[data-theme="light"] .highlight .se { color: #00622f } /* Literal.String.Escape */ +html[data-theme="light"] .highlight .sh { color: #00622f } /* Literal.String.Heredoc */ +html[data-theme="light"] .highlight .si { color: #00622f } /* Literal.String.Interpol */ +html[data-theme="light"] .highlight .sx { color: #00622f } /* Literal.String.Other */ +html[data-theme="light"] .highlight .sr { color: #a12236 } /* Literal.String.Regex */ +html[data-theme="light"] .highlight .s1 { color: #00622f } /* Literal.String.Single */ +html[data-theme="light"] .highlight .ss { color: #005b82 } /* Literal.String.Symbol */ +html[data-theme="light"] .highlight .bp { color: #7f4707 } /* Name.Builtin.Pseudo */ +html[data-theme="light"] .highlight .fm { color: #005b82 } /* Name.Function.Magic */ +html[data-theme="light"] .highlight .vc { color: #a12236 } /* Name.Variable.Class */ +html[data-theme="light"] .highlight .vg { color: #a12236 } /* Name.Variable.Global */ +html[data-theme="light"] .highlight .vi { color: #a12236 } /* Name.Variable.Instance */ +html[data-theme="light"] .highlight .vm { color: #7f4707 } /* Name.Variable.Magic */ +html[data-theme="light"] .highlight .il { color: #7f4707 } /* Literal.Number.Integer.Long */ +html[data-theme="dark"] .highlight pre { line-height: 125%; } +html[data-theme="dark"] .highlight td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } +html[data-theme="dark"] .highlight span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } +html[data-theme="dark"] .highlight td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } +html[data-theme="dark"] .highlight span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } +html[data-theme="dark"] .highlight .hll { background-color: #ffd9002e } +html[data-theme="dark"] .highlight { background: #2b2b2b; color: #f8f8f2 } +html[data-theme="dark"] .highlight .c { color: #ffd900 } /* Comment */ +html[data-theme="dark"] .highlight .err { color: #ffa07a } /* Error */ +html[data-theme="dark"] .highlight .k { color: #dcc6e0 } /* Keyword */ +html[data-theme="dark"] .highlight .l { color: #ffd900 } /* Literal */ +html[data-theme="dark"] .highlight .n { color: #f8f8f2 } /* Name */ +html[data-theme="dark"] .highlight .o { color: #abe338 } /* Operator */ +html[data-theme="dark"] .highlight .p { color: #f8f8f2 } /* Punctuation */ +html[data-theme="dark"] .highlight .ch { color: #ffd900 } /* Comment.Hashbang */ +html[data-theme="dark"] .highlight .cm { color: #ffd900 } /* Comment.Multiline */ +html[data-theme="dark"] .highlight .cp { color: #ffd900 } /* Comment.Preproc */ +html[data-theme="dark"] .highlight .cpf { color: #ffd900 } /* Comment.PreprocFile */ +html[data-theme="dark"] .highlight .c1 { color: #ffd900 } /* Comment.Single */ +html[data-theme="dark"] .highlight .cs { color: #ffd900 } /* Comment.Special */ +html[data-theme="dark"] .highlight .gd { color: #00e0e0 } /* Generic.Deleted */ +html[data-theme="dark"] .highlight .ge { font-style: italic } /* Generic.Emph */ +html[data-theme="dark"] .highlight .gh { color: #00e0e0 } /* Generic.Heading */ +html[data-theme="dark"] .highlight .gs { font-weight: bold } /* Generic.Strong */ +html[data-theme="dark"] .highlight .gu { color: #00e0e0 } /* Generic.Subheading */ +html[data-theme="dark"] .highlight .kc { color: #dcc6e0 } /* Keyword.Constant */ +html[data-theme="dark"] .highlight .kd { color: #dcc6e0 } /* Keyword.Declaration */ +html[data-theme="dark"] .highlight .kn { color: #dcc6e0 } /* Keyword.Namespace */ +html[data-theme="dark"] .highlight .kp { color: #dcc6e0 } /* Keyword.Pseudo */ +html[data-theme="dark"] .highlight .kr { color: #dcc6e0 } /* Keyword.Reserved */ +html[data-theme="dark"] .highlight .kt { color: #ffd900 } /* Keyword.Type */ +html[data-theme="dark"] .highlight .ld { color: #ffd900 } /* Literal.Date */ +html[data-theme="dark"] .highlight .m { color: #ffd900 } /* Literal.Number */ +html[data-theme="dark"] .highlight .s { color: #abe338 } /* Literal.String */ +html[data-theme="dark"] .highlight .na { color: #ffd900 } /* Name.Attribute */ +html[data-theme="dark"] .highlight .nb { color: #ffd900 } /* Name.Builtin */ +html[data-theme="dark"] .highlight .nc { color: #00e0e0 } /* Name.Class */ +html[data-theme="dark"] .highlight .no { color: #00e0e0 } /* Name.Constant */ +html[data-theme="dark"] .highlight .nd { color: #ffd900 } /* Name.Decorator */ +html[data-theme="dark"] .highlight .ni { color: #abe338 } /* Name.Entity */ +html[data-theme="dark"] .highlight .ne { color: #dcc6e0 } /* Name.Exception */ +html[data-theme="dark"] .highlight .nf { color: #00e0e0 } /* Name.Function */ +html[data-theme="dark"] .highlight .nl { color: #ffd900 } /* Name.Label */ +html[data-theme="dark"] .highlight .nn { color: #f8f8f2 } /* Name.Namespace */ +html[data-theme="dark"] .highlight .nx { color: #f8f8f2 } /* Name.Other */ +html[data-theme="dark"] .highlight .py { color: #00e0e0 } /* Name.Property */ +html[data-theme="dark"] .highlight .nt { color: #00e0e0 } /* Name.Tag */ +html[data-theme="dark"] .highlight .nv { color: #ffa07a } /* Name.Variable */ +html[data-theme="dark"] .highlight .ow { color: #dcc6e0 } /* Operator.Word */ +html[data-theme="dark"] .highlight .pm { color: #f8f8f2 } /* Punctuation.Marker */ +html[data-theme="dark"] .highlight .w { color: #f8f8f2 } /* Text.Whitespace */ +html[data-theme="dark"] .highlight .mb { color: #ffd900 } /* Literal.Number.Bin */ +html[data-theme="dark"] .highlight .mf { color: #ffd900 } /* Literal.Number.Float */ +html[data-theme="dark"] .highlight .mh { color: #ffd900 } /* Literal.Number.Hex */ +html[data-theme="dark"] .highlight .mi { color: #ffd900 } /* Literal.Number.Integer */ +html[data-theme="dark"] .highlight .mo { color: #ffd900 } /* Literal.Number.Oct */ +html[data-theme="dark"] .highlight .sa { color: #abe338 } /* Literal.String.Affix */ +html[data-theme="dark"] .highlight .sb { color: #abe338 } /* Literal.String.Backtick */ +html[data-theme="dark"] .highlight .sc { color: #abe338 } /* Literal.String.Char */ +html[data-theme="dark"] .highlight .dl { color: #abe338 } /* Literal.String.Delimiter */ +html[data-theme="dark"] .highlight .sd { color: #abe338 } /* Literal.String.Doc */ +html[data-theme="dark"] .highlight .s2 { color: #abe338 } /* Literal.String.Double */ +html[data-theme="dark"] .highlight .se { color: #abe338 } /* Literal.String.Escape */ +html[data-theme="dark"] .highlight .sh { color: #abe338 } /* Literal.String.Heredoc */ +html[data-theme="dark"] .highlight .si { color: #abe338 } /* Literal.String.Interpol */ +html[data-theme="dark"] .highlight .sx { color: #abe338 } /* Literal.String.Other */ +html[data-theme="dark"] .highlight .sr { color: #ffa07a } /* Literal.String.Regex */ +html[data-theme="dark"] .highlight .s1 { color: #abe338 } /* Literal.String.Single */ +html[data-theme="dark"] .highlight .ss { color: #00e0e0 } /* Literal.String.Symbol */ +html[data-theme="dark"] .highlight .bp { color: #ffd900 } /* Name.Builtin.Pseudo */ +html[data-theme="dark"] .highlight .fm { color: #00e0e0 } /* Name.Function.Magic */ +html[data-theme="dark"] .highlight .vc { color: #ffa07a } /* Name.Variable.Class */ +html[data-theme="dark"] .highlight .vg { color: #ffa07a } /* Name.Variable.Global */ +html[data-theme="dark"] .highlight .vi { color: #ffa07a } /* Name.Variable.Instance */ +html[data-theme="dark"] .highlight .vm { color: #ffd900 } /* Name.Variable.Magic */ +html[data-theme="dark"] .highlight .il { color: #ffd900 } /* Literal.Number.Integer.Long */ \ No newline at end of file diff --git a/_static/scripts/bootstrap.js b/_static/scripts/bootstrap.js new file mode 100644 index 000000000..c8178debb --- /dev/null +++ b/_static/scripts/bootstrap.js @@ -0,0 +1,3 @@ +/*! For license information please see bootstrap.js.LICENSE.txt */ +(()=>{"use strict";var t={d:(e,i)=>{for(var n in i)t.o(i,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:i[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{afterMain:()=>E,afterRead:()=>v,afterWrite:()=>C,applyStyles:()=>$,arrow:()=>J,auto:()=>a,basePlacements:()=>l,beforeMain:()=>y,beforeRead:()=>_,beforeWrite:()=>A,bottom:()=>s,clippingParents:()=>d,computeStyles:()=>it,createPopper:()=>Dt,createPopperBase:()=>St,createPopperLite:()=>$t,detectOverflow:()=>_t,end:()=>h,eventListeners:()=>st,flip:()=>bt,hide:()=>wt,left:()=>r,main:()=>w,modifierPhases:()=>O,offset:()=>Et,placements:()=>g,popper:()=>f,popperGenerator:()=>Lt,popperOffsets:()=>At,preventOverflow:()=>Tt,read:()=>b,reference:()=>p,right:()=>o,start:()=>c,top:()=>n,variationPlacements:()=>m,viewport:()=>u,write:()=>T});var i={};t.r(i),t.d(i,{Alert:()=>Oe,Button:()=>ke,Carousel:()=>li,Collapse:()=>Ei,Dropdown:()=>Ki,Modal:()=>Ln,Offcanvas:()=>Kn,Popover:()=>bs,ScrollSpy:()=>Ls,Tab:()=>Js,Toast:()=>po,Tooltip:()=>fs});var n="top",s="bottom",o="right",r="left",a="auto",l=[n,s,o,r],c="start",h="end",d="clippingParents",u="viewport",f="popper",p="reference",m=l.reduce((function(t,e){return t.concat([e+"-"+c,e+"-"+h])}),[]),g=[].concat(l,[a]).reduce((function(t,e){return t.concat([e,e+"-"+c,e+"-"+h])}),[]),_="beforeRead",b="read",v="afterRead",y="beforeMain",w="main",E="afterMain",A="beforeWrite",T="write",C="afterWrite",O=[_,b,v,y,w,E,A,T,C];function x(t){return t?(t.nodeName||"").toLowerCase():null}function k(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function L(t){return t instanceof k(t).Element||t instanceof Element}function S(t){return t instanceof k(t).HTMLElement||t instanceof HTMLElement}function D(t){return"undefined"!=typeof ShadowRoot&&(t instanceof k(t).ShadowRoot||t instanceof ShadowRoot)}const $={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var i=e.styles[t]||{},n=e.attributes[t]||{},s=e.elements[t];S(s)&&x(s)&&(Object.assign(s.style,i),Object.keys(n).forEach((function(t){var e=n[t];!1===e?s.removeAttribute(t):s.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow),function(){Object.keys(e.elements).forEach((function(t){var n=e.elements[t],s=e.attributes[t]||{},o=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:i[t]).reduce((function(t,e){return t[e]="",t}),{});S(n)&&x(n)&&(Object.assign(n.style,o),Object.keys(s).forEach((function(t){n.removeAttribute(t)})))}))}},requires:["computeStyles"]};function I(t){return t.split("-")[0]}var N=Math.max,P=Math.min,M=Math.round;function j(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function F(){return!/^((?!chrome|android).)*safari/i.test(j())}function H(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var n=t.getBoundingClientRect(),s=1,o=1;e&&S(t)&&(s=t.offsetWidth>0&&M(n.width)/t.offsetWidth||1,o=t.offsetHeight>0&&M(n.height)/t.offsetHeight||1);var r=(L(t)?k(t):window).visualViewport,a=!F()&&i,l=(n.left+(a&&r?r.offsetLeft:0))/s,c=(n.top+(a&&r?r.offsetTop:0))/o,h=n.width/s,d=n.height/o;return{width:h,height:d,top:c,right:l+h,bottom:c+d,left:l,x:l,y:c}}function B(t){var e=H(t),i=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:n}}function W(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&D(i)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function z(t){return k(t).getComputedStyle(t)}function R(t){return["table","td","th"].indexOf(x(t))>=0}function q(t){return((L(t)?t.ownerDocument:t.document)||window.document).documentElement}function V(t){return"html"===x(t)?t:t.assignedSlot||t.parentNode||(D(t)?t.host:null)||q(t)}function Y(t){return S(t)&&"fixed"!==z(t).position?t.offsetParent:null}function K(t){for(var e=k(t),i=Y(t);i&&R(i)&&"static"===z(i).position;)i=Y(i);return i&&("html"===x(i)||"body"===x(i)&&"static"===z(i).position)?e:i||function(t){var e=/firefox/i.test(j());if(/Trident/i.test(j())&&S(t)&&"fixed"===z(t).position)return null;var i=V(t);for(D(i)&&(i=i.host);S(i)&&["html","body"].indexOf(x(i))<0;){var n=z(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||e&&"filter"===n.willChange||e&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}(t)||e}function Q(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function X(t,e,i){return N(t,P(e,i))}function U(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function G(t,e){return e.reduce((function(e,i){return e[i]=t,e}),{})}const J={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,i=t.state,a=t.name,c=t.options,h=i.elements.arrow,d=i.modifiersData.popperOffsets,u=I(i.placement),f=Q(u),p=[r,o].indexOf(u)>=0?"height":"width";if(h&&d){var m=function(t,e){return U("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:G(t,l))}(c.padding,i),g=B(h),_="y"===f?n:r,b="y"===f?s:o,v=i.rects.reference[p]+i.rects.reference[f]-d[f]-i.rects.popper[p],y=d[f]-i.rects.reference[f],w=K(h),E=w?"y"===f?w.clientHeight||0:w.clientWidth||0:0,A=v/2-y/2,T=m[_],C=E-g[p]-m[b],O=E/2-g[p]/2+A,x=X(T,O,C),k=f;i.modifiersData[a]=((e={})[k]=x,e.centerOffset=x-O,e)}},effect:function(t){var e=t.state,i=t.options.element,n=void 0===i?"[data-popper-arrow]":i;null!=n&&("string"!=typeof n||(n=e.elements.popper.querySelector(n)))&&W(e.elements.popper,n)&&(e.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Z(t){return t.split("-")[1]}var tt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function et(t){var e,i=t.popper,a=t.popperRect,l=t.placement,c=t.variation,d=t.offsets,u=t.position,f=t.gpuAcceleration,p=t.adaptive,m=t.roundOffsets,g=t.isFixed,_=d.x,b=void 0===_?0:_,v=d.y,y=void 0===v?0:v,w="function"==typeof m?m({x:b,y}):{x:b,y};b=w.x,y=w.y;var E=d.hasOwnProperty("x"),A=d.hasOwnProperty("y"),T=r,C=n,O=window;if(p){var x=K(i),L="clientHeight",S="clientWidth";x===k(i)&&"static"!==z(x=q(i)).position&&"absolute"===u&&(L="scrollHeight",S="scrollWidth"),(l===n||(l===r||l===o)&&c===h)&&(C=s,y-=(g&&x===O&&O.visualViewport?O.visualViewport.height:x[L])-a.height,y*=f?1:-1),l!==r&&(l!==n&&l!==s||c!==h)||(T=o,b-=(g&&x===O&&O.visualViewport?O.visualViewport.width:x[S])-a.width,b*=f?1:-1)}var D,$=Object.assign({position:u},p&&tt),I=!0===m?function(t,e){var i=t.x,n=t.y,s=e.devicePixelRatio||1;return{x:M(i*s)/s||0,y:M(n*s)/s||0}}({x:b,y},k(i)):{x:b,y};return b=I.x,y=I.y,f?Object.assign({},$,((D={})[C]=A?"0":"",D[T]=E?"0":"",D.transform=(O.devicePixelRatio||1)<=1?"translate("+b+"px, "+y+"px)":"translate3d("+b+"px, "+y+"px, 0)",D)):Object.assign({},$,((e={})[C]=A?y+"px":"",e[T]=E?b+"px":"",e.transform="",e))}const it={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,i=t.options,n=i.gpuAcceleration,s=void 0===n||n,o=i.adaptive,r=void 0===o||o,a=i.roundOffsets,l=void 0===a||a,c={placement:I(e.placement),variation:Z(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:s,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,et(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:r,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,et(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}};var nt={passive:!0};const st={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,i=t.instance,n=t.options,s=n.scroll,o=void 0===s||s,r=n.resize,a=void 0===r||r,l=k(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach((function(t){t.addEventListener("scroll",i.update,nt)})),a&&l.addEventListener("resize",i.update,nt),function(){o&&c.forEach((function(t){t.removeEventListener("scroll",i.update,nt)})),a&&l.removeEventListener("resize",i.update,nt)}},data:{}};var ot={left:"right",right:"left",bottom:"top",top:"bottom"};function rt(t){return t.replace(/left|right|bottom|top/g,(function(t){return ot[t]}))}var at={start:"end",end:"start"};function lt(t){return t.replace(/start|end/g,(function(t){return at[t]}))}function ct(t){var e=k(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ht(t){return H(q(t)).left+ct(t).scrollLeft}function dt(t){var e=z(t),i=e.overflow,n=e.overflowX,s=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+s+n)}function ut(t){return["html","body","#document"].indexOf(x(t))>=0?t.ownerDocument.body:S(t)&&dt(t)?t:ut(V(t))}function ft(t,e){var i;void 0===e&&(e=[]);var n=ut(t),s=n===(null==(i=t.ownerDocument)?void 0:i.body),o=k(n),r=s?[o].concat(o.visualViewport||[],dt(n)?n:[]):n,a=e.concat(r);return s?a:a.concat(ft(V(r)))}function pt(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function mt(t,e,i){return e===u?pt(function(t,e){var i=k(t),n=q(t),s=i.visualViewport,o=n.clientWidth,r=n.clientHeight,a=0,l=0;if(s){o=s.width,r=s.height;var c=F();(c||!c&&"fixed"===e)&&(a=s.offsetLeft,l=s.offsetTop)}return{width:o,height:r,x:a+ht(t),y:l}}(t,i)):L(e)?function(t,e){var i=H(t,!1,"fixed"===e);return i.top=i.top+t.clientTop,i.left=i.left+t.clientLeft,i.bottom=i.top+t.clientHeight,i.right=i.left+t.clientWidth,i.width=t.clientWidth,i.height=t.clientHeight,i.x=i.left,i.y=i.top,i}(e,i):pt(function(t){var e,i=q(t),n=ct(t),s=null==(e=t.ownerDocument)?void 0:e.body,o=N(i.scrollWidth,i.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),r=N(i.scrollHeight,i.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-n.scrollLeft+ht(t),l=-n.scrollTop;return"rtl"===z(s||i).direction&&(a+=N(i.clientWidth,s?s.clientWidth:0)-o),{width:o,height:r,x:a,y:l}}(q(t)))}function gt(t){var e,i=t.reference,a=t.element,l=t.placement,d=l?I(l):null,u=l?Z(l):null,f=i.x+i.width/2-a.width/2,p=i.y+i.height/2-a.height/2;switch(d){case n:e={x:f,y:i.y-a.height};break;case s:e={x:f,y:i.y+i.height};break;case o:e={x:i.x+i.width,y:p};break;case r:e={x:i.x-a.width,y:p};break;default:e={x:i.x,y:i.y}}var m=d?Q(d):null;if(null!=m){var g="y"===m?"height":"width";switch(u){case c:e[m]=e[m]-(i[g]/2-a[g]/2);break;case h:e[m]=e[m]+(i[g]/2-a[g]/2)}}return e}function _t(t,e){void 0===e&&(e={});var i=e,r=i.placement,a=void 0===r?t.placement:r,c=i.strategy,h=void 0===c?t.strategy:c,m=i.boundary,g=void 0===m?d:m,_=i.rootBoundary,b=void 0===_?u:_,v=i.elementContext,y=void 0===v?f:v,w=i.altBoundary,E=void 0!==w&&w,A=i.padding,T=void 0===A?0:A,C=U("number"!=typeof T?T:G(T,l)),O=y===f?p:f,k=t.rects.popper,D=t.elements[E?O:y],$=function(t,e,i,n){var s="clippingParents"===e?function(t){var e=ft(V(t)),i=["absolute","fixed"].indexOf(z(t).position)>=0&&S(t)?K(t):t;return L(i)?e.filter((function(t){return L(t)&&W(t,i)&&"body"!==x(t)})):[]}(t):[].concat(e),o=[].concat(s,[i]),r=o[0],a=o.reduce((function(e,i){var s=mt(t,i,n);return e.top=N(s.top,e.top),e.right=P(s.right,e.right),e.bottom=P(s.bottom,e.bottom),e.left=N(s.left,e.left),e}),mt(t,r,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}(L(D)?D:D.contextElement||q(t.elements.popper),g,b,h),I=H(t.elements.reference),M=gt({reference:I,element:k,strategy:"absolute",placement:a}),j=pt(Object.assign({},k,M)),F=y===f?j:I,B={top:$.top-F.top+C.top,bottom:F.bottom-$.bottom+C.bottom,left:$.left-F.left+C.left,right:F.right-$.right+C.right},R=t.modifiersData.offset;if(y===f&&R){var Y=R[a];Object.keys(B).forEach((function(t){var e=[o,s].indexOf(t)>=0?1:-1,i=[n,s].indexOf(t)>=0?"y":"x";B[t]+=Y[i]*e}))}return B}const bt={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,h=t.name;if(!e.modifiersData[h]._skip){for(var d=i.mainAxis,u=void 0===d||d,f=i.altAxis,p=void 0===f||f,_=i.fallbackPlacements,b=i.padding,v=i.boundary,y=i.rootBoundary,w=i.altBoundary,E=i.flipVariations,A=void 0===E||E,T=i.allowedAutoPlacements,C=e.options.placement,O=I(C),x=_||(O!==C&&A?function(t){if(I(t)===a)return[];var e=rt(t);return[lt(t),e,lt(e)]}(C):[rt(C)]),k=[C].concat(x).reduce((function(t,i){return t.concat(I(i)===a?function(t,e){void 0===e&&(e={});var i=e,n=i.placement,s=i.boundary,o=i.rootBoundary,r=i.padding,a=i.flipVariations,c=i.allowedAutoPlacements,h=void 0===c?g:c,d=Z(n),u=d?a?m:m.filter((function(t){return Z(t)===d})):l,f=u.filter((function(t){return h.indexOf(t)>=0}));0===f.length&&(f=u);var p=f.reduce((function(e,i){return e[i]=_t(t,{placement:i,boundary:s,rootBoundary:o,padding:r})[I(i)],e}),{});return Object.keys(p).sort((function(t,e){return p[t]-p[e]}))}(e,{placement:i,boundary:v,rootBoundary:y,padding:b,flipVariations:A,allowedAutoPlacements:T}):i)}),[]),L=e.rects.reference,S=e.rects.popper,D=new Map,$=!0,N=k[0],P=0;P=0,B=H?"width":"height",W=_t(e,{placement:M,boundary:v,rootBoundary:y,altBoundary:w,padding:b}),z=H?F?o:r:F?s:n;L[B]>S[B]&&(z=rt(z));var R=rt(z),q=[];if(u&&q.push(W[j]<=0),p&&q.push(W[z]<=0,W[R]<=0),q.every((function(t){return t}))){N=M,$=!1;break}D.set(M,q)}if($)for(var V=function(t){var e=k.find((function(e){var i=D.get(e);if(i)return i.slice(0,t).every((function(t){return t}))}));if(e)return N=e,"break"},Y=A?3:1;Y>0&&"break"!==V(Y);Y--);e.placement!==N&&(e.modifiersData[h]._skip=!0,e.placement=N,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function vt(t,e,i){return void 0===i&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function yt(t){return[n,o,s,r].some((function(e){return t[e]>=0}))}const wt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,i=t.name,n=e.rects.reference,s=e.rects.popper,o=e.modifiersData.preventOverflow,r=_t(e,{elementContext:"reference"}),a=_t(e,{altBoundary:!0}),l=vt(r,n),c=vt(a,s,o),h=yt(l),d=yt(c);e.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":d})}},Et={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,i=t.options,s=t.name,a=i.offset,l=void 0===a?[0,0]:a,c=g.reduce((function(t,i){return t[i]=function(t,e,i){var s=I(t),a=[r,n].indexOf(s)>=0?-1:1,l="function"==typeof i?i(Object.assign({},e,{placement:t})):i,c=l[0],h=l[1];return c=c||0,h=(h||0)*a,[r,o].indexOf(s)>=0?{x:h,y:c}:{x:c,y:h}}(i,e.rects,l),t}),{}),h=c[e.placement],d=h.x,u=h.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=d,e.modifiersData.popperOffsets.y+=u),e.modifiersData[s]=c}},At={name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,i=t.name;e.modifiersData[i]=gt({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},Tt={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,a=t.name,l=i.mainAxis,h=void 0===l||l,d=i.altAxis,u=void 0!==d&&d,f=i.boundary,p=i.rootBoundary,m=i.altBoundary,g=i.padding,_=i.tether,b=void 0===_||_,v=i.tetherOffset,y=void 0===v?0:v,w=_t(e,{boundary:f,rootBoundary:p,padding:g,altBoundary:m}),E=I(e.placement),A=Z(e.placement),T=!A,C=Q(E),O="x"===C?"y":"x",x=e.modifiersData.popperOffsets,k=e.rects.reference,L=e.rects.popper,S="function"==typeof y?y(Object.assign({},e.rects,{placement:e.placement})):y,D="number"==typeof S?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),$=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,M={x:0,y:0};if(x){if(h){var j,F="y"===C?n:r,H="y"===C?s:o,W="y"===C?"height":"width",z=x[C],R=z+w[F],q=z-w[H],V=b?-L[W]/2:0,Y=A===c?k[W]:L[W],U=A===c?-L[W]:-k[W],G=e.elements.arrow,J=b&&G?B(G):{width:0,height:0},tt=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},et=tt[F],it=tt[H],nt=X(0,k[W],J[W]),st=T?k[W]/2-V-nt-et-D.mainAxis:Y-nt-et-D.mainAxis,ot=T?-k[W]/2+V+nt+it+D.mainAxis:U+nt+it+D.mainAxis,rt=e.elements.arrow&&K(e.elements.arrow),at=rt?"y"===C?rt.clientTop||0:rt.clientLeft||0:0,lt=null!=(j=null==$?void 0:$[C])?j:0,ct=z+ot-lt,ht=X(b?P(R,z+st-lt-at):R,z,b?N(q,ct):q);x[C]=ht,M[C]=ht-z}if(u){var dt,ut="x"===C?n:r,ft="x"===C?s:o,pt=x[O],mt="y"===O?"height":"width",gt=pt+w[ut],bt=pt-w[ft],vt=-1!==[n,r].indexOf(E),yt=null!=(dt=null==$?void 0:$[O])?dt:0,wt=vt?gt:pt-k[mt]-L[mt]-yt+D.altAxis,Et=vt?pt+k[mt]+L[mt]-yt-D.altAxis:bt,At=b&&vt?function(t,e,i){var n=X(t,e,i);return n>i?i:n}(wt,pt,Et):X(b?wt:gt,pt,b?Et:bt);x[O]=At,M[O]=At-pt}e.modifiersData[a]=M}},requiresIfExists:["offset"]};function Ct(t,e,i){void 0===i&&(i=!1);var n,s,o=S(e),r=S(e)&&function(t){var e=t.getBoundingClientRect(),i=M(e.width)/t.offsetWidth||1,n=M(e.height)/t.offsetHeight||1;return 1!==i||1!==n}(e),a=q(e),l=H(t,r,i),c={scrollLeft:0,scrollTop:0},h={x:0,y:0};return(o||!o&&!i)&&(("body"!==x(e)||dt(a))&&(c=(n=e)!==k(n)&&S(n)?{scrollLeft:(s=n).scrollLeft,scrollTop:s.scrollTop}:ct(n)),S(e)?((h=H(e,!0)).x+=e.clientLeft,h.y+=e.clientTop):a&&(h.x=ht(a))),{x:l.left+c.scrollLeft-h.x,y:l.top+c.scrollTop-h.y,width:l.width,height:l.height}}function Ot(t){var e=new Map,i=new Set,n=[];function s(t){i.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!i.has(t)){var n=e.get(t);n&&s(n)}})),n.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){i.has(t.name)||s(t)})),n}var xt={placement:"bottom",modifiers:[],strategy:"absolute"};function kt(){for(var t=arguments.length,e=new Array(t),i=0;iIt.has(t)&&It.get(t).get(e)||null,remove(t,e){if(!It.has(t))return;const i=It.get(t);i.delete(e),0===i.size&&It.delete(t)}},Pt="transitionend",Mt=t=>(t&&window.CSS&&window.CSS.escape&&(t=t.replace(/#([^\s"#']+)/g,((t,e)=>`#${CSS.escape(e)}`))),t),jt=t=>{t.dispatchEvent(new Event(Pt))},Ft=t=>!(!t||"object"!=typeof t)&&(void 0!==t.jquery&&(t=t[0]),void 0!==t.nodeType),Ht=t=>Ft(t)?t.jquery?t[0]:t:"string"==typeof t&&t.length>0?document.querySelector(Mt(t)):null,Bt=t=>{if(!Ft(t)||0===t.getClientRects().length)return!1;const e="visible"===getComputedStyle(t).getPropertyValue("visibility"),i=t.closest("details:not([open])");if(!i)return e;if(i!==t){const e=t.closest("summary");if(e&&e.parentNode!==i)return!1;if(null===e)return!1}return e},Wt=t=>!t||t.nodeType!==Node.ELEMENT_NODE||!!t.classList.contains("disabled")||(void 0!==t.disabled?t.disabled:t.hasAttribute("disabled")&&"false"!==t.getAttribute("disabled")),zt=t=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof t.getRootNode){const e=t.getRootNode();return e instanceof ShadowRoot?e:null}return t instanceof ShadowRoot?t:t.parentNode?zt(t.parentNode):null},Rt=()=>{},qt=t=>{t.offsetHeight},Vt=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,Yt=[],Kt=()=>"rtl"===document.documentElement.dir,Qt=t=>{var e;e=()=>{const e=Vt();if(e){const i=t.NAME,n=e.fn[i];e.fn[i]=t.jQueryInterface,e.fn[i].Constructor=t,e.fn[i].noConflict=()=>(e.fn[i]=n,t.jQueryInterface)}},"loading"===document.readyState?(Yt.length||document.addEventListener("DOMContentLoaded",(()=>{for(const t of Yt)t()})),Yt.push(e)):e()},Xt=(t,e=[],i=t)=>"function"==typeof t?t(...e):i,Ut=(t,e,i=!0)=>{if(!i)return void Xt(t);const n=(t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:i}=window.getComputedStyle(t);const n=Number.parseFloat(e),s=Number.parseFloat(i);return n||s?(e=e.split(",")[0],i=i.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(i))):0})(e)+5;let s=!1;const o=({target:i})=>{i===e&&(s=!0,e.removeEventListener(Pt,o),Xt(t))};e.addEventListener(Pt,o),setTimeout((()=>{s||jt(e)}),n)},Gt=(t,e,i,n)=>{const s=t.length;let o=t.indexOf(e);return-1===o?!i&&n?t[s-1]:t[0]:(o+=i?1:-1,n&&(o=(o+s)%s),t[Math.max(0,Math.min(o,s-1))])},Jt=/[^.]*(?=\..*)\.|.*/,Zt=/\..*/,te=/::\d+$/,ee={};let ie=1;const ne={mouseenter:"mouseover",mouseleave:"mouseout"},se=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function oe(t,e){return e&&`${e}::${ie++}`||t.uidEvent||ie++}function re(t){const e=oe(t);return t.uidEvent=e,ee[e]=ee[e]||{},ee[e]}function ae(t,e,i=null){return Object.values(t).find((t=>t.callable===e&&t.delegationSelector===i))}function le(t,e,i){const n="string"==typeof e,s=n?i:e||i;let o=ue(t);return se.has(o)||(o=t),[n,s,o]}function ce(t,e,i,n,s){if("string"!=typeof e||!t)return;let[o,r,a]=le(e,i,n);if(e in ne){const t=t=>function(e){if(!e.relatedTarget||e.relatedTarget!==e.delegateTarget&&!e.delegateTarget.contains(e.relatedTarget))return t.call(this,e)};r=t(r)}const l=re(t),c=l[a]||(l[a]={}),h=ae(c,r,o?i:null);if(h)return void(h.oneOff=h.oneOff&&s);const d=oe(r,e.replace(Jt,"")),u=o?function(t,e,i){return function n(s){const o=t.querySelectorAll(e);for(let{target:r}=s;r&&r!==this;r=r.parentNode)for(const a of o)if(a===r)return pe(s,{delegateTarget:r}),n.oneOff&&fe.off(t,s.type,e,i),i.apply(r,[s])}}(t,i,r):function(t,e){return function i(n){return pe(n,{delegateTarget:t}),i.oneOff&&fe.off(t,n.type,e),e.apply(t,[n])}}(t,r);u.delegationSelector=o?i:null,u.callable=r,u.oneOff=s,u.uidEvent=d,c[d]=u,t.addEventListener(a,u,o)}function he(t,e,i,n,s){const o=ae(e[i],n,s);o&&(t.removeEventListener(i,o,Boolean(s)),delete e[i][o.uidEvent])}function de(t,e,i,n){const s=e[i]||{};for(const[o,r]of Object.entries(s))o.includes(n)&&he(t,e,i,r.callable,r.delegationSelector)}function ue(t){return t=t.replace(Zt,""),ne[t]||t}const fe={on(t,e,i,n){ce(t,e,i,n,!1)},one(t,e,i,n){ce(t,e,i,n,!0)},off(t,e,i,n){if("string"!=typeof e||!t)return;const[s,o,r]=le(e,i,n),a=r!==e,l=re(t),c=l[r]||{},h=e.startsWith(".");if(void 0===o){if(h)for(const i of Object.keys(l))de(t,l,i,e.slice(1));for(const[i,n]of Object.entries(c)){const s=i.replace(te,"");a&&!e.includes(s)||he(t,l,r,n.callable,n.delegationSelector)}}else{if(!Object.keys(c).length)return;he(t,l,r,o,s?i:null)}},trigger(t,e,i){if("string"!=typeof e||!t)return null;const n=Vt();let s=null,o=!0,r=!0,a=!1;e!==ue(e)&&n&&(s=n.Event(e,i),n(t).trigger(s),o=!s.isPropagationStopped(),r=!s.isImmediatePropagationStopped(),a=s.isDefaultPrevented());const l=pe(new Event(e,{bubbles:o,cancelable:!0}),i);return a&&l.preventDefault(),r&&t.dispatchEvent(l),l.defaultPrevented&&s&&s.preventDefault(),l}};function pe(t,e={}){for(const[i,n]of Object.entries(e))try{t[i]=n}catch(e){Object.defineProperty(t,i,{configurable:!0,get:()=>n})}return t}function me(t){if("true"===t)return!0;if("false"===t)return!1;if(t===Number(t).toString())return Number(t);if(""===t||"null"===t)return null;if("string"!=typeof t)return t;try{return JSON.parse(decodeURIComponent(t))}catch(e){return t}}function ge(t){return t.replace(/[A-Z]/g,(t=>`-${t.toLowerCase()}`))}const _e={setDataAttribute(t,e,i){t.setAttribute(`data-bs-${ge(e)}`,i)},removeDataAttribute(t,e){t.removeAttribute(`data-bs-${ge(e)}`)},getDataAttributes(t){if(!t)return{};const e={},i=Object.keys(t.dataset).filter((t=>t.startsWith("bs")&&!t.startsWith("bsConfig")));for(const n of i){let i=n.replace(/^bs/,"");i=i.charAt(0).toLowerCase()+i.slice(1,i.length),e[i]=me(t.dataset[n])}return e},getDataAttribute:(t,e)=>me(t.getAttribute(`data-bs-${ge(e)}`))};class be{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(t){return t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t}_mergeConfigObj(t,e){const i=Ft(e)?_e.getDataAttribute(e,"config"):{};return{...this.constructor.Default,..."object"==typeof i?i:{},...Ft(e)?_e.getDataAttributes(e):{},..."object"==typeof t?t:{}}}_typeCheckConfig(t,e=this.constructor.DefaultType){for(const[n,s]of Object.entries(e)){const e=t[n],o=Ft(e)?"element":null==(i=e)?`${i}`:Object.prototype.toString.call(i).match(/\s([a-z]+)/i)[1].toLowerCase();if(!new RegExp(s).test(o))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${n}" provided type "${o}" but expected type "${s}".`)}var i}}class ve extends be{constructor(t,e){super(),(t=Ht(t))&&(this._element=t,this._config=this._getConfig(e),Nt.set(this._element,this.constructor.DATA_KEY,this))}dispose(){Nt.remove(this._element,this.constructor.DATA_KEY),fe.off(this._element,this.constructor.EVENT_KEY);for(const t of Object.getOwnPropertyNames(this))this[t]=null}_queueCallback(t,e,i=!0){Ut(t,e,i)}_getConfig(t){return t=this._mergeConfigObj(t,this._element),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}static getInstance(t){return Nt.get(Ht(t),this.DATA_KEY)}static getOrCreateInstance(t,e={}){return this.getInstance(t)||new this(t,"object"==typeof e?e:null)}static get VERSION(){return"5.3.3"}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(t){return`${t}${this.EVENT_KEY}`}}const ye=t=>{let e=t.getAttribute("data-bs-target");if(!e||"#"===e){let i=t.getAttribute("href");if(!i||!i.includes("#")&&!i.startsWith("."))return null;i.includes("#")&&!i.startsWith("#")&&(i=`#${i.split("#")[1]}`),e=i&&"#"!==i?i.trim():null}return e?e.split(",").map((t=>Mt(t))).join(","):null},we={find:(t,e=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(e,t)),findOne:(t,e=document.documentElement)=>Element.prototype.querySelector.call(e,t),children:(t,e)=>[].concat(...t.children).filter((t=>t.matches(e))),parents(t,e){const i=[];let n=t.parentNode.closest(e);for(;n;)i.push(n),n=n.parentNode.closest(e);return i},prev(t,e){let i=t.previousElementSibling;for(;i;){if(i.matches(e))return[i];i=i.previousElementSibling}return[]},next(t,e){let i=t.nextElementSibling;for(;i;){if(i.matches(e))return[i];i=i.nextElementSibling}return[]},focusableChildren(t){const e=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map((t=>`${t}:not([tabindex^="-"])`)).join(",");return this.find(e,t).filter((t=>!Wt(t)&&Bt(t)))},getSelectorFromElement(t){const e=ye(t);return e&&we.findOne(e)?e:null},getElementFromSelector(t){const e=ye(t);return e?we.findOne(e):null},getMultipleElementsFromSelector(t){const e=ye(t);return e?we.find(e):[]}},Ee=(t,e="hide")=>{const i=`click.dismiss${t.EVENT_KEY}`,n=t.NAME;fe.on(document,i,`[data-bs-dismiss="${n}"]`,(function(i){if(["A","AREA"].includes(this.tagName)&&i.preventDefault(),Wt(this))return;const s=we.getElementFromSelector(this)||this.closest(`.${n}`);t.getOrCreateInstance(s)[e]()}))},Ae=".bs.alert",Te=`close${Ae}`,Ce=`closed${Ae}`;class Oe extends ve{static get NAME(){return"alert"}close(){if(fe.trigger(this._element,Te).defaultPrevented)return;this._element.classList.remove("show");const t=this._element.classList.contains("fade");this._queueCallback((()=>this._destroyElement()),this._element,t)}_destroyElement(){this._element.remove(),fe.trigger(this._element,Ce),this.dispose()}static jQueryInterface(t){return this.each((function(){const e=Oe.getOrCreateInstance(this);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t](this)}}))}}Ee(Oe,"close"),Qt(Oe);const xe='[data-bs-toggle="button"]';class ke extends ve{static get NAME(){return"button"}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}static jQueryInterface(t){return this.each((function(){const e=ke.getOrCreateInstance(this);"toggle"===t&&e[t]()}))}}fe.on(document,"click.bs.button.data-api",xe,(t=>{t.preventDefault();const e=t.target.closest(xe);ke.getOrCreateInstance(e).toggle()})),Qt(ke);const Le=".bs.swipe",Se=`touchstart${Le}`,De=`touchmove${Le}`,$e=`touchend${Le}`,Ie=`pointerdown${Le}`,Ne=`pointerup${Le}`,Pe={endCallback:null,leftCallback:null,rightCallback:null},Me={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class je extends be{constructor(t,e){super(),this._element=t,t&&je.isSupported()&&(this._config=this._getConfig(e),this._deltaX=0,this._supportPointerEvents=Boolean(window.PointerEvent),this._initEvents())}static get Default(){return Pe}static get DefaultType(){return Me}static get NAME(){return"swipe"}dispose(){fe.off(this._element,Le)}_start(t){this._supportPointerEvents?this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX):this._deltaX=t.touches[0].clientX}_end(t){this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX-this._deltaX),this._handleSwipe(),Xt(this._config.endCallback)}_move(t){this._deltaX=t.touches&&t.touches.length>1?0:t.touches[0].clientX-this._deltaX}_handleSwipe(){const t=Math.abs(this._deltaX);if(t<=40)return;const e=t/this._deltaX;this._deltaX=0,e&&Xt(e>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(fe.on(this._element,Ie,(t=>this._start(t))),fe.on(this._element,Ne,(t=>this._end(t))),this._element.classList.add("pointer-event")):(fe.on(this._element,Se,(t=>this._start(t))),fe.on(this._element,De,(t=>this._move(t))),fe.on(this._element,$e,(t=>this._end(t))))}_eventIsPointerPenTouch(t){return this._supportPointerEvents&&("pen"===t.pointerType||"touch"===t.pointerType)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const Fe=".bs.carousel",He=".data-api",Be="ArrowLeft",We="ArrowRight",ze="next",Re="prev",qe="left",Ve="right",Ye=`slide${Fe}`,Ke=`slid${Fe}`,Qe=`keydown${Fe}`,Xe=`mouseenter${Fe}`,Ue=`mouseleave${Fe}`,Ge=`dragstart${Fe}`,Je=`load${Fe}${He}`,Ze=`click${Fe}${He}`,ti="carousel",ei="active",ii=".active",ni=".carousel-item",si=ii+ni,oi={[Be]:Ve,[We]:qe},ri={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},ai={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class li extends ve{constructor(t,e){super(t,e),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=we.findOne(".carousel-indicators",this._element),this._addEventListeners(),this._config.ride===ti&&this.cycle()}static get Default(){return ri}static get DefaultType(){return ai}static get NAME(){return"carousel"}next(){this._slide(ze)}nextWhenVisible(){!document.hidden&&Bt(this._element)&&this.next()}prev(){this._slide(Re)}pause(){this._isSliding&&jt(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval((()=>this.nextWhenVisible()),this._config.interval)}_maybeEnableCycle(){this._config.ride&&(this._isSliding?fe.one(this._element,Ke,(()=>this.cycle())):this.cycle())}to(t){const e=this._getItems();if(t>e.length-1||t<0)return;if(this._isSliding)return void fe.one(this._element,Ke,(()=>this.to(t)));const i=this._getItemIndex(this._getActive());if(i===t)return;const n=t>i?ze:Re;this._slide(n,e[t])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(t){return t.defaultInterval=t.interval,t}_addEventListeners(){this._config.keyboard&&fe.on(this._element,Qe,(t=>this._keydown(t))),"hover"===this._config.pause&&(fe.on(this._element,Xe,(()=>this.pause())),fe.on(this._element,Ue,(()=>this._maybeEnableCycle()))),this._config.touch&&je.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const t of we.find(".carousel-item img",this._element))fe.on(t,Ge,(t=>t.preventDefault()));const t={leftCallback:()=>this._slide(this._directionToOrder(qe)),rightCallback:()=>this._slide(this._directionToOrder(Ve)),endCallback:()=>{"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout((()=>this._maybeEnableCycle()),500+this._config.interval))}};this._swipeHelper=new je(this._element,t)}_keydown(t){if(/input|textarea/i.test(t.target.tagName))return;const e=oi[t.key];e&&(t.preventDefault(),this._slide(this._directionToOrder(e)))}_getItemIndex(t){return this._getItems().indexOf(t)}_setActiveIndicatorElement(t){if(!this._indicatorsElement)return;const e=we.findOne(ii,this._indicatorsElement);e.classList.remove(ei),e.removeAttribute("aria-current");const i=we.findOne(`[data-bs-slide-to="${t}"]`,this._indicatorsElement);i&&(i.classList.add(ei),i.setAttribute("aria-current","true"))}_updateInterval(){const t=this._activeElement||this._getActive();if(!t)return;const e=Number.parseInt(t.getAttribute("data-bs-interval"),10);this._config.interval=e||this._config.defaultInterval}_slide(t,e=null){if(this._isSliding)return;const i=this._getActive(),n=t===ze,s=e||Gt(this._getItems(),i,n,this._config.wrap);if(s===i)return;const o=this._getItemIndex(s),r=e=>fe.trigger(this._element,e,{relatedTarget:s,direction:this._orderToDirection(t),from:this._getItemIndex(i),to:o});if(r(Ye).defaultPrevented)return;if(!i||!s)return;const a=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(o),this._activeElement=s;const l=n?"carousel-item-start":"carousel-item-end",c=n?"carousel-item-next":"carousel-item-prev";s.classList.add(c),qt(s),i.classList.add(l),s.classList.add(l),this._queueCallback((()=>{s.classList.remove(l,c),s.classList.add(ei),i.classList.remove(ei,c,l),this._isSliding=!1,r(Ke)}),i,this._isAnimated()),a&&this.cycle()}_isAnimated(){return this._element.classList.contains("slide")}_getActive(){return we.findOne(si,this._element)}_getItems(){return we.find(ni,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(t){return Kt()?t===qe?Re:ze:t===qe?ze:Re}_orderToDirection(t){return Kt()?t===Re?qe:Ve:t===Re?Ve:qe}static jQueryInterface(t){return this.each((function(){const e=li.getOrCreateInstance(this,t);if("number"!=typeof t){if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}}else e.to(t)}))}}fe.on(document,Ze,"[data-bs-slide], [data-bs-slide-to]",(function(t){const e=we.getElementFromSelector(this);if(!e||!e.classList.contains(ti))return;t.preventDefault();const i=li.getOrCreateInstance(e),n=this.getAttribute("data-bs-slide-to");return n?(i.to(n),void i._maybeEnableCycle()):"next"===_e.getDataAttribute(this,"slide")?(i.next(),void i._maybeEnableCycle()):(i.prev(),void i._maybeEnableCycle())})),fe.on(window,Je,(()=>{const t=we.find('[data-bs-ride="carousel"]');for(const e of t)li.getOrCreateInstance(e)})),Qt(li);const ci=".bs.collapse",hi=`show${ci}`,di=`shown${ci}`,ui=`hide${ci}`,fi=`hidden${ci}`,pi=`click${ci}.data-api`,mi="show",gi="collapse",_i="collapsing",bi=`:scope .${gi} .${gi}`,vi='[data-bs-toggle="collapse"]',yi={parent:null,toggle:!0},wi={parent:"(null|element)",toggle:"boolean"};class Ei extends ve{constructor(t,e){super(t,e),this._isTransitioning=!1,this._triggerArray=[];const i=we.find(vi);for(const t of i){const e=we.getSelectorFromElement(t),i=we.find(e).filter((t=>t===this._element));null!==e&&i.length&&this._triggerArray.push(t)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return yi}static get DefaultType(){return wi}static get NAME(){return"collapse"}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let t=[];if(this._config.parent&&(t=this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter((t=>t!==this._element)).map((t=>Ei.getOrCreateInstance(t,{toggle:!1})))),t.length&&t[0]._isTransitioning)return;if(fe.trigger(this._element,hi).defaultPrevented)return;for(const e of t)e.hide();const e=this._getDimension();this._element.classList.remove(gi),this._element.classList.add(_i),this._element.style[e]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const i=`scroll${e[0].toUpperCase()+e.slice(1)}`;this._queueCallback((()=>{this._isTransitioning=!1,this._element.classList.remove(_i),this._element.classList.add(gi,mi),this._element.style[e]="",fe.trigger(this._element,di)}),this._element,!0),this._element.style[e]=`${this._element[i]}px`}hide(){if(this._isTransitioning||!this._isShown())return;if(fe.trigger(this._element,ui).defaultPrevented)return;const t=this._getDimension();this._element.style[t]=`${this._element.getBoundingClientRect()[t]}px`,qt(this._element),this._element.classList.add(_i),this._element.classList.remove(gi,mi);for(const t of this._triggerArray){const e=we.getElementFromSelector(t);e&&!this._isShown(e)&&this._addAriaAndCollapsedClass([t],!1)}this._isTransitioning=!0,this._element.style[t]="",this._queueCallback((()=>{this._isTransitioning=!1,this._element.classList.remove(_i),this._element.classList.add(gi),fe.trigger(this._element,fi)}),this._element,!0)}_isShown(t=this._element){return t.classList.contains(mi)}_configAfterMerge(t){return t.toggle=Boolean(t.toggle),t.parent=Ht(t.parent),t}_getDimension(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}_initializeChildren(){if(!this._config.parent)return;const t=this._getFirstLevelChildren(vi);for(const e of t){const t=we.getElementFromSelector(e);t&&this._addAriaAndCollapsedClass([e],this._isShown(t))}}_getFirstLevelChildren(t){const e=we.find(bi,this._config.parent);return we.find(t,this._config.parent).filter((t=>!e.includes(t)))}_addAriaAndCollapsedClass(t,e){if(t.length)for(const i of t)i.classList.toggle("collapsed",!e),i.setAttribute("aria-expanded",e)}static jQueryInterface(t){const e={};return"string"==typeof t&&/show|hide/.test(t)&&(e.toggle=!1),this.each((function(){const i=Ei.getOrCreateInstance(this,e);if("string"==typeof t){if(void 0===i[t])throw new TypeError(`No method named "${t}"`);i[t]()}}))}}fe.on(document,pi,vi,(function(t){("A"===t.target.tagName||t.delegateTarget&&"A"===t.delegateTarget.tagName)&&t.preventDefault();for(const t of we.getMultipleElementsFromSelector(this))Ei.getOrCreateInstance(t,{toggle:!1}).toggle()})),Qt(Ei);const Ai="dropdown",Ti=".bs.dropdown",Ci=".data-api",Oi="ArrowUp",xi="ArrowDown",ki=`hide${Ti}`,Li=`hidden${Ti}`,Si=`show${Ti}`,Di=`shown${Ti}`,$i=`click${Ti}${Ci}`,Ii=`keydown${Ti}${Ci}`,Ni=`keyup${Ti}${Ci}`,Pi="show",Mi='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',ji=`${Mi}.${Pi}`,Fi=".dropdown-menu",Hi=Kt()?"top-end":"top-start",Bi=Kt()?"top-start":"top-end",Wi=Kt()?"bottom-end":"bottom-start",zi=Kt()?"bottom-start":"bottom-end",Ri=Kt()?"left-start":"right-start",qi=Kt()?"right-start":"left-start",Vi={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},Yi={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class Ki extends ve{constructor(t,e){super(t,e),this._popper=null,this._parent=this._element.parentNode,this._menu=we.next(this._element,Fi)[0]||we.prev(this._element,Fi)[0]||we.findOne(Fi,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return Vi}static get DefaultType(){return Yi}static get NAME(){return Ai}toggle(){return this._isShown()?this.hide():this.show()}show(){if(Wt(this._element)||this._isShown())return;const t={relatedTarget:this._element};if(!fe.trigger(this._element,Si,t).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(".navbar-nav"))for(const t of[].concat(...document.body.children))fe.on(t,"mouseover",Rt);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(Pi),this._element.classList.add(Pi),fe.trigger(this._element,Di,t)}}hide(){if(Wt(this._element)||!this._isShown())return;const t={relatedTarget:this._element};this._completeHide(t)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(t){if(!fe.trigger(this._element,ki,t).defaultPrevented){if("ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))fe.off(t,"mouseover",Rt);this._popper&&this._popper.destroy(),this._menu.classList.remove(Pi),this._element.classList.remove(Pi),this._element.setAttribute("aria-expanded","false"),_e.removeDataAttribute(this._menu,"popper"),fe.trigger(this._element,Li,t)}}_getConfig(t){if("object"==typeof(t=super._getConfig(t)).reference&&!Ft(t.reference)&&"function"!=typeof t.reference.getBoundingClientRect)throw new TypeError(`${Ai.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return t}_createPopper(){if(void 0===e)throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");let t=this._element;"parent"===this._config.reference?t=this._parent:Ft(this._config.reference)?t=Ht(this._config.reference):"object"==typeof this._config.reference&&(t=this._config.reference);const i=this._getPopperConfig();this._popper=Dt(t,this._menu,i)}_isShown(){return this._menu.classList.contains(Pi)}_getPlacement(){const t=this._parent;if(t.classList.contains("dropend"))return Ri;if(t.classList.contains("dropstart"))return qi;if(t.classList.contains("dropup-center"))return"top";if(t.classList.contains("dropdown-center"))return"bottom";const e="end"===getComputedStyle(this._menu).getPropertyValue("--bs-position").trim();return t.classList.contains("dropup")?e?Bi:Hi:e?zi:Wi}_detectNavbar(){return null!==this._element.closest(".navbar")}_getOffset(){const{offset:t}=this._config;return"string"==typeof t?t.split(",").map((t=>Number.parseInt(t,10))):"function"==typeof t?e=>t(e,this._element):t}_getPopperConfig(){const t={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||"static"===this._config.display)&&(_e.setDataAttribute(this._menu,"popper","static"),t.modifiers=[{name:"applyStyles",enabled:!1}]),{...t,...Xt(this._config.popperConfig,[t])}}_selectMenuItem({key:t,target:e}){const i=we.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",this._menu).filter((t=>Bt(t)));i.length&&Gt(i,e,t===xi,!i.includes(e)).focus()}static jQueryInterface(t){return this.each((function(){const e=Ki.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}static clearMenus(t){if(2===t.button||"keyup"===t.type&&"Tab"!==t.key)return;const e=we.find(ji);for(const i of e){const e=Ki.getInstance(i);if(!e||!1===e._config.autoClose)continue;const n=t.composedPath(),s=n.includes(e._menu);if(n.includes(e._element)||"inside"===e._config.autoClose&&!s||"outside"===e._config.autoClose&&s)continue;if(e._menu.contains(t.target)&&("keyup"===t.type&&"Tab"===t.key||/input|select|option|textarea|form/i.test(t.target.tagName)))continue;const o={relatedTarget:e._element};"click"===t.type&&(o.clickEvent=t),e._completeHide(o)}}static dataApiKeydownHandler(t){const e=/input|textarea/i.test(t.target.tagName),i="Escape"===t.key,n=[Oi,xi].includes(t.key);if(!n&&!i)return;if(e&&!i)return;t.preventDefault();const s=this.matches(Mi)?this:we.prev(this,Mi)[0]||we.next(this,Mi)[0]||we.findOne(Mi,t.delegateTarget.parentNode),o=Ki.getOrCreateInstance(s);if(n)return t.stopPropagation(),o.show(),void o._selectMenuItem(t);o._isShown()&&(t.stopPropagation(),o.hide(),s.focus())}}fe.on(document,Ii,Mi,Ki.dataApiKeydownHandler),fe.on(document,Ii,Fi,Ki.dataApiKeydownHandler),fe.on(document,$i,Ki.clearMenus),fe.on(document,Ni,Ki.clearMenus),fe.on(document,$i,Mi,(function(t){t.preventDefault(),Ki.getOrCreateInstance(this).toggle()})),Qt(Ki);const Qi="backdrop",Xi="show",Ui=`mousedown.bs.${Qi}`,Gi={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},Ji={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class Zi extends be{constructor(t){super(),this._config=this._getConfig(t),this._isAppended=!1,this._element=null}static get Default(){return Gi}static get DefaultType(){return Ji}static get NAME(){return Qi}show(t){if(!this._config.isVisible)return void Xt(t);this._append();const e=this._getElement();this._config.isAnimated&&qt(e),e.classList.add(Xi),this._emulateAnimation((()=>{Xt(t)}))}hide(t){this._config.isVisible?(this._getElement().classList.remove(Xi),this._emulateAnimation((()=>{this.dispose(),Xt(t)}))):Xt(t)}dispose(){this._isAppended&&(fe.off(this._element,Ui),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const t=document.createElement("div");t.className=this._config.className,this._config.isAnimated&&t.classList.add("fade"),this._element=t}return this._element}_configAfterMerge(t){return t.rootElement=Ht(t.rootElement),t}_append(){if(this._isAppended)return;const t=this._getElement();this._config.rootElement.append(t),fe.on(t,Ui,(()=>{Xt(this._config.clickCallback)})),this._isAppended=!0}_emulateAnimation(t){Ut(t,this._getElement(),this._config.isAnimated)}}const tn=".bs.focustrap",en=`focusin${tn}`,nn=`keydown.tab${tn}`,sn="backward",on={autofocus:!0,trapElement:null},rn={autofocus:"boolean",trapElement:"element"};class an extends be{constructor(t){super(),this._config=this._getConfig(t),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return on}static get DefaultType(){return rn}static get NAME(){return"focustrap"}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),fe.off(document,tn),fe.on(document,en,(t=>this._handleFocusin(t))),fe.on(document,nn,(t=>this._handleKeydown(t))),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,fe.off(document,tn))}_handleFocusin(t){const{trapElement:e}=this._config;if(t.target===document||t.target===e||e.contains(t.target))return;const i=we.focusableChildren(e);0===i.length?e.focus():this._lastTabNavDirection===sn?i[i.length-1].focus():i[0].focus()}_handleKeydown(t){"Tab"===t.key&&(this._lastTabNavDirection=t.shiftKey?sn:"forward")}}const ln=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",cn=".sticky-top",hn="padding-right",dn="margin-right";class un{constructor(){this._element=document.body}getWidth(){const t=document.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}hide(){const t=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,hn,(e=>e+t)),this._setElementAttributes(ln,hn,(e=>e+t)),this._setElementAttributes(cn,dn,(e=>e-t))}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,hn),this._resetElementAttributes(ln,hn),this._resetElementAttributes(cn,dn)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(t,e,i){const n=this.getWidth();this._applyManipulationCallback(t,(t=>{if(t!==this._element&&window.innerWidth>t.clientWidth+n)return;this._saveInitialAttribute(t,e);const s=window.getComputedStyle(t).getPropertyValue(e);t.style.setProperty(e,`${i(Number.parseFloat(s))}px`)}))}_saveInitialAttribute(t,e){const i=t.style.getPropertyValue(e);i&&_e.setDataAttribute(t,e,i)}_resetElementAttributes(t,e){this._applyManipulationCallback(t,(t=>{const i=_e.getDataAttribute(t,e);null!==i?(_e.removeDataAttribute(t,e),t.style.setProperty(e,i)):t.style.removeProperty(e)}))}_applyManipulationCallback(t,e){if(Ft(t))e(t);else for(const i of we.find(t,this._element))e(i)}}const fn=".bs.modal",pn=`hide${fn}`,mn=`hidePrevented${fn}`,gn=`hidden${fn}`,_n=`show${fn}`,bn=`shown${fn}`,vn=`resize${fn}`,yn=`click.dismiss${fn}`,wn=`mousedown.dismiss${fn}`,En=`keydown.dismiss${fn}`,An=`click${fn}.data-api`,Tn="modal-open",Cn="show",On="modal-static",xn={backdrop:!0,focus:!0,keyboard:!0},kn={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class Ln extends ve{constructor(t,e){super(t,e),this._dialog=we.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new un,this._addEventListeners()}static get Default(){return xn}static get DefaultType(){return kn}static get NAME(){return"modal"}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){this._isShown||this._isTransitioning||fe.trigger(this._element,_n,{relatedTarget:t}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(Tn),this._adjustDialog(),this._backdrop.show((()=>this._showElement(t))))}hide(){this._isShown&&!this._isTransitioning&&(fe.trigger(this._element,pn).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(Cn),this._queueCallback((()=>this._hideModal()),this._element,this._isAnimated())))}dispose(){fe.off(window,fn),fe.off(this._dialog,fn),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new Zi({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new an({trapElement:this._element})}_showElement(t){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const e=we.findOne(".modal-body",this._dialog);e&&(e.scrollTop=0),qt(this._element),this._element.classList.add(Cn),this._queueCallback((()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,fe.trigger(this._element,bn,{relatedTarget:t})}),this._dialog,this._isAnimated())}_addEventListeners(){fe.on(this._element,En,(t=>{"Escape"===t.key&&(this._config.keyboard?this.hide():this._triggerBackdropTransition())})),fe.on(window,vn,(()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()})),fe.on(this._element,wn,(t=>{fe.one(this._element,yn,(e=>{this._element===t.target&&this._element===e.target&&("static"!==this._config.backdrop?this._config.backdrop&&this.hide():this._triggerBackdropTransition())}))}))}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide((()=>{document.body.classList.remove(Tn),this._resetAdjustments(),this._scrollBar.reset(),fe.trigger(this._element,gn)}))}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(fe.trigger(this._element,mn).defaultPrevented)return;const t=this._element.scrollHeight>document.documentElement.clientHeight,e=this._element.style.overflowY;"hidden"===e||this._element.classList.contains(On)||(t||(this._element.style.overflowY="hidden"),this._element.classList.add(On),this._queueCallback((()=>{this._element.classList.remove(On),this._queueCallback((()=>{this._element.style.overflowY=e}),this._dialog)}),this._dialog),this._element.focus())}_adjustDialog(){const t=this._element.scrollHeight>document.documentElement.clientHeight,e=this._scrollBar.getWidth(),i=e>0;if(i&&!t){const t=Kt()?"paddingLeft":"paddingRight";this._element.style[t]=`${e}px`}if(!i&&t){const t=Kt()?"paddingRight":"paddingLeft";this._element.style[t]=`${e}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(t,e){return this.each((function(){const i=Ln.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===i[t])throw new TypeError(`No method named "${t}"`);i[t](e)}}))}}fe.on(document,An,'[data-bs-toggle="modal"]',(function(t){const e=we.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&t.preventDefault(),fe.one(e,_n,(t=>{t.defaultPrevented||fe.one(e,gn,(()=>{Bt(this)&&this.focus()}))}));const i=we.findOne(".modal.show");i&&Ln.getInstance(i).hide(),Ln.getOrCreateInstance(e).toggle(this)})),Ee(Ln),Qt(Ln);const Sn=".bs.offcanvas",Dn=".data-api",$n=`load${Sn}${Dn}`,In="show",Nn="showing",Pn="hiding",Mn=".offcanvas.show",jn=`show${Sn}`,Fn=`shown${Sn}`,Hn=`hide${Sn}`,Bn=`hidePrevented${Sn}`,Wn=`hidden${Sn}`,zn=`resize${Sn}`,Rn=`click${Sn}${Dn}`,qn=`keydown.dismiss${Sn}`,Vn={backdrop:!0,keyboard:!0,scroll:!1},Yn={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class Kn extends ve{constructor(t,e){super(t,e),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return Vn}static get DefaultType(){return Yn}static get NAME(){return"offcanvas"}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){this._isShown||fe.trigger(this._element,jn,{relatedTarget:t}).defaultPrevented||(this._isShown=!0,this._backdrop.show(),this._config.scroll||(new un).hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(Nn),this._queueCallback((()=>{this._config.scroll&&!this._config.backdrop||this._focustrap.activate(),this._element.classList.add(In),this._element.classList.remove(Nn),fe.trigger(this._element,Fn,{relatedTarget:t})}),this._element,!0))}hide(){this._isShown&&(fe.trigger(this._element,Hn).defaultPrevented||(this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(Pn),this._backdrop.hide(),this._queueCallback((()=>{this._element.classList.remove(In,Pn),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||(new un).reset(),fe.trigger(this._element,Wn)}),this._element,!0)))}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const t=Boolean(this._config.backdrop);return new Zi({className:"offcanvas-backdrop",isVisible:t,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:t?()=>{"static"!==this._config.backdrop?this.hide():fe.trigger(this._element,Bn)}:null})}_initializeFocusTrap(){return new an({trapElement:this._element})}_addEventListeners(){fe.on(this._element,qn,(t=>{"Escape"===t.key&&(this._config.keyboard?this.hide():fe.trigger(this._element,Bn))}))}static jQueryInterface(t){return this.each((function(){const e=Kn.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t](this)}}))}}fe.on(document,Rn,'[data-bs-toggle="offcanvas"]',(function(t){const e=we.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&t.preventDefault(),Wt(this))return;fe.one(e,Wn,(()=>{Bt(this)&&this.focus()}));const i=we.findOne(Mn);i&&i!==e&&Kn.getInstance(i).hide(),Kn.getOrCreateInstance(e).toggle(this)})),fe.on(window,$n,(()=>{for(const t of we.find(Mn))Kn.getOrCreateInstance(t).show()})),fe.on(window,zn,(()=>{for(const t of we.find("[aria-modal][class*=show][class*=offcanvas-]"))"fixed"!==getComputedStyle(t).position&&Kn.getOrCreateInstance(t).hide()})),Ee(Kn),Qt(Kn);const Qn={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},Xn=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),Un=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,Gn=(t,e)=>{const i=t.nodeName.toLowerCase();return e.includes(i)?!Xn.has(i)||Boolean(Un.test(t.nodeValue)):e.filter((t=>t instanceof RegExp)).some((t=>t.test(i)))},Jn={allowList:Qn,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"
"},Zn={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},ts={entry:"(string|element|function|null)",selector:"(string|element)"};class es extends be{constructor(t){super(),this._config=this._getConfig(t)}static get Default(){return Jn}static get DefaultType(){return Zn}static get NAME(){return"TemplateFactory"}getContent(){return Object.values(this._config.content).map((t=>this._resolvePossibleFunction(t))).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(t){return this._checkContent(t),this._config.content={...this._config.content,...t},this}toHtml(){const t=document.createElement("div");t.innerHTML=this._maybeSanitize(this._config.template);for(const[e,i]of Object.entries(this._config.content))this._setContent(t,i,e);const e=t.children[0],i=this._resolvePossibleFunction(this._config.extraClass);return i&&e.classList.add(...i.split(" ")),e}_typeCheckConfig(t){super._typeCheckConfig(t),this._checkContent(t.content)}_checkContent(t){for(const[e,i]of Object.entries(t))super._typeCheckConfig({selector:e,entry:i},ts)}_setContent(t,e,i){const n=we.findOne(i,t);n&&((e=this._resolvePossibleFunction(e))?Ft(e)?this._putElementInTemplate(Ht(e),n):this._config.html?n.innerHTML=this._maybeSanitize(e):n.textContent=e:n.remove())}_maybeSanitize(t){return this._config.sanitize?function(t,e,i){if(!t.length)return t;if(i&&"function"==typeof i)return i(t);const n=(new window.DOMParser).parseFromString(t,"text/html"),s=[].concat(...n.body.querySelectorAll("*"));for(const t of s){const i=t.nodeName.toLowerCase();if(!Object.keys(e).includes(i)){t.remove();continue}const n=[].concat(...t.attributes),s=[].concat(e["*"]||[],e[i]||[]);for(const e of n)Gn(e,s)||t.removeAttribute(e.nodeName)}return n.body.innerHTML}(t,this._config.allowList,this._config.sanitizeFn):t}_resolvePossibleFunction(t){return Xt(t,[this])}_putElementInTemplate(t,e){if(this._config.html)return e.innerHTML="",void e.append(t);e.textContent=t.textContent}}const is=new Set(["sanitize","allowList","sanitizeFn"]),ns="fade",ss="show",os=".tooltip-inner",rs=".modal",as="hide.bs.modal",ls="hover",cs="focus",hs={AUTO:"auto",TOP:"top",RIGHT:Kt()?"left":"right",BOTTOM:"bottom",LEFT:Kt()?"right":"left"},ds={allowList:Qn,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'',title:"",trigger:"hover focus"},us={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class fs extends ve{constructor(t,i){if(void 0===e)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(t,i),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return ds}static get DefaultType(){return us}static get NAME(){return"tooltip"}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){this._isEnabled&&(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()?this._leave():this._enter())}dispose(){clearTimeout(this._timeout),fe.off(this._element.closest(rs),as,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;const t=fe.trigger(this._element,this.constructor.eventName("show")),e=(zt(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(t.defaultPrevented||!e)return;this._disposePopper();const i=this._getTipElement();this._element.setAttribute("aria-describedby",i.getAttribute("id"));const{container:n}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(n.append(i),fe.trigger(this._element,this.constructor.eventName("inserted"))),this._popper=this._createPopper(i),i.classList.add(ss),"ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))fe.on(t,"mouseover",Rt);this._queueCallback((()=>{fe.trigger(this._element,this.constructor.eventName("shown")),!1===this._isHovered&&this._leave(),this._isHovered=!1}),this.tip,this._isAnimated())}hide(){if(this._isShown()&&!fe.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented){if(this._getTipElement().classList.remove(ss),"ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))fe.off(t,"mouseover",Rt);this._activeTrigger.click=!1,this._activeTrigger[cs]=!1,this._activeTrigger[ls]=!1,this._isHovered=null,this._queueCallback((()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),fe.trigger(this._element,this.constructor.eventName("hidden")))}),this.tip,this._isAnimated())}}update(){this._popper&&this._popper.update()}_isWithContent(){return Boolean(this._getTitle())}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(t){const e=this._getTemplateFactory(t).toHtml();if(!e)return null;e.classList.remove(ns,ss),e.classList.add(`bs-${this.constructor.NAME}-auto`);const i=(t=>{do{t+=Math.floor(1e6*Math.random())}while(document.getElementById(t));return t})(this.constructor.NAME).toString();return e.setAttribute("id",i),this._isAnimated()&&e.classList.add(ns),e}setContent(t){this._newContent=t,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(t){return this._templateFactory?this._templateFactory.changeContent(t):this._templateFactory=new es({...this._config,content:t,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[os]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(t){return this.constructor.getOrCreateInstance(t.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(ns)}_isShown(){return this.tip&&this.tip.classList.contains(ss)}_createPopper(t){const e=Xt(this._config.placement,[this,t,this._element]),i=hs[e.toUpperCase()];return Dt(this._element,t,this._getPopperConfig(i))}_getOffset(){const{offset:t}=this._config;return"string"==typeof t?t.split(",").map((t=>Number.parseInt(t,10))):"function"==typeof t?e=>t(e,this._element):t}_resolvePossibleFunction(t){return Xt(t,[this._element])}_getPopperConfig(t){const e={placement:t,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:t=>{this._getTipElement().setAttribute("data-popper-placement",t.state.placement)}}]};return{...e,...Xt(this._config.popperConfig,[e])}}_setListeners(){const t=this._config.trigger.split(" ");for(const e of t)if("click"===e)fe.on(this._element,this.constructor.eventName("click"),this._config.selector,(t=>{this._initializeOnDelegatedTarget(t).toggle()}));else if("manual"!==e){const t=e===ls?this.constructor.eventName("mouseenter"):this.constructor.eventName("focusin"),i=e===ls?this.constructor.eventName("mouseleave"):this.constructor.eventName("focusout");fe.on(this._element,t,this._config.selector,(t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusin"===t.type?cs:ls]=!0,e._enter()})),fe.on(this._element,i,this._config.selector,(t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusout"===t.type?cs:ls]=e._element.contains(t.relatedTarget),e._leave()}))}this._hideModalHandler=()=>{this._element&&this.hide()},fe.on(this._element.closest(rs),as,this._hideModalHandler)}_fixTitle(){const t=this._element.getAttribute("title");t&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",t),this._element.setAttribute("data-bs-original-title",t),this._element.removeAttribute("title"))}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout((()=>{this._isHovered&&this.show()}),this._config.delay.show))}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout((()=>{this._isHovered||this.hide()}),this._config.delay.hide))}_setTimeout(t,e){clearTimeout(this._timeout),this._timeout=setTimeout(t,e)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(t){const e=_e.getDataAttributes(this._element);for(const t of Object.keys(e))is.has(t)&&delete e[t];return t={...e,..."object"==typeof t&&t?t:{}},t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t.container=!1===t.container?document.body:Ht(t.container),"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),t}_getDelegateConfig(){const t={};for(const[e,i]of Object.entries(this._config))this.constructor.Default[e]!==i&&(t[e]=i);return t.selector=!1,t.trigger="manual",t}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(t){return this.each((function(){const e=fs.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}}Qt(fs);const ps=".popover-header",ms=".popover-body",gs={...fs.Default,content:"",offset:[0,8],placement:"right",template:'',trigger:"click"},_s={...fs.DefaultType,content:"(null|string|element|function)"};class bs extends fs{static get Default(){return gs}static get DefaultType(){return _s}static get NAME(){return"popover"}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[ps]:this._getTitle(),[ms]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(t){return this.each((function(){const e=bs.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}}Qt(bs);const vs=".bs.scrollspy",ys=`activate${vs}`,ws=`click${vs}`,Es=`load${vs}.data-api`,As="active",Ts="[href]",Cs=".nav-link",Os=`${Cs}, .nav-item > ${Cs}, .list-group-item`,xs={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},ks={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class Ls extends ve{constructor(t,e){super(t,e),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement="visible"===getComputedStyle(this._element).overflowY?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return xs}static get DefaultType(){return ks}static get NAME(){return"scrollspy"}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const t of this._observableSections.values())this._observer.observe(t)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(t){return t.target=Ht(t.target)||document.body,t.rootMargin=t.offset?`${t.offset}px 0px -30%`:t.rootMargin,"string"==typeof t.threshold&&(t.threshold=t.threshold.split(",").map((t=>Number.parseFloat(t)))),t}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(fe.off(this._config.target,ws),fe.on(this._config.target,ws,Ts,(t=>{const e=this._observableSections.get(t.target.hash);if(e){t.preventDefault();const i=this._rootElement||window,n=e.offsetTop-this._element.offsetTop;if(i.scrollTo)return void i.scrollTo({top:n,behavior:"smooth"});i.scrollTop=n}})))}_getNewObserver(){const t={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver((t=>this._observerCallback(t)),t)}_observerCallback(t){const e=t=>this._targetLinks.get(`#${t.target.id}`),i=t=>{this._previousScrollData.visibleEntryTop=t.target.offsetTop,this._process(e(t))},n=(this._rootElement||document.documentElement).scrollTop,s=n>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=n;for(const o of t){if(!o.isIntersecting){this._activeTarget=null,this._clearActiveClass(e(o));continue}const t=o.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(s&&t){if(i(o),!n)return}else s||t||i(o)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const t=we.find(Ts,this._config.target);for(const e of t){if(!e.hash||Wt(e))continue;const t=we.findOne(decodeURI(e.hash),this._element);Bt(t)&&(this._targetLinks.set(decodeURI(e.hash),e),this._observableSections.set(e.hash,t))}}_process(t){this._activeTarget!==t&&(this._clearActiveClass(this._config.target),this._activeTarget=t,t.classList.add(As),this._activateParents(t),fe.trigger(this._element,ys,{relatedTarget:t}))}_activateParents(t){if(t.classList.contains("dropdown-item"))we.findOne(".dropdown-toggle",t.closest(".dropdown")).classList.add(As);else for(const e of we.parents(t,".nav, .list-group"))for(const t of we.prev(e,Os))t.classList.add(As)}_clearActiveClass(t){t.classList.remove(As);const e=we.find(`${Ts}.${As}`,t);for(const t of e)t.classList.remove(As)}static jQueryInterface(t){return this.each((function(){const e=Ls.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}}))}}fe.on(window,Es,(()=>{for(const t of we.find('[data-bs-spy="scroll"]'))Ls.getOrCreateInstance(t)})),Qt(Ls);const Ss=".bs.tab",Ds=`hide${Ss}`,$s=`hidden${Ss}`,Is=`show${Ss}`,Ns=`shown${Ss}`,Ps=`click${Ss}`,Ms=`keydown${Ss}`,js=`load${Ss}`,Fs="ArrowLeft",Hs="ArrowRight",Bs="ArrowUp",Ws="ArrowDown",zs="Home",Rs="End",qs="active",Vs="fade",Ys="show",Ks=".dropdown-toggle",Qs=`:not(${Ks})`,Xs='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',Us=`.nav-link${Qs}, .list-group-item${Qs}, [role="tab"]${Qs}, ${Xs}`,Gs=`.${qs}[data-bs-toggle="tab"], .${qs}[data-bs-toggle="pill"], .${qs}[data-bs-toggle="list"]`;class Js extends ve{constructor(t){super(t),this._parent=this._element.closest('.list-group, .nav, [role="tablist"]'),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),fe.on(this._element,Ms,(t=>this._keydown(t))))}static get NAME(){return"tab"}show(){const t=this._element;if(this._elemIsActive(t))return;const e=this._getActiveElem(),i=e?fe.trigger(e,Ds,{relatedTarget:t}):null;fe.trigger(t,Is,{relatedTarget:e}).defaultPrevented||i&&i.defaultPrevented||(this._deactivate(e,t),this._activate(t,e))}_activate(t,e){t&&(t.classList.add(qs),this._activate(we.getElementFromSelector(t)),this._queueCallback((()=>{"tab"===t.getAttribute("role")?(t.removeAttribute("tabindex"),t.setAttribute("aria-selected",!0),this._toggleDropDown(t,!0),fe.trigger(t,Ns,{relatedTarget:e})):t.classList.add(Ys)}),t,t.classList.contains(Vs)))}_deactivate(t,e){t&&(t.classList.remove(qs),t.blur(),this._deactivate(we.getElementFromSelector(t)),this._queueCallback((()=>{"tab"===t.getAttribute("role")?(t.setAttribute("aria-selected",!1),t.setAttribute("tabindex","-1"),this._toggleDropDown(t,!1),fe.trigger(t,$s,{relatedTarget:e})):t.classList.remove(Ys)}),t,t.classList.contains(Vs)))}_keydown(t){if(![Fs,Hs,Bs,Ws,zs,Rs].includes(t.key))return;t.stopPropagation(),t.preventDefault();const e=this._getChildren().filter((t=>!Wt(t)));let i;if([zs,Rs].includes(t.key))i=e[t.key===zs?0:e.length-1];else{const n=[Hs,Ws].includes(t.key);i=Gt(e,t.target,n,!0)}i&&(i.focus({preventScroll:!0}),Js.getOrCreateInstance(i).show())}_getChildren(){return we.find(Us,this._parent)}_getActiveElem(){return this._getChildren().find((t=>this._elemIsActive(t)))||null}_setInitialAttributes(t,e){this._setAttributeIfNotExists(t,"role","tablist");for(const t of e)this._setInitialAttributesOnChild(t)}_setInitialAttributesOnChild(t){t=this._getInnerElement(t);const e=this._elemIsActive(t),i=this._getOuterElement(t);t.setAttribute("aria-selected",e),i!==t&&this._setAttributeIfNotExists(i,"role","presentation"),e||t.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(t,"role","tab"),this._setInitialAttributesOnTargetPanel(t)}_setInitialAttributesOnTargetPanel(t){const e=we.getElementFromSelector(t);e&&(this._setAttributeIfNotExists(e,"role","tabpanel"),t.id&&this._setAttributeIfNotExists(e,"aria-labelledby",`${t.id}`))}_toggleDropDown(t,e){const i=this._getOuterElement(t);if(!i.classList.contains("dropdown"))return;const n=(t,n)=>{const s=we.findOne(t,i);s&&s.classList.toggle(n,e)};n(Ks,qs),n(".dropdown-menu",Ys),i.setAttribute("aria-expanded",e)}_setAttributeIfNotExists(t,e,i){t.hasAttribute(e)||t.setAttribute(e,i)}_elemIsActive(t){return t.classList.contains(qs)}_getInnerElement(t){return t.matches(Us)?t:we.findOne(Us,t)}_getOuterElement(t){return t.closest(".nav-item, .list-group-item")||t}static jQueryInterface(t){return this.each((function(){const e=Js.getOrCreateInstance(this);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}}))}}fe.on(document,Ps,Xs,(function(t){["A","AREA"].includes(this.tagName)&&t.preventDefault(),Wt(this)||Js.getOrCreateInstance(this).show()})),fe.on(window,js,(()=>{for(const t of we.find(Gs))Js.getOrCreateInstance(t)})),Qt(Js);const Zs=".bs.toast",to=`mouseover${Zs}`,eo=`mouseout${Zs}`,io=`focusin${Zs}`,no=`focusout${Zs}`,so=`hide${Zs}`,oo=`hidden${Zs}`,ro=`show${Zs}`,ao=`shown${Zs}`,lo="hide",co="show",ho="showing",uo={animation:"boolean",autohide:"boolean",delay:"number"},fo={animation:!0,autohide:!0,delay:5e3};class po extends ve{constructor(t,e){super(t,e),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return fo}static get DefaultType(){return uo}static get NAME(){return"toast"}show(){fe.trigger(this._element,ro).defaultPrevented||(this._clearTimeout(),this._config.animation&&this._element.classList.add("fade"),this._element.classList.remove(lo),qt(this._element),this._element.classList.add(co,ho),this._queueCallback((()=>{this._element.classList.remove(ho),fe.trigger(this._element,ao),this._maybeScheduleHide()}),this._element,this._config.animation))}hide(){this.isShown()&&(fe.trigger(this._element,so).defaultPrevented||(this._element.classList.add(ho),this._queueCallback((()=>{this._element.classList.add(lo),this._element.classList.remove(ho,co),fe.trigger(this._element,oo)}),this._element,this._config.animation)))}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(co),super.dispose()}isShown(){return this._element.classList.contains(co)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout((()=>{this.hide()}),this._config.delay)))}_onInteraction(t,e){switch(t.type){case"mouseover":case"mouseout":this._hasMouseInteraction=e;break;case"focusin":case"focusout":this._hasKeyboardInteraction=e}if(e)return void this._clearTimeout();const i=t.relatedTarget;this._element===i||this._element.contains(i)||this._maybeScheduleHide()}_setListeners(){fe.on(this._element,to,(t=>this._onInteraction(t,!0))),fe.on(this._element,eo,(t=>this._onInteraction(t,!1))),fe.on(this._element,io,(t=>this._onInteraction(t,!0))),fe.on(this._element,no,(t=>this._onInteraction(t,!1)))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(t){return this.each((function(){const e=po.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t](this)}}))}}function mo(t){"loading"!=document.readyState?t():document.addEventListener("DOMContentLoaded",t)}Ee(po),Qt(po),mo((function(){[].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')).map((function(t){return new fs(t,{delay:{show:500,hide:100}})}))})),mo((function(){document.getElementById("pst-back-to-top").addEventListener("click",(function(){document.body.scrollTop=0,document.documentElement.scrollTop=0}))})),mo((function(){var t=document.getElementById("pst-back-to-top"),e=document.getElementsByClassName("bd-header")[0].getBoundingClientRect();window.addEventListener("scroll",(function(){this.oldScroll>this.scrollY&&this.scrollY>e.bottom?t.style.display="block":t.style.display="none",this.oldScroll=this.scrollY}))})),window.bootstrap=i})(); +//# sourceMappingURL=bootstrap.js.map \ No newline at end of file diff --git a/_static/scripts/bootstrap.js.LICENSE.txt b/_static/scripts/bootstrap.js.LICENSE.txt new file mode 100644 index 000000000..28755c2c5 --- /dev/null +++ b/_static/scripts/bootstrap.js.LICENSE.txt @@ -0,0 +1,5 @@ +/*! + * Bootstrap v5.3.3 (https://getbootstrap.com/) + * Copyright 2011-2024 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) + */ diff --git a/_static/scripts/bootstrap.js.map b/_static/scripts/bootstrap.js.map new file mode 100644 index 000000000..4a3502aeb --- /dev/null +++ b/_static/scripts/bootstrap.js.map @@ -0,0 +1 @@ +{"version":3,"file":"scripts/bootstrap.js","mappings":";mBACA,IAAIA,EAAsB,CCA1BA,EAAwB,CAACC,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXF,EAAoBI,EAAEF,EAAYC,KAASH,EAAoBI,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDH,EAAwB,CAACS,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFV,EAAyBC,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,01BCLvD,IAAI,EAAM,MACNC,EAAS,SACTC,EAAQ,QACRC,EAAO,OACPC,EAAO,OACPC,EAAiB,CAAC,EAAKJ,EAAQC,EAAOC,GACtCG,EAAQ,QACRC,EAAM,MACNC,EAAkB,kBAClBC,EAAW,WACXC,EAAS,SACTC,EAAY,YACZC,EAAmCP,EAAeQ,QAAO,SAAUC,EAAKC,GACjF,OAAOD,EAAIE,OAAO,CAACD,EAAY,IAAMT,EAAOS,EAAY,IAAMR,GAChE,GAAG,IACQ,EAA0B,GAAGS,OAAOX,EAAgB,CAACD,IAAOS,QAAO,SAAUC,EAAKC,GAC3F,OAAOD,EAAIE,OAAO,CAACD,EAAWA,EAAY,IAAMT,EAAOS,EAAY,IAAMR,GAC3E,GAAG,IAEQU,EAAa,aACbC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AAgBmG,UAAY,CACvC,GACF,IAuBAi/B,IArBA,WACE,IAAIE,EAAMvlC,SAASm9B,eAAe,mBAC9BqI,EAASxlC,SACVylC,uBAAuB,aAAa,GACpCxnC,wBACH1D,OAAOkL,iBAAiB,UAAU,WAC5BkV,KAAK+qB,UAAY/qB,KAAKgrB,SAAWhrB,KAAKgrB,QAAUH,EAAOjtC,OACzDgtC,EAAI7pC,MAAMgxB,QAAU,QAEpB6Y,EAAI7pC,MAAMgxB,QAAU,OAEtB/R,KAAK+qB,UAAY/qB,KAAKgrB,OACxB,GACF,IAUAprC,OAAOqrC,UAAY","sources":["webpack://pydata_sphinx_theme/webpack/bootstrap","webpack://pydata_sphinx_theme/webpack/runtime/define property getters","webpack://pydata_sphinx_theme/webpack/runtime/hasOwnProperty shorthand","webpack://pydata_sphinx_theme/webpack/runtime/make namespace object","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/enums.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/getWindow.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/modifiers/applyStyles.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/utils/getBasePlacement.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/utils/math.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/utils/userAgent.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/contains.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/isTableElement.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/getParentNode.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/utils/within.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/utils/mergePaddingObject.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/utils/getFreshSideObject.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/utils/expandToHashMap.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/modifiers/arrow.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/utils/getVariation.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/modifiers/computeStyles.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/modifiers/eventListeners.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/utils/getOppositePlacement.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/utils/rectToClientRect.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/utils/computeOffsets.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/utils/detectOverflow.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/modifiers/flip.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/modifiers/hide.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/modifiers/offset.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/modifiers/popperOffsets.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/modifiers/preventOverflow.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/utils/getAltAxis.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/utils/orderModifiers.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/createPopper.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/utils/debounce.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/utils/mergeByName.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/popper.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/popper-lite.js","webpack://pydata_sphinx_theme/./node_modules/bootstrap/dist/js/bootstrap.esm.js","webpack://pydata_sphinx_theme/./src/pydata_sphinx_theme/assets/scripts/mixin.js","webpack://pydata_sphinx_theme/./src/pydata_sphinx_theme/assets/scripts/bootstrap.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export var top = 'top';\nexport var bottom = 'bottom';\nexport var right = 'right';\nexport var left = 'left';\nexport var auto = 'auto';\nexport var basePlacements = [top, bottom, right, left];\nexport var start = 'start';\nexport var end = 'end';\nexport var clippingParents = 'clippingParents';\nexport var viewport = 'viewport';\nexport var popper = 'popper';\nexport var reference = 'reference';\nexport var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {\n return acc.concat([placement + \"-\" + start, placement + \"-\" + end]);\n}, []);\nexport var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {\n return acc.concat([placement, placement + \"-\" + start, placement + \"-\" + end]);\n}, []); // modifiers that need to read the DOM\n\nexport var beforeRead = 'beforeRead';\nexport var read = 'read';\nexport var afterRead = 'afterRead'; // pure-logic modifiers\n\nexport var beforeMain = 'beforeMain';\nexport var main = 'main';\nexport var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)\n\nexport var beforeWrite = 'beforeWrite';\nexport var write = 'write';\nexport var afterWrite = 'afterWrite';\nexport var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];","export default function getNodeName(element) {\n return element ? (element.nodeName || '').toLowerCase() : null;\n}","export default function getWindow(node) {\n if (node == null) {\n return window;\n }\n\n if (node.toString() !== '[object Window]') {\n var ownerDocument = node.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView || window : window;\n }\n\n return node;\n}","import getWindow from \"./getWindow.js\";\n\nfunction isElement(node) {\n var OwnElement = getWindow(node).Element;\n return node instanceof OwnElement || node instanceof Element;\n}\n\nfunction isHTMLElement(node) {\n var OwnElement = getWindow(node).HTMLElement;\n return node instanceof OwnElement || node instanceof HTMLElement;\n}\n\nfunction isShadowRoot(node) {\n // IE 11 has no ShadowRoot\n if (typeof ShadowRoot === 'undefined') {\n return false;\n }\n\n var OwnElement = getWindow(node).ShadowRoot;\n return node instanceof OwnElement || node instanceof ShadowRoot;\n}\n\nexport { isElement, isHTMLElement, isShadowRoot };","import getNodeName from \"../dom-utils/getNodeName.js\";\nimport { isHTMLElement } from \"../dom-utils/instanceOf.js\"; // This modifier takes the styles prepared by the `computeStyles` modifier\n// and applies them to the HTMLElements such as popper and arrow\n\nfunction applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}\n\nfunction effect(_ref2) {\n var state = _ref2.state;\n var initialStyles = {\n popper: {\n position: state.options.strategy,\n left: '0',\n top: '0',\n margin: '0'\n },\n arrow: {\n position: 'absolute'\n },\n reference: {}\n };\n Object.assign(state.elements.popper.style, initialStyles.popper);\n state.styles = initialStyles;\n\n if (state.elements.arrow) {\n Object.assign(state.elements.arrow.style, initialStyles.arrow);\n }\n\n return function () {\n Object.keys(state.elements).forEach(function (name) {\n var element = state.elements[name];\n var attributes = state.attributes[name] || {};\n var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them\n\n var style = styleProperties.reduce(function (style, property) {\n style[property] = '';\n return style;\n }, {}); // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n }\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (attribute) {\n element.removeAttribute(attribute);\n });\n });\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'applyStyles',\n enabled: true,\n phase: 'write',\n fn: applyStyles,\n effect: effect,\n requires: ['computeStyles']\n};","import { auto } from \"../enums.js\";\nexport default function getBasePlacement(placement) {\n return placement.split('-')[0];\n}","export var max = Math.max;\nexport var min = Math.min;\nexport var round = Math.round;","export default function getUAString() {\n var uaData = navigator.userAgentData;\n\n if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) {\n return uaData.brands.map(function (item) {\n return item.brand + \"/\" + item.version;\n }).join(' ');\n }\n\n return navigator.userAgent;\n}","import getUAString from \"../utils/userAgent.js\";\nexport default function isLayoutViewport() {\n return !/^((?!chrome|android).)*safari/i.test(getUAString());\n}","import { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport { round } from \"../utils/math.js\";\nimport getWindow from \"./getWindow.js\";\nimport isLayoutViewport from \"./isLayoutViewport.js\";\nexport default function getBoundingClientRect(element, includeScale, isFixedStrategy) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n\n var clientRect = element.getBoundingClientRect();\n var scaleX = 1;\n var scaleY = 1;\n\n if (includeScale && isHTMLElement(element)) {\n scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;\n scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;\n }\n\n var _ref = isElement(element) ? getWindow(element) : window,\n visualViewport = _ref.visualViewport;\n\n var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;\n var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;\n var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;\n var width = clientRect.width / scaleX;\n var height = clientRect.height / scaleY;\n return {\n width: width,\n height: height,\n top: y,\n right: x + width,\n bottom: y + height,\n left: x,\n x: x,\n y: y\n };\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\"; // Returns the layout rect of an element relative to its offsetParent. Layout\n// means it doesn't take into account transforms.\n\nexport default function getLayoutRect(element) {\n var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.\n // Fixes https://github.com/popperjs/popper-core/issues/1223\n\n var width = element.offsetWidth;\n var height = element.offsetHeight;\n\n if (Math.abs(clientRect.width - width) <= 1) {\n width = clientRect.width;\n }\n\n if (Math.abs(clientRect.height - height) <= 1) {\n height = clientRect.height;\n }\n\n return {\n x: element.offsetLeft,\n y: element.offsetTop,\n width: width,\n height: height\n };\n}","import { isShadowRoot } from \"./instanceOf.js\";\nexport default function contains(parent, child) {\n var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method\n\n if (parent.contains(child)) {\n return true;\n } // then fallback to custom implementation with Shadow DOM support\n else if (rootNode && isShadowRoot(rootNode)) {\n var next = child;\n\n do {\n if (next && parent.isSameNode(next)) {\n return true;\n } // $FlowFixMe[prop-missing]: need a better way to handle this...\n\n\n next = next.parentNode || next.host;\n } while (next);\n } // Give up, the result is false\n\n\n return false;\n}","import getWindow from \"./getWindow.js\";\nexport default function getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}","import getNodeName from \"./getNodeName.js\";\nexport default function isTableElement(element) {\n return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;\n}","import { isElement } from \"./instanceOf.js\";\nexport default function getDocumentElement(element) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]\n element.document) || window.document).documentElement;\n}","import getNodeName from \"./getNodeName.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport { isShadowRoot } from \"./instanceOf.js\";\nexport default function getParentNode(element) {\n if (getNodeName(element) === 'html') {\n return element;\n }\n\n return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle\n // $FlowFixMe[incompatible-return]\n // $FlowFixMe[prop-missing]\n element.assignedSlot || // step into the shadow DOM of the parent of a slotted node\n element.parentNode || ( // DOM Element detected\n isShadowRoot(element) ? element.host : null) || // ShadowRoot detected\n // $FlowFixMe[incompatible-call]: HTMLElement is a Node\n getDocumentElement(element) // fallback\n\n );\n}","import getWindow from \"./getWindow.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isHTMLElement, isShadowRoot } from \"./instanceOf.js\";\nimport isTableElement from \"./isTableElement.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getUAString from \"../utils/userAgent.js\";\n\nfunction getTrueOffsetParent(element) {\n if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837\n getComputedStyle(element).position === 'fixed') {\n return null;\n }\n\n return element.offsetParent;\n} // `.offsetParent` reports `null` for fixed elements, while absolute elements\n// return the containing block\n\n\nfunction getContainingBlock(element) {\n var isFirefox = /firefox/i.test(getUAString());\n var isIE = /Trident/i.test(getUAString());\n\n if (isIE && isHTMLElement(element)) {\n // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport\n var elementCss = getComputedStyle(element);\n\n if (elementCss.position === 'fixed') {\n return null;\n }\n }\n\n var currentNode = getParentNode(element);\n\n if (isShadowRoot(currentNode)) {\n currentNode = currentNode.host;\n }\n\n while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {\n var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that\n // create a containing block.\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n\n if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {\n return currentNode;\n } else {\n currentNode = currentNode.parentNode;\n }\n }\n\n return null;\n} // Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\n\n\nexport default function getOffsetParent(element) {\n var window = getWindow(element);\n var offsetParent = getTrueOffsetParent(element);\n\n while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {\n offsetParent = getTrueOffsetParent(offsetParent);\n }\n\n if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {\n return window;\n }\n\n return offsetParent || getContainingBlock(element) || window;\n}","export default function getMainAxisFromPlacement(placement) {\n return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';\n}","import { max as mathMax, min as mathMin } from \"./math.js\";\nexport function within(min, value, max) {\n return mathMax(min, mathMin(value, max));\n}\nexport function withinMaxClamp(min, value, max) {\n var v = within(min, value, max);\n return v > max ? max : v;\n}","import getFreshSideObject from \"./getFreshSideObject.js\";\nexport default function mergePaddingObject(paddingObject) {\n return Object.assign({}, getFreshSideObject(), paddingObject);\n}","export default function getFreshSideObject() {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n };\n}","export default function expandToHashMap(value, keys) {\n return keys.reduce(function (hashMap, key) {\n hashMap[key] = value;\n return hashMap;\n }, {});\n}","import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport contains from \"../dom-utils/contains.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport { within } from \"../utils/within.js\";\nimport mergePaddingObject from \"../utils/mergePaddingObject.js\";\nimport expandToHashMap from \"../utils/expandToHashMap.js\";\nimport { left, right, basePlacements, top, bottom } from \"../enums.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar toPaddingObject = function toPaddingObject(padding, state) {\n padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {\n placement: state.placement\n })) : padding;\n return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n};\n\nfunction arrow(_ref) {\n var _state$modifiersData$;\n\n var state = _ref.state,\n name = _ref.name,\n options = _ref.options;\n var arrowElement = state.elements.arrow;\n var popperOffsets = state.modifiersData.popperOffsets;\n var basePlacement = getBasePlacement(state.placement);\n var axis = getMainAxisFromPlacement(basePlacement);\n var isVertical = [left, right].indexOf(basePlacement) >= 0;\n var len = isVertical ? 'height' : 'width';\n\n if (!arrowElement || !popperOffsets) {\n return;\n }\n\n var paddingObject = toPaddingObject(options.padding, state);\n var arrowRect = getLayoutRect(arrowElement);\n var minProp = axis === 'y' ? top : left;\n var maxProp = axis === 'y' ? bottom : right;\n var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];\n var startDiff = popperOffsets[axis] - state.rects.reference[axis];\n var arrowOffsetParent = getOffsetParent(arrowElement);\n var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;\n var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is\n // outside of the popper bounds\n\n var min = paddingObject[minProp];\n var max = clientSize - arrowRect[len] - paddingObject[maxProp];\n var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;\n var offset = within(min, center, max); // Prevents breaking syntax highlighting...\n\n var axisProp = axis;\n state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);\n}\n\nfunction effect(_ref2) {\n var state = _ref2.state,\n options = _ref2.options;\n var _options$element = options.element,\n arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;\n\n if (arrowElement == null) {\n return;\n } // CSS selector\n\n\n if (typeof arrowElement === 'string') {\n arrowElement = state.elements.popper.querySelector(arrowElement);\n\n if (!arrowElement) {\n return;\n }\n }\n\n if (!contains(state.elements.popper, arrowElement)) {\n return;\n }\n\n state.elements.arrow = arrowElement;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'arrow',\n enabled: true,\n phase: 'main',\n fn: arrow,\n effect: effect,\n requires: ['popperOffsets'],\n requiresIfExists: ['preventOverflow']\n};","export default function getVariation(placement) {\n return placement.split('-')[1];\n}","import { top, left, right, bottom, end } from \"../enums.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getWindow from \"../dom-utils/getWindow.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getComputedStyle from \"../dom-utils/getComputedStyle.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport { round } from \"../utils/math.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar unsetSides = {\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n left: 'auto'\n}; // Round the offsets to the nearest suitable subpixel based on the DPR.\n// Zooming can change the DPR, but it seems to report a value that will\n// cleanly divide the values into the appropriate subpixels.\n\nfunction roundOffsetsByDPR(_ref, win) {\n var x = _ref.x,\n y = _ref.y;\n var dpr = win.devicePixelRatio || 1;\n return {\n x: round(x * dpr) / dpr || 0,\n y: round(y * dpr) / dpr || 0\n };\n}\n\nexport function mapToStyles(_ref2) {\n var _Object$assign2;\n\n var popper = _ref2.popper,\n popperRect = _ref2.popperRect,\n placement = _ref2.placement,\n variation = _ref2.variation,\n offsets = _ref2.offsets,\n position = _ref2.position,\n gpuAcceleration = _ref2.gpuAcceleration,\n adaptive = _ref2.adaptive,\n roundOffsets = _ref2.roundOffsets,\n isFixed = _ref2.isFixed;\n var _offsets$x = offsets.x,\n x = _offsets$x === void 0 ? 0 : _offsets$x,\n _offsets$y = offsets.y,\n y = _offsets$y === void 0 ? 0 : _offsets$y;\n\n var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({\n x: x,\n y: y\n }) : {\n x: x,\n y: y\n };\n\n x = _ref3.x;\n y = _ref3.y;\n var hasX = offsets.hasOwnProperty('x');\n var hasY = offsets.hasOwnProperty('y');\n var sideX = left;\n var sideY = top;\n var win = window;\n\n if (adaptive) {\n var offsetParent = getOffsetParent(popper);\n var heightProp = 'clientHeight';\n var widthProp = 'clientWidth';\n\n if (offsetParent === getWindow(popper)) {\n offsetParent = getDocumentElement(popper);\n\n if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {\n heightProp = 'scrollHeight';\n widthProp = 'scrollWidth';\n }\n } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it\n\n\n offsetParent = offsetParent;\n\n if (placement === top || (placement === left || placement === right) && variation === end) {\n sideY = bottom;\n var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]\n offsetParent[heightProp];\n y -= offsetY - popperRect.height;\n y *= gpuAcceleration ? 1 : -1;\n }\n\n if (placement === left || (placement === top || placement === bottom) && variation === end) {\n sideX = right;\n var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]\n offsetParent[widthProp];\n x -= offsetX - popperRect.width;\n x *= gpuAcceleration ? 1 : -1;\n }\n }\n\n var commonStyles = Object.assign({\n position: position\n }, adaptive && unsetSides);\n\n var _ref4 = roundOffsets === true ? roundOffsetsByDPR({\n x: x,\n y: y\n }, getWindow(popper)) : {\n x: x,\n y: y\n };\n\n x = _ref4.x;\n y = _ref4.y;\n\n if (gpuAcceleration) {\n var _Object$assign;\n\n return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? \"translate(\" + x + \"px, \" + y + \"px)\" : \"translate3d(\" + x + \"px, \" + y + \"px, 0)\", _Object$assign));\n }\n\n return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + \"px\" : '', _Object$assign2[sideX] = hasX ? x + \"px\" : '', _Object$assign2.transform = '', _Object$assign2));\n}\n\nfunction computeStyles(_ref5) {\n var state = _ref5.state,\n options = _ref5.options;\n var _options$gpuAccelerat = options.gpuAcceleration,\n gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,\n _options$adaptive = options.adaptive,\n adaptive = _options$adaptive === void 0 ? true : _options$adaptive,\n _options$roundOffsets = options.roundOffsets,\n roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;\n var commonStyles = {\n placement: getBasePlacement(state.placement),\n variation: getVariation(state.placement),\n popper: state.elements.popper,\n popperRect: state.rects.popper,\n gpuAcceleration: gpuAcceleration,\n isFixed: state.options.strategy === 'fixed'\n };\n\n if (state.modifiersData.popperOffsets != null) {\n state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.popperOffsets,\n position: state.options.strategy,\n adaptive: adaptive,\n roundOffsets: roundOffsets\n })));\n }\n\n if (state.modifiersData.arrow != null) {\n state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.arrow,\n position: 'absolute',\n adaptive: false,\n roundOffsets: roundOffsets\n })));\n }\n\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-placement': state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'computeStyles',\n enabled: true,\n phase: 'beforeWrite',\n fn: computeStyles,\n data: {}\n};","import getWindow from \"../dom-utils/getWindow.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar passive = {\n passive: true\n};\n\nfunction effect(_ref) {\n var state = _ref.state,\n instance = _ref.instance,\n options = _ref.options;\n var _options$scroll = options.scroll,\n scroll = _options$scroll === void 0 ? true : _options$scroll,\n _options$resize = options.resize,\n resize = _options$resize === void 0 ? true : _options$resize;\n var window = getWindow(state.elements.popper);\n var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);\n\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.addEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.addEventListener('resize', instance.update, passive);\n }\n\n return function () {\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.removeEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.removeEventListener('resize', instance.update, passive);\n }\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'eventListeners',\n enabled: true,\n phase: 'write',\n fn: function fn() {},\n effect: effect,\n data: {}\n};","var hash = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nexport default function getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, function (matched) {\n return hash[matched];\n });\n}","var hash = {\n start: 'end',\n end: 'start'\n};\nexport default function getOppositeVariationPlacement(placement) {\n return placement.replace(/start|end/g, function (matched) {\n return hash[matched];\n });\n}","import getWindow from \"./getWindow.js\";\nexport default function getWindowScroll(node) {\n var win = getWindow(node);\n var scrollLeft = win.pageXOffset;\n var scrollTop = win.pageYOffset;\n return {\n scrollLeft: scrollLeft,\n scrollTop: scrollTop\n };\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nexport default function getWindowScrollBarX(element) {\n // If has a CSS width greater than the viewport, then this will be\n // incorrect for RTL.\n // Popper 1 is broken in this case and never had a bug report so let's assume\n // it's not an issue. I don't think anyone ever specifies width on \n // anyway.\n // Browsers where the left scrollbar doesn't cause an issue report `0` for\n // this (e.g. Edge 2019, IE11, Safari)\n return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;\n}","import getComputedStyle from \"./getComputedStyle.js\";\nexport default function isScrollParent(element) {\n // Firefox wants us to check `-x` and `-y` variations as well\n var _getComputedStyle = getComputedStyle(element),\n overflow = _getComputedStyle.overflow,\n overflowX = _getComputedStyle.overflowX,\n overflowY = _getComputedStyle.overflowY;\n\n return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);\n}","import getParentNode from \"./getParentNode.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nexport default function getScrollParent(node) {\n if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return node.ownerDocument.body;\n }\n\n if (isHTMLElement(node) && isScrollParent(node)) {\n return node;\n }\n\n return getScrollParent(getParentNode(node));\n}","import getScrollParent from \"./getScrollParent.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getWindow from \"./getWindow.js\";\nimport isScrollParent from \"./isScrollParent.js\";\n/*\ngiven a DOM element, return the list of all scroll parents, up the list of ancesors\nuntil we get to the top window object. This list is what we attach scroll listeners\nto, because if any of these parent elements scroll, we'll need to re-calculate the\nreference element's position.\n*/\n\nexport default function listScrollParents(element, list) {\n var _element$ownerDocumen;\n\n if (list === void 0) {\n list = [];\n }\n\n var scrollParent = getScrollParent(element);\n var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);\n var win = getWindow(scrollParent);\n var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;\n var updatedList = list.concat(target);\n return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here\n updatedList.concat(listScrollParents(getParentNode(target)));\n}","export default function rectToClientRect(rect) {\n return Object.assign({}, rect, {\n left: rect.x,\n top: rect.y,\n right: rect.x + rect.width,\n bottom: rect.y + rect.height\n });\n}","import { viewport } from \"../enums.js\";\nimport getViewportRect from \"./getViewportRect.js\";\nimport getDocumentRect from \"./getDocumentRect.js\";\nimport listScrollParents from \"./listScrollParents.js\";\nimport getOffsetParent from \"./getOffsetParent.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport contains from \"./contains.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport rectToClientRect from \"../utils/rectToClientRect.js\";\nimport { max, min } from \"../utils/math.js\";\n\nfunction getInnerBoundingClientRect(element, strategy) {\n var rect = getBoundingClientRect(element, false, strategy === 'fixed');\n rect.top = rect.top + element.clientTop;\n rect.left = rect.left + element.clientLeft;\n rect.bottom = rect.top + element.clientHeight;\n rect.right = rect.left + element.clientWidth;\n rect.width = element.clientWidth;\n rect.height = element.clientHeight;\n rect.x = rect.left;\n rect.y = rect.top;\n return rect;\n}\n\nfunction getClientRectFromMixedType(element, clippingParent, strategy) {\n return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));\n} // A \"clipping parent\" is an overflowable container with the characteristic of\n// clipping (or hiding) overflowing elements with a position different from\n// `initial`\n\n\nfunction getClippingParents(element) {\n var clippingParents = listScrollParents(getParentNode(element));\n var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;\n var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;\n\n if (!isElement(clipperElement)) {\n return [];\n } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414\n\n\n return clippingParents.filter(function (clippingParent) {\n return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';\n });\n} // Gets the maximum area that the element is visible in due to any number of\n// clipping parents\n\n\nexport default function getClippingRect(element, boundary, rootBoundary, strategy) {\n var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);\n var clippingParents = [].concat(mainClippingParents, [rootBoundary]);\n var firstClippingParent = clippingParents[0];\n var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {\n var rect = getClientRectFromMixedType(element, clippingParent, strategy);\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromMixedType(element, firstClippingParent, strategy));\n clippingRect.width = clippingRect.right - clippingRect.left;\n clippingRect.height = clippingRect.bottom - clippingRect.top;\n clippingRect.x = clippingRect.left;\n clippingRect.y = clippingRect.top;\n return clippingRect;\n}","import getWindow from \"./getWindow.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport isLayoutViewport from \"./isLayoutViewport.js\";\nexport default function getViewportRect(element, strategy) {\n var win = getWindow(element);\n var html = getDocumentElement(element);\n var visualViewport = win.visualViewport;\n var width = html.clientWidth;\n var height = html.clientHeight;\n var x = 0;\n var y = 0;\n\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n var layoutViewport = isLayoutViewport();\n\n if (layoutViewport || !layoutViewport && strategy === 'fixed') {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n\n return {\n width: width,\n height: height,\n x: x + getWindowScrollBarX(element),\n y: y\n };\n}","import getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nimport { max } from \"../utils/math.js\"; // Gets the entire size of the scrollable document area, even extending outside\n// of the `` and `` rect bounds if horizontally scrollable\n\nexport default function getDocumentRect(element) {\n var _element$ownerDocumen;\n\n var html = getDocumentElement(element);\n var winScroll = getWindowScroll(element);\n var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n var x = -winScroll.scrollLeft + getWindowScrollBarX(element);\n var y = -winScroll.scrollTop;\n\n if (getComputedStyle(body || html).direction === 'rtl') {\n x += max(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return {\n width: width,\n height: height,\n x: x,\n y: y\n };\n}","import getBasePlacement from \"./getBasePlacement.js\";\nimport getVariation from \"./getVariation.js\";\nimport getMainAxisFromPlacement from \"./getMainAxisFromPlacement.js\";\nimport { top, right, bottom, left, start, end } from \"../enums.js\";\nexport default function computeOffsets(_ref) {\n var reference = _ref.reference,\n element = _ref.element,\n placement = _ref.placement;\n var basePlacement = placement ? getBasePlacement(placement) : null;\n var variation = placement ? getVariation(placement) : null;\n var commonX = reference.x + reference.width / 2 - element.width / 2;\n var commonY = reference.y + reference.height / 2 - element.height / 2;\n var offsets;\n\n switch (basePlacement) {\n case top:\n offsets = {\n x: commonX,\n y: reference.y - element.height\n };\n break;\n\n case bottom:\n offsets = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n\n case right:\n offsets = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n\n case left:\n offsets = {\n x: reference.x - element.width,\n y: commonY\n };\n break;\n\n default:\n offsets = {\n x: reference.x,\n y: reference.y\n };\n }\n\n var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;\n\n if (mainAxis != null) {\n var len = mainAxis === 'y' ? 'height' : 'width';\n\n switch (variation) {\n case start:\n offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);\n break;\n\n case end:\n offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);\n break;\n\n default:\n }\n }\n\n return offsets;\n}","import getClippingRect from \"../dom-utils/getClippingRect.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getBoundingClientRect from \"../dom-utils/getBoundingClientRect.js\";\nimport computeOffsets from \"./computeOffsets.js\";\nimport rectToClientRect from \"./rectToClientRect.js\";\nimport { clippingParents, reference, popper, bottom, top, right, basePlacements, viewport } from \"../enums.js\";\nimport { isElement } from \"../dom-utils/instanceOf.js\";\nimport mergePaddingObject from \"./mergePaddingObject.js\";\nimport expandToHashMap from \"./expandToHashMap.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport default function detectOverflow(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n _options$placement = _options.placement,\n placement = _options$placement === void 0 ? state.placement : _options$placement,\n _options$strategy = _options.strategy,\n strategy = _options$strategy === void 0 ? state.strategy : _options$strategy,\n _options$boundary = _options.boundary,\n boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,\n _options$rootBoundary = _options.rootBoundary,\n rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,\n _options$elementConte = _options.elementContext,\n elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,\n _options$altBoundary = _options.altBoundary,\n altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,\n _options$padding = _options.padding,\n padding = _options$padding === void 0 ? 0 : _options$padding;\n var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n var altContext = elementContext === popper ? reference : popper;\n var popperRect = state.rects.popper;\n var element = state.elements[altBoundary ? altContext : elementContext];\n var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);\n var referenceClientRect = getBoundingClientRect(state.elements.reference);\n var popperOffsets = computeOffsets({\n reference: referenceClientRect,\n element: popperRect,\n strategy: 'absolute',\n placement: placement\n });\n var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));\n var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect\n // 0 or negative = within the clipping rect\n\n var overflowOffsets = {\n top: clippingClientRect.top - elementClientRect.top + paddingObject.top,\n bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,\n left: clippingClientRect.left - elementClientRect.left + paddingObject.left,\n right: elementClientRect.right - clippingClientRect.right + paddingObject.right\n };\n var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element\n\n if (elementContext === popper && offsetData) {\n var offset = offsetData[placement];\n Object.keys(overflowOffsets).forEach(function (key) {\n var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;\n var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';\n overflowOffsets[key] += offset[axis] * multiply;\n });\n }\n\n return overflowOffsets;\n}","import getOppositePlacement from \"../utils/getOppositePlacement.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getOppositeVariationPlacement from \"../utils/getOppositeVariationPlacement.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport computeAutoPlacement from \"../utils/computeAutoPlacement.js\";\nimport { bottom, top, start, right, left, auto } from \"../enums.js\";\nimport getVariation from \"../utils/getVariation.js\"; // eslint-disable-next-line import/no-unused-modules\n\nfunction getExpandedFallbackPlacements(placement) {\n if (getBasePlacement(placement) === auto) {\n return [];\n }\n\n var oppositePlacement = getOppositePlacement(placement);\n return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];\n}\n\nfunction flip(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n\n if (state.modifiersData[name]._skip) {\n return;\n }\n\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,\n specifiedFallbackPlacements = options.fallbackPlacements,\n padding = options.padding,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n _options$flipVariatio = options.flipVariations,\n flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,\n allowedAutoPlacements = options.allowedAutoPlacements;\n var preferredPlacement = state.options.placement;\n var basePlacement = getBasePlacement(preferredPlacement);\n var isBasePlacement = basePlacement === preferredPlacement;\n var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));\n var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {\n return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n flipVariations: flipVariations,\n allowedAutoPlacements: allowedAutoPlacements\n }) : placement);\n }, []);\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var checksMap = new Map();\n var makeFallbackChecks = true;\n var firstFittingPlacement = placements[0];\n\n for (var i = 0; i < placements.length; i++) {\n var placement = placements[i];\n\n var _basePlacement = getBasePlacement(placement);\n\n var isStartVariation = getVariation(placement) === start;\n var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;\n var len = isVertical ? 'width' : 'height';\n var overflow = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n altBoundary: altBoundary,\n padding: padding\n });\n var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;\n\n if (referenceRect[len] > popperRect[len]) {\n mainVariationSide = getOppositePlacement(mainVariationSide);\n }\n\n var altVariationSide = getOppositePlacement(mainVariationSide);\n var checks = [];\n\n if (checkMainAxis) {\n checks.push(overflow[_basePlacement] <= 0);\n }\n\n if (checkAltAxis) {\n checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);\n }\n\n if (checks.every(function (check) {\n return check;\n })) {\n firstFittingPlacement = placement;\n makeFallbackChecks = false;\n break;\n }\n\n checksMap.set(placement, checks);\n }\n\n if (makeFallbackChecks) {\n // `2` may be desired in some cases – research later\n var numberOfChecks = flipVariations ? 3 : 1;\n\n var _loop = function _loop(_i) {\n var fittingPlacement = placements.find(function (placement) {\n var checks = checksMap.get(placement);\n\n if (checks) {\n return checks.slice(0, _i).every(function (check) {\n return check;\n });\n }\n });\n\n if (fittingPlacement) {\n firstFittingPlacement = fittingPlacement;\n return \"break\";\n }\n };\n\n for (var _i = numberOfChecks; _i > 0; _i--) {\n var _ret = _loop(_i);\n\n if (_ret === \"break\") break;\n }\n }\n\n if (state.placement !== firstFittingPlacement) {\n state.modifiersData[name]._skip = true;\n state.placement = firstFittingPlacement;\n state.reset = true;\n }\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'flip',\n enabled: true,\n phase: 'main',\n fn: flip,\n requiresIfExists: ['offset'],\n data: {\n _skip: false\n }\n};","import getVariation from \"./getVariation.js\";\nimport { variationPlacements, basePlacements, placements as allPlacements } from \"../enums.js\";\nimport detectOverflow from \"./detectOverflow.js\";\nimport getBasePlacement from \"./getBasePlacement.js\";\nexport default function computeAutoPlacement(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n placement = _options.placement,\n boundary = _options.boundary,\n rootBoundary = _options.rootBoundary,\n padding = _options.padding,\n flipVariations = _options.flipVariations,\n _options$allowedAutoP = _options.allowedAutoPlacements,\n allowedAutoPlacements = _options$allowedAutoP === void 0 ? allPlacements : _options$allowedAutoP;\n var variation = getVariation(placement);\n var placements = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {\n return getVariation(placement) === variation;\n }) : basePlacements;\n var allowedPlacements = placements.filter(function (placement) {\n return allowedAutoPlacements.indexOf(placement) >= 0;\n });\n\n if (allowedPlacements.length === 0) {\n allowedPlacements = placements;\n } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...\n\n\n var overflows = allowedPlacements.reduce(function (acc, placement) {\n acc[placement] = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding\n })[getBasePlacement(placement)];\n return acc;\n }, {});\n return Object.keys(overflows).sort(function (a, b) {\n return overflows[a] - overflows[b];\n });\n}","import { top, bottom, left, right } from \"../enums.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\n\nfunction getSideOffsets(overflow, rect, preventedOffsets) {\n if (preventedOffsets === void 0) {\n preventedOffsets = {\n x: 0,\n y: 0\n };\n }\n\n return {\n top: overflow.top - rect.height - preventedOffsets.y,\n right: overflow.right - rect.width + preventedOffsets.x,\n bottom: overflow.bottom - rect.height + preventedOffsets.y,\n left: overflow.left - rect.width - preventedOffsets.x\n };\n}\n\nfunction isAnySideFullyClipped(overflow) {\n return [top, right, bottom, left].some(function (side) {\n return overflow[side] >= 0;\n });\n}\n\nfunction hide(_ref) {\n var state = _ref.state,\n name = _ref.name;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var preventedOffsets = state.modifiersData.preventOverflow;\n var referenceOverflow = detectOverflow(state, {\n elementContext: 'reference'\n });\n var popperAltOverflow = detectOverflow(state, {\n altBoundary: true\n });\n var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);\n var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);\n var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);\n var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);\n state.modifiersData[name] = {\n referenceClippingOffsets: referenceClippingOffsets,\n popperEscapeOffsets: popperEscapeOffsets,\n isReferenceHidden: isReferenceHidden,\n hasPopperEscaped: hasPopperEscaped\n };\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-reference-hidden': isReferenceHidden,\n 'data-popper-escaped': hasPopperEscaped\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'hide',\n enabled: true,\n phase: 'main',\n requiresIfExists: ['preventOverflow'],\n fn: hide\n};","import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport { top, left, right, placements } from \"../enums.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport function distanceAndSkiddingToXY(placement, rects, offset) {\n var basePlacement = getBasePlacement(placement);\n var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;\n\n var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {\n placement: placement\n })) : offset,\n skidding = _ref[0],\n distance = _ref[1];\n\n skidding = skidding || 0;\n distance = (distance || 0) * invertDistance;\n return [left, right].indexOf(basePlacement) >= 0 ? {\n x: distance,\n y: skidding\n } : {\n x: skidding,\n y: distance\n };\n}\n\nfunction offset(_ref2) {\n var state = _ref2.state,\n options = _ref2.options,\n name = _ref2.name;\n var _options$offset = options.offset,\n offset = _options$offset === void 0 ? [0, 0] : _options$offset;\n var data = placements.reduce(function (acc, placement) {\n acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);\n return acc;\n }, {});\n var _data$state$placement = data[state.placement],\n x = _data$state$placement.x,\n y = _data$state$placement.y;\n\n if (state.modifiersData.popperOffsets != null) {\n state.modifiersData.popperOffsets.x += x;\n state.modifiersData.popperOffsets.y += y;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'offset',\n enabled: true,\n phase: 'main',\n requires: ['popperOffsets'],\n fn: offset\n};","import computeOffsets from \"../utils/computeOffsets.js\";\n\nfunction popperOffsets(_ref) {\n var state = _ref.state,\n name = _ref.name;\n // Offsets are the actual position the popper needs to have to be\n // properly positioned near its reference element\n // This is the most basic placement, and will be adjusted by\n // the modifiers in the next step\n state.modifiersData[name] = computeOffsets({\n reference: state.rects.reference,\n element: state.rects.popper,\n strategy: 'absolute',\n placement: state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'popperOffsets',\n enabled: true,\n phase: 'read',\n fn: popperOffsets,\n data: {}\n};","import { top, left, right, bottom, start } from \"../enums.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport getAltAxis from \"../utils/getAltAxis.js\";\nimport { within, withinMaxClamp } from \"../utils/within.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport getFreshSideObject from \"../utils/getFreshSideObject.js\";\nimport { min as mathMin, max as mathMax } from \"../utils/math.js\";\n\nfunction preventOverflow(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n padding = options.padding,\n _options$tether = options.tether,\n tether = _options$tether === void 0 ? true : _options$tether,\n _options$tetherOffset = options.tetherOffset,\n tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;\n var overflow = detectOverflow(state, {\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n altBoundary: altBoundary\n });\n var basePlacement = getBasePlacement(state.placement);\n var variation = getVariation(state.placement);\n var isBasePlacement = !variation;\n var mainAxis = getMainAxisFromPlacement(basePlacement);\n var altAxis = getAltAxis(mainAxis);\n var popperOffsets = state.modifiersData.popperOffsets;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {\n placement: state.placement\n })) : tetherOffset;\n var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {\n mainAxis: tetherOffsetValue,\n altAxis: tetherOffsetValue\n } : Object.assign({\n mainAxis: 0,\n altAxis: 0\n }, tetherOffsetValue);\n var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;\n var data = {\n x: 0,\n y: 0\n };\n\n if (!popperOffsets) {\n return;\n }\n\n if (checkMainAxis) {\n var _offsetModifierState$;\n\n var mainSide = mainAxis === 'y' ? top : left;\n var altSide = mainAxis === 'y' ? bottom : right;\n var len = mainAxis === 'y' ? 'height' : 'width';\n var offset = popperOffsets[mainAxis];\n var min = offset + overflow[mainSide];\n var max = offset - overflow[altSide];\n var additive = tether ? -popperRect[len] / 2 : 0;\n var minLen = variation === start ? referenceRect[len] : popperRect[len];\n var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go\n // outside the reference bounds\n\n var arrowElement = state.elements.arrow;\n var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {\n width: 0,\n height: 0\n };\n var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();\n var arrowPaddingMin = arrowPaddingObject[mainSide];\n var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want\n // to include its full size in the calculation. If the reference is small\n // and near the edge of a boundary, the popper can overflow even if the\n // reference is not overflowing as well (e.g. virtual elements with no\n // width or height)\n\n var arrowLen = within(0, referenceRect[len], arrowRect[len]);\n var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;\n var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;\n var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);\n var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;\n var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;\n var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;\n var tetherMax = offset + maxOffset - offsetModifierValue;\n var preventedOffset = within(tether ? mathMin(min, tetherMin) : min, offset, tether ? mathMax(max, tetherMax) : max);\n popperOffsets[mainAxis] = preventedOffset;\n data[mainAxis] = preventedOffset - offset;\n }\n\n if (checkAltAxis) {\n var _offsetModifierState$2;\n\n var _mainSide = mainAxis === 'x' ? top : left;\n\n var _altSide = mainAxis === 'x' ? bottom : right;\n\n var _offset = popperOffsets[altAxis];\n\n var _len = altAxis === 'y' ? 'height' : 'width';\n\n var _min = _offset + overflow[_mainSide];\n\n var _max = _offset - overflow[_altSide];\n\n var isOriginSide = [top, left].indexOf(basePlacement) !== -1;\n\n var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;\n\n var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;\n\n var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;\n\n var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);\n\n popperOffsets[altAxis] = _preventedOffset;\n data[altAxis] = _preventedOffset - _offset;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'preventOverflow',\n enabled: true,\n phase: 'main',\n fn: preventOverflow,\n requiresIfExists: ['offset']\n};","export default function getAltAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getNodeScroll from \"./getNodeScroll.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport { round } from \"../utils/math.js\";\n\nfunction isElementScaled(element) {\n var rect = element.getBoundingClientRect();\n var scaleX = round(rect.width) / element.offsetWidth || 1;\n var scaleY = round(rect.height) / element.offsetHeight || 1;\n return scaleX !== 1 || scaleY !== 1;\n} // Returns the composite rect of an element relative to its offsetParent.\n// Composite means it takes into account transforms as well as layout.\n\n\nexport default function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n\n var isOffsetParentAnElement = isHTMLElement(offsetParent);\n var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);\n var documentElement = getDocumentElement(offsetParent);\n var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);\n var scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n var offsets = {\n x: 0,\n y: 0\n };\n\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078\n isScrollParent(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n\n if (isHTMLElement(offsetParent)) {\n offsets = getBoundingClientRect(offsetParent, true);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height\n };\n}","import getWindowScroll from \"./getWindowScroll.js\";\nimport getWindow from \"./getWindow.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getHTMLElementScroll from \"./getHTMLElementScroll.js\";\nexport default function getNodeScroll(node) {\n if (node === getWindow(node) || !isHTMLElement(node)) {\n return getWindowScroll(node);\n } else {\n return getHTMLElementScroll(node);\n }\n}","export default function getHTMLElementScroll(element) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n}","import { modifierPhases } from \"../enums.js\"; // source: https://stackoverflow.com/questions/49875255\n\nfunction order(modifiers) {\n var map = new Map();\n var visited = new Set();\n var result = [];\n modifiers.forEach(function (modifier) {\n map.set(modifier.name, modifier);\n }); // On visiting object, check for its dependencies and visit them recursively\n\n function sort(modifier) {\n visited.add(modifier.name);\n var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);\n requires.forEach(function (dep) {\n if (!visited.has(dep)) {\n var depModifier = map.get(dep);\n\n if (depModifier) {\n sort(depModifier);\n }\n }\n });\n result.push(modifier);\n }\n\n modifiers.forEach(function (modifier) {\n if (!visited.has(modifier.name)) {\n // check for visited object\n sort(modifier);\n }\n });\n return result;\n}\n\nexport default function orderModifiers(modifiers) {\n // order based on dependencies\n var orderedModifiers = order(modifiers); // order based on phase\n\n return modifierPhases.reduce(function (acc, phase) {\n return acc.concat(orderedModifiers.filter(function (modifier) {\n return modifier.phase === phase;\n }));\n }, []);\n}","import getCompositeRect from \"./dom-utils/getCompositeRect.js\";\nimport getLayoutRect from \"./dom-utils/getLayoutRect.js\";\nimport listScrollParents from \"./dom-utils/listScrollParents.js\";\nimport getOffsetParent from \"./dom-utils/getOffsetParent.js\";\nimport orderModifiers from \"./utils/orderModifiers.js\";\nimport debounce from \"./utils/debounce.js\";\nimport mergeByName from \"./utils/mergeByName.js\";\nimport detectOverflow from \"./utils/detectOverflow.js\";\nimport { isElement } from \"./dom-utils/instanceOf.js\";\nvar DEFAULT_OPTIONS = {\n placement: 'bottom',\n modifiers: [],\n strategy: 'absolute'\n};\n\nfunction areValidElements() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return !args.some(function (element) {\n return !(element && typeof element.getBoundingClientRect === 'function');\n });\n}\n\nexport function popperGenerator(generatorOptions) {\n if (generatorOptions === void 0) {\n generatorOptions = {};\n }\n\n var _generatorOptions = generatorOptions,\n _generatorOptions$def = _generatorOptions.defaultModifiers,\n defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,\n _generatorOptions$def2 = _generatorOptions.defaultOptions,\n defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;\n return function createPopper(reference, popper, options) {\n if (options === void 0) {\n options = defaultOptions;\n }\n\n var state = {\n placement: 'bottom',\n orderedModifiers: [],\n options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),\n modifiersData: {},\n elements: {\n reference: reference,\n popper: popper\n },\n attributes: {},\n styles: {}\n };\n var effectCleanupFns = [];\n var isDestroyed = false;\n var instance = {\n state: state,\n setOptions: function setOptions(setOptionsAction) {\n var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;\n cleanupModifierEffects();\n state.options = Object.assign({}, defaultOptions, state.options, options);\n state.scrollParents = {\n reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],\n popper: listScrollParents(popper)\n }; // Orders the modifiers based on their dependencies and `phase`\n // properties\n\n var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers\n\n state.orderedModifiers = orderedModifiers.filter(function (m) {\n return m.enabled;\n });\n runModifierEffects();\n return instance.update();\n },\n // Sync update – it will always be executed, even if not necessary. This\n // is useful for low frequency updates where sync behavior simplifies the\n // logic.\n // For high frequency updates (e.g. `resize` and `scroll` events), always\n // prefer the async Popper#update method\n forceUpdate: function forceUpdate() {\n if (isDestroyed) {\n return;\n }\n\n var _state$elements = state.elements,\n reference = _state$elements.reference,\n popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements\n // anymore\n\n if (!areValidElements(reference, popper)) {\n return;\n } // Store the reference and popper rects to be read by modifiers\n\n\n state.rects = {\n reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),\n popper: getLayoutRect(popper)\n }; // Modifiers have the ability to reset the current update cycle. The\n // most common use case for this is the `flip` modifier changing the\n // placement, which then needs to re-run all the modifiers, because the\n // logic was previously ran for the previous placement and is therefore\n // stale/incorrect\n\n state.reset = false;\n state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier\n // is filled with the initial data specified by the modifier. This means\n // it doesn't persist and is fresh on each update.\n // To ensure persistent data, use `${name}#persistent`\n\n state.orderedModifiers.forEach(function (modifier) {\n return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);\n });\n\n for (var index = 0; index < state.orderedModifiers.length; index++) {\n if (state.reset === true) {\n state.reset = false;\n index = -1;\n continue;\n }\n\n var _state$orderedModifie = state.orderedModifiers[index],\n fn = _state$orderedModifie.fn,\n _state$orderedModifie2 = _state$orderedModifie.options,\n _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,\n name = _state$orderedModifie.name;\n\n if (typeof fn === 'function') {\n state = fn({\n state: state,\n options: _options,\n name: name,\n instance: instance\n }) || state;\n }\n }\n },\n // Async and optimistically optimized update – it will not be executed if\n // not necessary (debounced to run at most once-per-tick)\n update: debounce(function () {\n return new Promise(function (resolve) {\n instance.forceUpdate();\n resolve(state);\n });\n }),\n destroy: function destroy() {\n cleanupModifierEffects();\n isDestroyed = true;\n }\n };\n\n if (!areValidElements(reference, popper)) {\n return instance;\n }\n\n instance.setOptions(options).then(function (state) {\n if (!isDestroyed && options.onFirstUpdate) {\n options.onFirstUpdate(state);\n }\n }); // Modifiers have the ability to execute arbitrary code before the first\n // update cycle runs. They will be executed in the same order as the update\n // cycle. This is useful when a modifier adds some persistent data that\n // other modifiers need to use, but the modifier is run after the dependent\n // one.\n\n function runModifierEffects() {\n state.orderedModifiers.forEach(function (_ref) {\n var name = _ref.name,\n _ref$options = _ref.options,\n options = _ref$options === void 0 ? {} : _ref$options,\n effect = _ref.effect;\n\n if (typeof effect === 'function') {\n var cleanupFn = effect({\n state: state,\n name: name,\n instance: instance,\n options: options\n });\n\n var noopFn = function noopFn() {};\n\n effectCleanupFns.push(cleanupFn || noopFn);\n }\n });\n }\n\n function cleanupModifierEffects() {\n effectCleanupFns.forEach(function (fn) {\n return fn();\n });\n effectCleanupFns = [];\n }\n\n return instance;\n };\n}\nexport var createPopper = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules\n\nexport { detectOverflow };","export default function debounce(fn) {\n var pending;\n return function () {\n if (!pending) {\n pending = new Promise(function (resolve) {\n Promise.resolve().then(function () {\n pending = undefined;\n resolve(fn());\n });\n });\n }\n\n return pending;\n };\n}","export default function mergeByName(modifiers) {\n var merged = modifiers.reduce(function (merged, current) {\n var existing = merged[current.name];\n merged[current.name] = existing ? Object.assign({}, existing, current, {\n options: Object.assign({}, existing.options, current.options),\n data: Object.assign({}, existing.data, current.data)\n }) : current;\n return merged;\n }, {}); // IE11 does not support Object.values\n\n return Object.keys(merged).map(function (key) {\n return merged[key];\n });\n}","import { popperGenerator, detectOverflow } from \"./createPopper.js\";\nimport eventListeners from \"./modifiers/eventListeners.js\";\nimport popperOffsets from \"./modifiers/popperOffsets.js\";\nimport computeStyles from \"./modifiers/computeStyles.js\";\nimport applyStyles from \"./modifiers/applyStyles.js\";\nimport offset from \"./modifiers/offset.js\";\nimport flip from \"./modifiers/flip.js\";\nimport preventOverflow from \"./modifiers/preventOverflow.js\";\nimport arrow from \"./modifiers/arrow.js\";\nimport hide from \"./modifiers/hide.js\";\nvar defaultModifiers = [eventListeners, popperOffsets, computeStyles, applyStyles, offset, flip, preventOverflow, arrow, hide];\nvar createPopper = /*#__PURE__*/popperGenerator({\n defaultModifiers: defaultModifiers\n}); // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow }; // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper as createPopperLite } from \"./popper-lite.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport * from \"./modifiers/index.js\";","import { popperGenerator, detectOverflow } from \"./createPopper.js\";\nimport eventListeners from \"./modifiers/eventListeners.js\";\nimport popperOffsets from \"./modifiers/popperOffsets.js\";\nimport computeStyles from \"./modifiers/computeStyles.js\";\nimport applyStyles from \"./modifiers/applyStyles.js\";\nvar defaultModifiers = [eventListeners, popperOffsets, computeStyles, applyStyles];\nvar createPopper = /*#__PURE__*/popperGenerator({\n defaultModifiers: defaultModifiers\n}); // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow };","/*!\n * Bootstrap v5.3.3 (https://getbootstrap.com/)\n * Copyright 2011-2024 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n */\nimport * as Popper from '@popperjs/core';\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap dom/data.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n/**\n * Constants\n */\n\nconst elementMap = new Map();\nconst Data = {\n set(element, key, instance) {\n if (!elementMap.has(element)) {\n elementMap.set(element, new Map());\n }\n const instanceMap = elementMap.get(element);\n\n // make it clear we only want one instance per element\n // can be removed later when multiple key/instances are fine to be used\n if (!instanceMap.has(key) && instanceMap.size !== 0) {\n // eslint-disable-next-line no-console\n console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`);\n return;\n }\n instanceMap.set(key, instance);\n },\n get(element, key) {\n if (elementMap.has(element)) {\n return elementMap.get(element).get(key) || null;\n }\n return null;\n },\n remove(element, key) {\n if (!elementMap.has(element)) {\n return;\n }\n const instanceMap = elementMap.get(element);\n instanceMap.delete(key);\n\n // free up element references if there are no instances left for an element\n if (instanceMap.size === 0) {\n elementMap.delete(element);\n }\n }\n};\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap util/index.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst MAX_UID = 1000000;\nconst MILLISECONDS_MULTIPLIER = 1000;\nconst TRANSITION_END = 'transitionend';\n\n/**\n * Properly escape IDs selectors to handle weird IDs\n * @param {string} selector\n * @returns {string}\n */\nconst parseSelector = selector => {\n if (selector && window.CSS && window.CSS.escape) {\n // document.querySelector needs escaping to handle IDs (html5+) containing for instance /\n selector = selector.replace(/#([^\\s\"#']+)/g, (match, id) => `#${CSS.escape(id)}`);\n }\n return selector;\n};\n\n// Shout-out Angus Croll (https://goo.gl/pxwQGp)\nconst toType = object => {\n if (object === null || object === undefined) {\n return `${object}`;\n }\n return Object.prototype.toString.call(object).match(/\\s([a-z]+)/i)[1].toLowerCase();\n};\n\n/**\n * Public Util API\n */\n\nconst getUID = prefix => {\n do {\n prefix += Math.floor(Math.random() * MAX_UID);\n } while (document.getElementById(prefix));\n return prefix;\n};\nconst getTransitionDurationFromElement = element => {\n if (!element) {\n return 0;\n }\n\n // Get transition-duration of the element\n let {\n transitionDuration,\n transitionDelay\n } = window.getComputedStyle(element);\n const floatTransitionDuration = Number.parseFloat(transitionDuration);\n const floatTransitionDelay = Number.parseFloat(transitionDelay);\n\n // Return 0 if element or transition duration is not found\n if (!floatTransitionDuration && !floatTransitionDelay) {\n return 0;\n }\n\n // If multiple durations are defined, take the first\n transitionDuration = transitionDuration.split(',')[0];\n transitionDelay = transitionDelay.split(',')[0];\n return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;\n};\nconst triggerTransitionEnd = element => {\n element.dispatchEvent(new Event(TRANSITION_END));\n};\nconst isElement = object => {\n if (!object || typeof object !== 'object') {\n return false;\n }\n if (typeof object.jquery !== 'undefined') {\n object = object[0];\n }\n return typeof object.nodeType !== 'undefined';\n};\nconst getElement = object => {\n // it's a jQuery object or a node element\n if (isElement(object)) {\n return object.jquery ? object[0] : object;\n }\n if (typeof object === 'string' && object.length > 0) {\n return document.querySelector(parseSelector(object));\n }\n return null;\n};\nconst isVisible = element => {\n if (!isElement(element) || element.getClientRects().length === 0) {\n return false;\n }\n const elementIsVisible = getComputedStyle(element).getPropertyValue('visibility') === 'visible';\n // Handle `details` element as its content may falsie appear visible when it is closed\n const closedDetails = element.closest('details:not([open])');\n if (!closedDetails) {\n return elementIsVisible;\n }\n if (closedDetails !== element) {\n const summary = element.closest('summary');\n if (summary && summary.parentNode !== closedDetails) {\n return false;\n }\n if (summary === null) {\n return false;\n }\n }\n return elementIsVisible;\n};\nconst isDisabled = element => {\n if (!element || element.nodeType !== Node.ELEMENT_NODE) {\n return true;\n }\n if (element.classList.contains('disabled')) {\n return true;\n }\n if (typeof element.disabled !== 'undefined') {\n return element.disabled;\n }\n return element.hasAttribute('disabled') && element.getAttribute('disabled') !== 'false';\n};\nconst findShadowRoot = element => {\n if (!document.documentElement.attachShadow) {\n return null;\n }\n\n // Can find the shadow root otherwise it'll return the document\n if (typeof element.getRootNode === 'function') {\n const root = element.getRootNode();\n return root instanceof ShadowRoot ? root : null;\n }\n if (element instanceof ShadowRoot) {\n return element;\n }\n\n // when we don't find a shadow root\n if (!element.parentNode) {\n return null;\n }\n return findShadowRoot(element.parentNode);\n};\nconst noop = () => {};\n\n/**\n * Trick to restart an element's animation\n *\n * @param {HTMLElement} element\n * @return void\n *\n * @see https://www.charistheo.io/blog/2021/02/restart-a-css-animation-with-javascript/#restarting-a-css-animation\n */\nconst reflow = element => {\n element.offsetHeight; // eslint-disable-line no-unused-expressions\n};\nconst getjQuery = () => {\n if (window.jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {\n return window.jQuery;\n }\n return null;\n};\nconst DOMContentLoadedCallbacks = [];\nconst onDOMContentLoaded = callback => {\n if (document.readyState === 'loading') {\n // add listener on the first call when the document is in loading state\n if (!DOMContentLoadedCallbacks.length) {\n document.addEventListener('DOMContentLoaded', () => {\n for (const callback of DOMContentLoadedCallbacks) {\n callback();\n }\n });\n }\n DOMContentLoadedCallbacks.push(callback);\n } else {\n callback();\n }\n};\nconst isRTL = () => document.documentElement.dir === 'rtl';\nconst defineJQueryPlugin = plugin => {\n onDOMContentLoaded(() => {\n const $ = getjQuery();\n /* istanbul ignore if */\n if ($) {\n const name = plugin.NAME;\n const JQUERY_NO_CONFLICT = $.fn[name];\n $.fn[name] = plugin.jQueryInterface;\n $.fn[name].Constructor = plugin;\n $.fn[name].noConflict = () => {\n $.fn[name] = JQUERY_NO_CONFLICT;\n return plugin.jQueryInterface;\n };\n }\n });\n};\nconst execute = (possibleCallback, args = [], defaultValue = possibleCallback) => {\n return typeof possibleCallback === 'function' ? possibleCallback(...args) : defaultValue;\n};\nconst executeAfterTransition = (callback, transitionElement, waitForTransition = true) => {\n if (!waitForTransition) {\n execute(callback);\n return;\n }\n const durationPadding = 5;\n const emulatedDuration = getTransitionDurationFromElement(transitionElement) + durationPadding;\n let called = false;\n const handler = ({\n target\n }) => {\n if (target !== transitionElement) {\n return;\n }\n called = true;\n transitionElement.removeEventListener(TRANSITION_END, handler);\n execute(callback);\n };\n transitionElement.addEventListener(TRANSITION_END, handler);\n setTimeout(() => {\n if (!called) {\n triggerTransitionEnd(transitionElement);\n }\n }, emulatedDuration);\n};\n\n/**\n * Return the previous/next element of a list.\n *\n * @param {array} list The list of elements\n * @param activeElement The active element\n * @param shouldGetNext Choose to get next or previous element\n * @param isCycleAllowed\n * @return {Element|elem} The proper element\n */\nconst getNextActiveElement = (list, activeElement, shouldGetNext, isCycleAllowed) => {\n const listLength = list.length;\n let index = list.indexOf(activeElement);\n\n // if the element does not exist in the list return an element\n // depending on the direction and if cycle is allowed\n if (index === -1) {\n return !shouldGetNext && isCycleAllowed ? list[listLength - 1] : list[0];\n }\n index += shouldGetNext ? 1 : -1;\n if (isCycleAllowed) {\n index = (index + listLength) % listLength;\n }\n return list[Math.max(0, Math.min(index, listLength - 1))];\n};\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap dom/event-handler.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst namespaceRegex = /[^.]*(?=\\..*)\\.|.*/;\nconst stripNameRegex = /\\..*/;\nconst stripUidRegex = /::\\d+$/;\nconst eventRegistry = {}; // Events storage\nlet uidEvent = 1;\nconst customEvents = {\n mouseenter: 'mouseover',\n mouseleave: 'mouseout'\n};\nconst nativeEvents = new Set(['click', 'dblclick', 'mouseup', 'mousedown', 'contextmenu', 'mousewheel', 'DOMMouseScroll', 'mouseover', 'mouseout', 'mousemove', 'selectstart', 'selectend', 'keydown', 'keypress', 'keyup', 'orientationchange', 'touchstart', 'touchmove', 'touchend', 'touchcancel', 'pointerdown', 'pointermove', 'pointerup', 'pointerleave', 'pointercancel', 'gesturestart', 'gesturechange', 'gestureend', 'focus', 'blur', 'change', 'reset', 'select', 'submit', 'focusin', 'focusout', 'load', 'unload', 'beforeunload', 'resize', 'move', 'DOMContentLoaded', 'readystatechange', 'error', 'abort', 'scroll']);\n\n/**\n * Private methods\n */\n\nfunction makeEventUid(element, uid) {\n return uid && `${uid}::${uidEvent++}` || element.uidEvent || uidEvent++;\n}\nfunction getElementEvents(element) {\n const uid = makeEventUid(element);\n element.uidEvent = uid;\n eventRegistry[uid] = eventRegistry[uid] || {};\n return eventRegistry[uid];\n}\nfunction bootstrapHandler(element, fn) {\n return function handler(event) {\n hydrateObj(event, {\n delegateTarget: element\n });\n if (handler.oneOff) {\n EventHandler.off(element, event.type, fn);\n }\n return fn.apply(element, [event]);\n };\n}\nfunction bootstrapDelegationHandler(element, selector, fn) {\n return function handler(event) {\n const domElements = element.querySelectorAll(selector);\n for (let {\n target\n } = event; target && target !== this; target = target.parentNode) {\n for (const domElement of domElements) {\n if (domElement !== target) {\n continue;\n }\n hydrateObj(event, {\n delegateTarget: target\n });\n if (handler.oneOff) {\n EventHandler.off(element, event.type, selector, fn);\n }\n return fn.apply(target, [event]);\n }\n }\n };\n}\nfunction findHandler(events, callable, delegationSelector = null) {\n return Object.values(events).find(event => event.callable === callable && event.delegationSelector === delegationSelector);\n}\nfunction normalizeParameters(originalTypeEvent, handler, delegationFunction) {\n const isDelegated = typeof handler === 'string';\n // TODO: tooltip passes `false` instead of selector, so we need to check\n const callable = isDelegated ? delegationFunction : handler || delegationFunction;\n let typeEvent = getTypeEvent(originalTypeEvent);\n if (!nativeEvents.has(typeEvent)) {\n typeEvent = originalTypeEvent;\n }\n return [isDelegated, callable, typeEvent];\n}\nfunction addHandler(element, originalTypeEvent, handler, delegationFunction, oneOff) {\n if (typeof originalTypeEvent !== 'string' || !element) {\n return;\n }\n let [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction);\n\n // in case of mouseenter or mouseleave wrap the handler within a function that checks for its DOM position\n // this prevents the handler from being dispatched the same way as mouseover or mouseout does\n if (originalTypeEvent in customEvents) {\n const wrapFunction = fn => {\n return function (event) {\n if (!event.relatedTarget || event.relatedTarget !== event.delegateTarget && !event.delegateTarget.contains(event.relatedTarget)) {\n return fn.call(this, event);\n }\n };\n };\n callable = wrapFunction(callable);\n }\n const events = getElementEvents(element);\n const handlers = events[typeEvent] || (events[typeEvent] = {});\n const previousFunction = findHandler(handlers, callable, isDelegated ? handler : null);\n if (previousFunction) {\n previousFunction.oneOff = previousFunction.oneOff && oneOff;\n return;\n }\n const uid = makeEventUid(callable, originalTypeEvent.replace(namespaceRegex, ''));\n const fn = isDelegated ? bootstrapDelegationHandler(element, handler, callable) : bootstrapHandler(element, callable);\n fn.delegationSelector = isDelegated ? handler : null;\n fn.callable = callable;\n fn.oneOff = oneOff;\n fn.uidEvent = uid;\n handlers[uid] = fn;\n element.addEventListener(typeEvent, fn, isDelegated);\n}\nfunction removeHandler(element, events, typeEvent, handler, delegationSelector) {\n const fn = findHandler(events[typeEvent], handler, delegationSelector);\n if (!fn) {\n return;\n }\n element.removeEventListener(typeEvent, fn, Boolean(delegationSelector));\n delete events[typeEvent][fn.uidEvent];\n}\nfunction removeNamespacedHandlers(element, events, typeEvent, namespace) {\n const storeElementEvent = events[typeEvent] || {};\n for (const [handlerKey, event] of Object.entries(storeElementEvent)) {\n if (handlerKey.includes(namespace)) {\n removeHandler(element, events, typeEvent, event.callable, event.delegationSelector);\n }\n }\n}\nfunction getTypeEvent(event) {\n // allow to get the native events from namespaced events ('click.bs.button' --> 'click')\n event = event.replace(stripNameRegex, '');\n return customEvents[event] || event;\n}\nconst EventHandler = {\n on(element, event, handler, delegationFunction) {\n addHandler(element, event, handler, delegationFunction, false);\n },\n one(element, event, handler, delegationFunction) {\n addHandler(element, event, handler, delegationFunction, true);\n },\n off(element, originalTypeEvent, handler, delegationFunction) {\n if (typeof originalTypeEvent !== 'string' || !element) {\n return;\n }\n const [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction);\n const inNamespace = typeEvent !== originalTypeEvent;\n const events = getElementEvents(element);\n const storeElementEvent = events[typeEvent] || {};\n const isNamespace = originalTypeEvent.startsWith('.');\n if (typeof callable !== 'undefined') {\n // Simplest case: handler is passed, remove that listener ONLY.\n if (!Object.keys(storeElementEvent).length) {\n return;\n }\n removeHandler(element, events, typeEvent, callable, isDelegated ? handler : null);\n return;\n }\n if (isNamespace) {\n for (const elementEvent of Object.keys(events)) {\n removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.slice(1));\n }\n }\n for (const [keyHandlers, event] of Object.entries(storeElementEvent)) {\n const handlerKey = keyHandlers.replace(stripUidRegex, '');\n if (!inNamespace || originalTypeEvent.includes(handlerKey)) {\n removeHandler(element, events, typeEvent, event.callable, event.delegationSelector);\n }\n }\n },\n trigger(element, event, args) {\n if (typeof event !== 'string' || !element) {\n return null;\n }\n const $ = getjQuery();\n const typeEvent = getTypeEvent(event);\n const inNamespace = event !== typeEvent;\n let jQueryEvent = null;\n let bubbles = true;\n let nativeDispatch = true;\n let defaultPrevented = false;\n if (inNamespace && $) {\n jQueryEvent = $.Event(event, args);\n $(element).trigger(jQueryEvent);\n bubbles = !jQueryEvent.isPropagationStopped();\n nativeDispatch = !jQueryEvent.isImmediatePropagationStopped();\n defaultPrevented = jQueryEvent.isDefaultPrevented();\n }\n const evt = hydrateObj(new Event(event, {\n bubbles,\n cancelable: true\n }), args);\n if (defaultPrevented) {\n evt.preventDefault();\n }\n if (nativeDispatch) {\n element.dispatchEvent(evt);\n }\n if (evt.defaultPrevented && jQueryEvent) {\n jQueryEvent.preventDefault();\n }\n return evt;\n }\n};\nfunction hydrateObj(obj, meta = {}) {\n for (const [key, value] of Object.entries(meta)) {\n try {\n obj[key] = value;\n } catch (_unused) {\n Object.defineProperty(obj, key, {\n configurable: true,\n get() {\n return value;\n }\n });\n }\n }\n return obj;\n}\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap dom/manipulator.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nfunction normalizeData(value) {\n if (value === 'true') {\n return true;\n }\n if (value === 'false') {\n return false;\n }\n if (value === Number(value).toString()) {\n return Number(value);\n }\n if (value === '' || value === 'null') {\n return null;\n }\n if (typeof value !== 'string') {\n return value;\n }\n try {\n return JSON.parse(decodeURIComponent(value));\n } catch (_unused) {\n return value;\n }\n}\nfunction normalizeDataKey(key) {\n return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`);\n}\nconst Manipulator = {\n setDataAttribute(element, key, value) {\n element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value);\n },\n removeDataAttribute(element, key) {\n element.removeAttribute(`data-bs-${normalizeDataKey(key)}`);\n },\n getDataAttributes(element) {\n if (!element) {\n return {};\n }\n const attributes = {};\n const bsKeys = Object.keys(element.dataset).filter(key => key.startsWith('bs') && !key.startsWith('bsConfig'));\n for (const key of bsKeys) {\n let pureKey = key.replace(/^bs/, '');\n pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length);\n attributes[pureKey] = normalizeData(element.dataset[key]);\n }\n return attributes;\n },\n getDataAttribute(element, key) {\n return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`));\n }\n};\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap util/config.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Class definition\n */\n\nclass Config {\n // Getters\n static get Default() {\n return {};\n }\n static get DefaultType() {\n return {};\n }\n static get NAME() {\n throw new Error('You have to implement the static method \"NAME\", for each component!');\n }\n _getConfig(config) {\n config = this._mergeConfigObj(config);\n config = this._configAfterMerge(config);\n this._typeCheckConfig(config);\n return config;\n }\n _configAfterMerge(config) {\n return config;\n }\n _mergeConfigObj(config, element) {\n const jsonConfig = isElement(element) ? Manipulator.getDataAttribute(element, 'config') : {}; // try to parse\n\n return {\n ...this.constructor.Default,\n ...(typeof jsonConfig === 'object' ? jsonConfig : {}),\n ...(isElement(element) ? Manipulator.getDataAttributes(element) : {}),\n ...(typeof config === 'object' ? config : {})\n };\n }\n _typeCheckConfig(config, configTypes = this.constructor.DefaultType) {\n for (const [property, expectedTypes] of Object.entries(configTypes)) {\n const value = config[property];\n const valueType = isElement(value) ? 'element' : toType(value);\n if (!new RegExp(expectedTypes).test(valueType)) {\n throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option \"${property}\" provided type \"${valueType}\" but expected type \"${expectedTypes}\".`);\n }\n }\n }\n}\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap base-component.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst VERSION = '5.3.3';\n\n/**\n * Class definition\n */\n\nclass BaseComponent extends Config {\n constructor(element, config) {\n super();\n element = getElement(element);\n if (!element) {\n return;\n }\n this._element = element;\n this._config = this._getConfig(config);\n Data.set(this._element, this.constructor.DATA_KEY, this);\n }\n\n // Public\n dispose() {\n Data.remove(this._element, this.constructor.DATA_KEY);\n EventHandler.off(this._element, this.constructor.EVENT_KEY);\n for (const propertyName of Object.getOwnPropertyNames(this)) {\n this[propertyName] = null;\n }\n }\n _queueCallback(callback, element, isAnimated = true) {\n executeAfterTransition(callback, element, isAnimated);\n }\n _getConfig(config) {\n config = this._mergeConfigObj(config, this._element);\n config = this._configAfterMerge(config);\n this._typeCheckConfig(config);\n return config;\n }\n\n // Static\n static getInstance(element) {\n return Data.get(getElement(element), this.DATA_KEY);\n }\n static getOrCreateInstance(element, config = {}) {\n return this.getInstance(element) || new this(element, typeof config === 'object' ? config : null);\n }\n static get VERSION() {\n return VERSION;\n }\n static get DATA_KEY() {\n return `bs.${this.NAME}`;\n }\n static get EVENT_KEY() {\n return `.${this.DATA_KEY}`;\n }\n static eventName(name) {\n return `${name}${this.EVENT_KEY}`;\n }\n}\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap dom/selector-engine.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst getSelector = element => {\n let selector = element.getAttribute('data-bs-target');\n if (!selector || selector === '#') {\n let hrefAttribute = element.getAttribute('href');\n\n // The only valid content that could double as a selector are IDs or classes,\n // so everything starting with `#` or `.`. If a \"real\" URL is used as the selector,\n // `document.querySelector` will rightfully complain it is invalid.\n // See https://github.com/twbs/bootstrap/issues/32273\n if (!hrefAttribute || !hrefAttribute.includes('#') && !hrefAttribute.startsWith('.')) {\n return null;\n }\n\n // Just in case some CMS puts out a full URL with the anchor appended\n if (hrefAttribute.includes('#') && !hrefAttribute.startsWith('#')) {\n hrefAttribute = `#${hrefAttribute.split('#')[1]}`;\n }\n selector = hrefAttribute && hrefAttribute !== '#' ? hrefAttribute.trim() : null;\n }\n return selector ? selector.split(',').map(sel => parseSelector(sel)).join(',') : null;\n};\nconst SelectorEngine = {\n find(selector, element = document.documentElement) {\n return [].concat(...Element.prototype.querySelectorAll.call(element, selector));\n },\n findOne(selector, element = document.documentElement) {\n return Element.prototype.querySelector.call(element, selector);\n },\n children(element, selector) {\n return [].concat(...element.children).filter(child => child.matches(selector));\n },\n parents(element, selector) {\n const parents = [];\n let ancestor = element.parentNode.closest(selector);\n while (ancestor) {\n parents.push(ancestor);\n ancestor = ancestor.parentNode.closest(selector);\n }\n return parents;\n },\n prev(element, selector) {\n let previous = element.previousElementSibling;\n while (previous) {\n if (previous.matches(selector)) {\n return [previous];\n }\n previous = previous.previousElementSibling;\n }\n return [];\n },\n // TODO: this is now unused; remove later along with prev()\n next(element, selector) {\n let next = element.nextElementSibling;\n while (next) {\n if (next.matches(selector)) {\n return [next];\n }\n next = next.nextElementSibling;\n }\n return [];\n },\n focusableChildren(element) {\n const focusables = ['a', 'button', 'input', 'textarea', 'select', 'details', '[tabindex]', '[contenteditable=\"true\"]'].map(selector => `${selector}:not([tabindex^=\"-\"])`).join(',');\n return this.find(focusables, element).filter(el => !isDisabled(el) && isVisible(el));\n },\n getSelectorFromElement(element) {\n const selector = getSelector(element);\n if (selector) {\n return SelectorEngine.findOne(selector) ? selector : null;\n }\n return null;\n },\n getElementFromSelector(element) {\n const selector = getSelector(element);\n return selector ? SelectorEngine.findOne(selector) : null;\n },\n getMultipleElementsFromSelector(element) {\n const selector = getSelector(element);\n return selector ? SelectorEngine.find(selector) : [];\n }\n};\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap util/component-functions.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst enableDismissTrigger = (component, method = 'hide') => {\n const clickEvent = `click.dismiss${component.EVENT_KEY}`;\n const name = component.NAME;\n EventHandler.on(document, clickEvent, `[data-bs-dismiss=\"${name}\"]`, function (event) {\n if (['A', 'AREA'].includes(this.tagName)) {\n event.preventDefault();\n }\n if (isDisabled(this)) {\n return;\n }\n const target = SelectorEngine.getElementFromSelector(this) || this.closest(`.${name}`);\n const instance = component.getOrCreateInstance(target);\n\n // Method argument is left, for Alert and only, as it doesn't implement the 'hide' method\n instance[method]();\n });\n};\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap alert.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$f = 'alert';\nconst DATA_KEY$a = 'bs.alert';\nconst EVENT_KEY$b = `.${DATA_KEY$a}`;\nconst EVENT_CLOSE = `close${EVENT_KEY$b}`;\nconst EVENT_CLOSED = `closed${EVENT_KEY$b}`;\nconst CLASS_NAME_FADE$5 = 'fade';\nconst CLASS_NAME_SHOW$8 = 'show';\n\n/**\n * Class definition\n */\n\nclass Alert extends BaseComponent {\n // Getters\n static get NAME() {\n return NAME$f;\n }\n\n // Public\n close() {\n const closeEvent = EventHandler.trigger(this._element, EVENT_CLOSE);\n if (closeEvent.defaultPrevented) {\n return;\n }\n this._element.classList.remove(CLASS_NAME_SHOW$8);\n const isAnimated = this._element.classList.contains(CLASS_NAME_FADE$5);\n this._queueCallback(() => this._destroyElement(), this._element, isAnimated);\n }\n\n // Private\n _destroyElement() {\n this._element.remove();\n EventHandler.trigger(this._element, EVENT_CLOSED);\n this.dispose();\n }\n\n // Static\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Alert.getOrCreateInstance(this);\n if (typeof config !== 'string') {\n return;\n }\n if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n data[config](this);\n });\n }\n}\n\n/**\n * Data API implementation\n */\n\nenableDismissTrigger(Alert, 'close');\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Alert);\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap button.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$e = 'button';\nconst DATA_KEY$9 = 'bs.button';\nconst EVENT_KEY$a = `.${DATA_KEY$9}`;\nconst DATA_API_KEY$6 = '.data-api';\nconst CLASS_NAME_ACTIVE$3 = 'active';\nconst SELECTOR_DATA_TOGGLE$5 = '[data-bs-toggle=\"button\"]';\nconst EVENT_CLICK_DATA_API$6 = `click${EVENT_KEY$a}${DATA_API_KEY$6}`;\n\n/**\n * Class definition\n */\n\nclass Button extends BaseComponent {\n // Getters\n static get NAME() {\n return NAME$e;\n }\n\n // Public\n toggle() {\n // Toggle class and sync the `aria-pressed` attribute with the return value of the `.toggle()` method\n this._element.setAttribute('aria-pressed', this._element.classList.toggle(CLASS_NAME_ACTIVE$3));\n }\n\n // Static\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Button.getOrCreateInstance(this);\n if (config === 'toggle') {\n data[config]();\n }\n });\n }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API$6, SELECTOR_DATA_TOGGLE$5, event => {\n event.preventDefault();\n const button = event.target.closest(SELECTOR_DATA_TOGGLE$5);\n const data = Button.getOrCreateInstance(button);\n data.toggle();\n});\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Button);\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap util/swipe.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$d = 'swipe';\nconst EVENT_KEY$9 = '.bs.swipe';\nconst EVENT_TOUCHSTART = `touchstart${EVENT_KEY$9}`;\nconst EVENT_TOUCHMOVE = `touchmove${EVENT_KEY$9}`;\nconst EVENT_TOUCHEND = `touchend${EVENT_KEY$9}`;\nconst EVENT_POINTERDOWN = `pointerdown${EVENT_KEY$9}`;\nconst EVENT_POINTERUP = `pointerup${EVENT_KEY$9}`;\nconst POINTER_TYPE_TOUCH = 'touch';\nconst POINTER_TYPE_PEN = 'pen';\nconst CLASS_NAME_POINTER_EVENT = 'pointer-event';\nconst SWIPE_THRESHOLD = 40;\nconst Default$c = {\n endCallback: null,\n leftCallback: null,\n rightCallback: null\n};\nconst DefaultType$c = {\n endCallback: '(function|null)',\n leftCallback: '(function|null)',\n rightCallback: '(function|null)'\n};\n\n/**\n * Class definition\n */\n\nclass Swipe extends Config {\n constructor(element, config) {\n super();\n this._element = element;\n if (!element || !Swipe.isSupported()) {\n return;\n }\n this._config = this._getConfig(config);\n this._deltaX = 0;\n this._supportPointerEvents = Boolean(window.PointerEvent);\n this._initEvents();\n }\n\n // Getters\n static get Default() {\n return Default$c;\n }\n static get DefaultType() {\n return DefaultType$c;\n }\n static get NAME() {\n return NAME$d;\n }\n\n // Public\n dispose() {\n EventHandler.off(this._element, EVENT_KEY$9);\n }\n\n // Private\n _start(event) {\n if (!this._supportPointerEvents) {\n this._deltaX = event.touches[0].clientX;\n return;\n }\n if (this._eventIsPointerPenTouch(event)) {\n this._deltaX = event.clientX;\n }\n }\n _end(event) {\n if (this._eventIsPointerPenTouch(event)) {\n this._deltaX = event.clientX - this._deltaX;\n }\n this._handleSwipe();\n execute(this._config.endCallback);\n }\n _move(event) {\n this._deltaX = event.touches && event.touches.length > 1 ? 0 : event.touches[0].clientX - this._deltaX;\n }\n _handleSwipe() {\n const absDeltaX = Math.abs(this._deltaX);\n if (absDeltaX <= SWIPE_THRESHOLD) {\n return;\n }\n const direction = absDeltaX / this._deltaX;\n this._deltaX = 0;\n if (!direction) {\n return;\n }\n execute(direction > 0 ? this._config.rightCallback : this._config.leftCallback);\n }\n _initEvents() {\n if (this._supportPointerEvents) {\n EventHandler.on(this._element, EVENT_POINTERDOWN, event => this._start(event));\n EventHandler.on(this._element, EVENT_POINTERUP, event => this._end(event));\n this._element.classList.add(CLASS_NAME_POINTER_EVENT);\n } else {\n EventHandler.on(this._element, EVENT_TOUCHSTART, event => this._start(event));\n EventHandler.on(this._element, EVENT_TOUCHMOVE, event => this._move(event));\n EventHandler.on(this._element, EVENT_TOUCHEND, event => this._end(event));\n }\n }\n _eventIsPointerPenTouch(event) {\n return this._supportPointerEvents && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH);\n }\n\n // Static\n static isSupported() {\n return 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;\n }\n}\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap carousel.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$c = 'carousel';\nconst DATA_KEY$8 = 'bs.carousel';\nconst EVENT_KEY$8 = `.${DATA_KEY$8}`;\nconst DATA_API_KEY$5 = '.data-api';\nconst ARROW_LEFT_KEY$1 = 'ArrowLeft';\nconst ARROW_RIGHT_KEY$1 = 'ArrowRight';\nconst TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch\n\nconst ORDER_NEXT = 'next';\nconst ORDER_PREV = 'prev';\nconst DIRECTION_LEFT = 'left';\nconst DIRECTION_RIGHT = 'right';\nconst EVENT_SLIDE = `slide${EVENT_KEY$8}`;\nconst EVENT_SLID = `slid${EVENT_KEY$8}`;\nconst EVENT_KEYDOWN$1 = `keydown${EVENT_KEY$8}`;\nconst EVENT_MOUSEENTER$1 = `mouseenter${EVENT_KEY$8}`;\nconst EVENT_MOUSELEAVE$1 = `mouseleave${EVENT_KEY$8}`;\nconst EVENT_DRAG_START = `dragstart${EVENT_KEY$8}`;\nconst EVENT_LOAD_DATA_API$3 = `load${EVENT_KEY$8}${DATA_API_KEY$5}`;\nconst EVENT_CLICK_DATA_API$5 = `click${EVENT_KEY$8}${DATA_API_KEY$5}`;\nconst CLASS_NAME_CAROUSEL = 'carousel';\nconst CLASS_NAME_ACTIVE$2 = 'active';\nconst CLASS_NAME_SLIDE = 'slide';\nconst CLASS_NAME_END = 'carousel-item-end';\nconst CLASS_NAME_START = 'carousel-item-start';\nconst CLASS_NAME_NEXT = 'carousel-item-next';\nconst CLASS_NAME_PREV = 'carousel-item-prev';\nconst SELECTOR_ACTIVE = '.active';\nconst SELECTOR_ITEM = '.carousel-item';\nconst SELECTOR_ACTIVE_ITEM = SELECTOR_ACTIVE + SELECTOR_ITEM;\nconst SELECTOR_ITEM_IMG = '.carousel-item img';\nconst SELECTOR_INDICATORS = '.carousel-indicators';\nconst SELECTOR_DATA_SLIDE = '[data-bs-slide], [data-bs-slide-to]';\nconst SELECTOR_DATA_RIDE = '[data-bs-ride=\"carousel\"]';\nconst KEY_TO_DIRECTION = {\n [ARROW_LEFT_KEY$1]: DIRECTION_RIGHT,\n [ARROW_RIGHT_KEY$1]: DIRECTION_LEFT\n};\nconst Default$b = {\n interval: 5000,\n keyboard: true,\n pause: 'hover',\n ride: false,\n touch: true,\n wrap: true\n};\nconst DefaultType$b = {\n interval: '(number|boolean)',\n // TODO:v6 remove boolean support\n keyboard: 'boolean',\n pause: '(string|boolean)',\n ride: '(boolean|string)',\n touch: 'boolean',\n wrap: 'boolean'\n};\n\n/**\n * Class definition\n */\n\nclass Carousel extends BaseComponent {\n constructor(element, config) {\n super(element, config);\n this._interval = null;\n this._activeElement = null;\n this._isSliding = false;\n this.touchTimeout = null;\n this._swipeHelper = null;\n this._indicatorsElement = SelectorEngine.findOne(SELECTOR_INDICATORS, this._element);\n this._addEventListeners();\n if (this._config.ride === CLASS_NAME_CAROUSEL) {\n this.cycle();\n }\n }\n\n // Getters\n static get Default() {\n return Default$b;\n }\n static get DefaultType() {\n return DefaultType$b;\n }\n static get NAME() {\n return NAME$c;\n }\n\n // Public\n next() {\n this._slide(ORDER_NEXT);\n }\n nextWhenVisible() {\n // FIXME TODO use `document.visibilityState`\n // Don't call next when the page isn't visible\n // or the carousel or its parent isn't visible\n if (!document.hidden && isVisible(this._element)) {\n this.next();\n }\n }\n prev() {\n this._slide(ORDER_PREV);\n }\n pause() {\n if (this._isSliding) {\n triggerTransitionEnd(this._element);\n }\n this._clearInterval();\n }\n cycle() {\n this._clearInterval();\n this._updateInterval();\n this._interval = setInterval(() => this.nextWhenVisible(), this._config.interval);\n }\n _maybeEnableCycle() {\n if (!this._config.ride) {\n return;\n }\n if (this._isSliding) {\n EventHandler.one(this._element, EVENT_SLID, () => this.cycle());\n return;\n }\n this.cycle();\n }\n to(index) {\n const items = this._getItems();\n if (index > items.length - 1 || index < 0) {\n return;\n }\n if (this._isSliding) {\n EventHandler.one(this._element, EVENT_SLID, () => this.to(index));\n return;\n }\n const activeIndex = this._getItemIndex(this._getActive());\n if (activeIndex === index) {\n return;\n }\n const order = index > activeIndex ? ORDER_NEXT : ORDER_PREV;\n this._slide(order, items[index]);\n }\n dispose() {\n if (this._swipeHelper) {\n this._swipeHelper.dispose();\n }\n super.dispose();\n }\n\n // Private\n _configAfterMerge(config) {\n config.defaultInterval = config.interval;\n return config;\n }\n _addEventListeners() {\n if (this._config.keyboard) {\n EventHandler.on(this._element, EVENT_KEYDOWN$1, event => this._keydown(event));\n }\n if (this._config.pause === 'hover') {\n EventHandler.on(this._element, EVENT_MOUSEENTER$1, () => this.pause());\n EventHandler.on(this._element, EVENT_MOUSELEAVE$1, () => this._maybeEnableCycle());\n }\n if (this._config.touch && Swipe.isSupported()) {\n this._addTouchEventListeners();\n }\n }\n _addTouchEventListeners() {\n for (const img of SelectorEngine.find(SELECTOR_ITEM_IMG, this._element)) {\n EventHandler.on(img, EVENT_DRAG_START, event => event.preventDefault());\n }\n const endCallBack = () => {\n if (this._config.pause !== 'hover') {\n return;\n }\n\n // If it's a touch-enabled device, mouseenter/leave are fired as\n // part of the mouse compatibility events on first tap - the carousel\n // would stop cycling until user tapped out of it;\n // here, we listen for touchend, explicitly pause the carousel\n // (as if it's the second time we tap on it, mouseenter compat event\n // is NOT fired) and after a timeout (to allow for mouse compatibility\n // events to fire) we explicitly restart cycling\n\n this.pause();\n if (this.touchTimeout) {\n clearTimeout(this.touchTimeout);\n }\n this.touchTimeout = setTimeout(() => this._maybeEnableCycle(), TOUCHEVENT_COMPAT_WAIT + this._config.interval);\n };\n const swipeConfig = {\n leftCallback: () => this._slide(this._directionToOrder(DIRECTION_LEFT)),\n rightCallback: () => this._slide(this._directionToOrder(DIRECTION_RIGHT)),\n endCallback: endCallBack\n };\n this._swipeHelper = new Swipe(this._element, swipeConfig);\n }\n _keydown(event) {\n if (/input|textarea/i.test(event.target.tagName)) {\n return;\n }\n const direction = KEY_TO_DIRECTION[event.key];\n if (direction) {\n event.preventDefault();\n this._slide(this._directionToOrder(direction));\n }\n }\n _getItemIndex(element) {\n return this._getItems().indexOf(element);\n }\n _setActiveIndicatorElement(index) {\n if (!this._indicatorsElement) {\n return;\n }\n const activeIndicator = SelectorEngine.findOne(SELECTOR_ACTIVE, this._indicatorsElement);\n activeIndicator.classList.remove(CLASS_NAME_ACTIVE$2);\n activeIndicator.removeAttribute('aria-current');\n const newActiveIndicator = SelectorEngine.findOne(`[data-bs-slide-to=\"${index}\"]`, this._indicatorsElement);\n if (newActiveIndicator) {\n newActiveIndicator.classList.add(CLASS_NAME_ACTIVE$2);\n newActiveIndicator.setAttribute('aria-current', 'true');\n }\n }\n _updateInterval() {\n const element = this._activeElement || this._getActive();\n if (!element) {\n return;\n }\n const elementInterval = Number.parseInt(element.getAttribute('data-bs-interval'), 10);\n this._config.interval = elementInterval || this._config.defaultInterval;\n }\n _slide(order, element = null) {\n if (this._isSliding) {\n return;\n }\n const activeElement = this._getActive();\n const isNext = order === ORDER_NEXT;\n const nextElement = element || getNextActiveElement(this._getItems(), activeElement, isNext, this._config.wrap);\n if (nextElement === activeElement) {\n return;\n }\n const nextElementIndex = this._getItemIndex(nextElement);\n const triggerEvent = eventName => {\n return EventHandler.trigger(this._element, eventName, {\n relatedTarget: nextElement,\n direction: this._orderToDirection(order),\n from: this._getItemIndex(activeElement),\n to: nextElementIndex\n });\n };\n const slideEvent = triggerEvent(EVENT_SLIDE);\n if (slideEvent.defaultPrevented) {\n return;\n }\n if (!activeElement || !nextElement) {\n // Some weirdness is happening, so we bail\n // TODO: change tests that use empty divs to avoid this check\n return;\n }\n const isCycling = Boolean(this._interval);\n this.pause();\n this._isSliding = true;\n this._setActiveIndicatorElement(nextElementIndex);\n this._activeElement = nextElement;\n const directionalClassName = isNext ? CLASS_NAME_START : CLASS_NAME_END;\n const orderClassName = isNext ? CLASS_NAME_NEXT : CLASS_NAME_PREV;\n nextElement.classList.add(orderClassName);\n reflow(nextElement);\n activeElement.classList.add(directionalClassName);\n nextElement.classList.add(directionalClassName);\n const completeCallBack = () => {\n nextElement.classList.remove(directionalClassName, orderClassName);\n nextElement.classList.add(CLASS_NAME_ACTIVE$2);\n activeElement.classList.remove(CLASS_NAME_ACTIVE$2, orderClassName, directionalClassName);\n this._isSliding = false;\n triggerEvent(EVENT_SLID);\n };\n this._queueCallback(completeCallBack, activeElement, this._isAnimated());\n if (isCycling) {\n this.cycle();\n }\n }\n _isAnimated() {\n return this._element.classList.contains(CLASS_NAME_SLIDE);\n }\n _getActive() {\n return SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element);\n }\n _getItems() {\n return SelectorEngine.find(SELECTOR_ITEM, this._element);\n }\n _clearInterval() {\n if (this._interval) {\n clearInterval(this._interval);\n this._interval = null;\n }\n }\n _directionToOrder(direction) {\n if (isRTL()) {\n return direction === DIRECTION_LEFT ? ORDER_PREV : ORDER_NEXT;\n }\n return direction === DIRECTION_LEFT ? ORDER_NEXT : ORDER_PREV;\n }\n _orderToDirection(order) {\n if (isRTL()) {\n return order === ORDER_PREV ? DIRECTION_LEFT : DIRECTION_RIGHT;\n }\n return order === ORDER_PREV ? DIRECTION_RIGHT : DIRECTION_LEFT;\n }\n\n // Static\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Carousel.getOrCreateInstance(this, config);\n if (typeof config === 'number') {\n data.to(config);\n return;\n }\n if (typeof config === 'string') {\n if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n data[config]();\n }\n });\n }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API$5, SELECTOR_DATA_SLIDE, function (event) {\n const target = SelectorEngine.getElementFromSelector(this);\n if (!target || !target.classList.contains(CLASS_NAME_CAROUSEL)) {\n return;\n }\n event.preventDefault();\n const carousel = Carousel.getOrCreateInstance(target);\n const slideIndex = this.getAttribute('data-bs-slide-to');\n if (slideIndex) {\n carousel.to(slideIndex);\n carousel._maybeEnableCycle();\n return;\n }\n if (Manipulator.getDataAttribute(this, 'slide') === 'next') {\n carousel.next();\n carousel._maybeEnableCycle();\n return;\n }\n carousel.prev();\n carousel._maybeEnableCycle();\n});\nEventHandler.on(window, EVENT_LOAD_DATA_API$3, () => {\n const carousels = SelectorEngine.find(SELECTOR_DATA_RIDE);\n for (const carousel of carousels) {\n Carousel.getOrCreateInstance(carousel);\n }\n});\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Carousel);\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap collapse.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$b = 'collapse';\nconst DATA_KEY$7 = 'bs.collapse';\nconst EVENT_KEY$7 = `.${DATA_KEY$7}`;\nconst DATA_API_KEY$4 = '.data-api';\nconst EVENT_SHOW$6 = `show${EVENT_KEY$7}`;\nconst EVENT_SHOWN$6 = `shown${EVENT_KEY$7}`;\nconst EVENT_HIDE$6 = `hide${EVENT_KEY$7}`;\nconst EVENT_HIDDEN$6 = `hidden${EVENT_KEY$7}`;\nconst EVENT_CLICK_DATA_API$4 = `click${EVENT_KEY$7}${DATA_API_KEY$4}`;\nconst CLASS_NAME_SHOW$7 = 'show';\nconst CLASS_NAME_COLLAPSE = 'collapse';\nconst CLASS_NAME_COLLAPSING = 'collapsing';\nconst CLASS_NAME_COLLAPSED = 'collapsed';\nconst CLASS_NAME_DEEPER_CHILDREN = `:scope .${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}`;\nconst CLASS_NAME_HORIZONTAL = 'collapse-horizontal';\nconst WIDTH = 'width';\nconst HEIGHT = 'height';\nconst SELECTOR_ACTIVES = '.collapse.show, .collapse.collapsing';\nconst SELECTOR_DATA_TOGGLE$4 = '[data-bs-toggle=\"collapse\"]';\nconst Default$a = {\n parent: null,\n toggle: true\n};\nconst DefaultType$a = {\n parent: '(null|element)',\n toggle: 'boolean'\n};\n\n/**\n * Class definition\n */\n\nclass Collapse extends BaseComponent {\n constructor(element, config) {\n super(element, config);\n this._isTransitioning = false;\n this._triggerArray = [];\n const toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE$4);\n for (const elem of toggleList) {\n const selector = SelectorEngine.getSelectorFromElement(elem);\n const filterElement = SelectorEngine.find(selector).filter(foundElement => foundElement === this._element);\n if (selector !== null && filterElement.length) {\n this._triggerArray.push(elem);\n }\n }\n this._initializeChildren();\n if (!this._config.parent) {\n this._addAriaAndCollapsedClass(this._triggerArray, this._isShown());\n }\n if (this._config.toggle) {\n this.toggle();\n }\n }\n\n // Getters\n static get Default() {\n return Default$a;\n }\n static get DefaultType() {\n return DefaultType$a;\n }\n static get NAME() {\n return NAME$b;\n }\n\n // Public\n toggle() {\n if (this._isShown()) {\n this.hide();\n } else {\n this.show();\n }\n }\n show() {\n if (this._isTransitioning || this._isShown()) {\n return;\n }\n let activeChildren = [];\n\n // find active children\n if (this._config.parent) {\n activeChildren = this._getFirstLevelChildren(SELECTOR_ACTIVES).filter(element => element !== this._element).map(element => Collapse.getOrCreateInstance(element, {\n toggle: false\n }));\n }\n if (activeChildren.length && activeChildren[0]._isTransitioning) {\n return;\n }\n const startEvent = EventHandler.trigger(this._element, EVENT_SHOW$6);\n if (startEvent.defaultPrevented) {\n return;\n }\n for (const activeInstance of activeChildren) {\n activeInstance.hide();\n }\n const dimension = this._getDimension();\n this._element.classList.remove(CLASS_NAME_COLLAPSE);\n this._element.classList.add(CLASS_NAME_COLLAPSING);\n this._element.style[dimension] = 0;\n this._addAriaAndCollapsedClass(this._triggerArray, true);\n this._isTransitioning = true;\n const complete = () => {\n this._isTransitioning = false;\n this._element.classList.remove(CLASS_NAME_COLLAPSING);\n this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$7);\n this._element.style[dimension] = '';\n EventHandler.trigger(this._element, EVENT_SHOWN$6);\n };\n const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);\n const scrollSize = `scroll${capitalizedDimension}`;\n this._queueCallback(complete, this._element, true);\n this._element.style[dimension] = `${this._element[scrollSize]}px`;\n }\n hide() {\n if (this._isTransitioning || !this._isShown()) {\n return;\n }\n const startEvent = EventHandler.trigger(this._element, EVENT_HIDE$6);\n if (startEvent.defaultPrevented) {\n return;\n }\n const dimension = this._getDimension();\n this._element.style[dimension] = `${this._element.getBoundingClientRect()[dimension]}px`;\n reflow(this._element);\n this._element.classList.add(CLASS_NAME_COLLAPSING);\n this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$7);\n for (const trigger of this._triggerArray) {\n const element = SelectorEngine.getElementFromSelector(trigger);\n if (element && !this._isShown(element)) {\n this._addAriaAndCollapsedClass([trigger], false);\n }\n }\n this._isTransitioning = true;\n const complete = () => {\n this._isTransitioning = false;\n this._element.classList.remove(CLASS_NAME_COLLAPSING);\n this._element.classList.add(CLASS_NAME_COLLAPSE);\n EventHandler.trigger(this._element, EVENT_HIDDEN$6);\n };\n this._element.style[dimension] = '';\n this._queueCallback(complete, this._element, true);\n }\n _isShown(element = this._element) {\n return element.classList.contains(CLASS_NAME_SHOW$7);\n }\n\n // Private\n _configAfterMerge(config) {\n config.toggle = Boolean(config.toggle); // Coerce string values\n config.parent = getElement(config.parent);\n return config;\n }\n _getDimension() {\n return this._element.classList.contains(CLASS_NAME_HORIZONTAL) ? WIDTH : HEIGHT;\n }\n _initializeChildren() {\n if (!this._config.parent) {\n return;\n }\n const children = this._getFirstLevelChildren(SELECTOR_DATA_TOGGLE$4);\n for (const element of children) {\n const selected = SelectorEngine.getElementFromSelector(element);\n if (selected) {\n this._addAriaAndCollapsedClass([element], this._isShown(selected));\n }\n }\n }\n _getFirstLevelChildren(selector) {\n const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent);\n // remove children if greater depth\n return SelectorEngine.find(selector, this._config.parent).filter(element => !children.includes(element));\n }\n _addAriaAndCollapsedClass(triggerArray, isOpen) {\n if (!triggerArray.length) {\n return;\n }\n for (const element of triggerArray) {\n element.classList.toggle(CLASS_NAME_COLLAPSED, !isOpen);\n element.setAttribute('aria-expanded', isOpen);\n }\n }\n\n // Static\n static jQueryInterface(config) {\n const _config = {};\n if (typeof config === 'string' && /show|hide/.test(config)) {\n _config.toggle = false;\n }\n return this.each(function () {\n const data = Collapse.getOrCreateInstance(this, _config);\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n data[config]();\n }\n });\n }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API$4, SELECTOR_DATA_TOGGLE$4, function (event) {\n // preventDefault only for elements (which change the URL) not inside the collapsible element\n if (event.target.tagName === 'A' || event.delegateTarget && event.delegateTarget.tagName === 'A') {\n event.preventDefault();\n }\n for (const element of SelectorEngine.getMultipleElementsFromSelector(this)) {\n Collapse.getOrCreateInstance(element, {\n toggle: false\n }).toggle();\n }\n});\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Collapse);\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap dropdown.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$a = 'dropdown';\nconst DATA_KEY$6 = 'bs.dropdown';\nconst EVENT_KEY$6 = `.${DATA_KEY$6}`;\nconst DATA_API_KEY$3 = '.data-api';\nconst ESCAPE_KEY$2 = 'Escape';\nconst TAB_KEY$1 = 'Tab';\nconst ARROW_UP_KEY$1 = 'ArrowUp';\nconst ARROW_DOWN_KEY$1 = 'ArrowDown';\nconst RIGHT_MOUSE_BUTTON = 2; // MouseEvent.button value for the secondary button, usually the right button\n\nconst EVENT_HIDE$5 = `hide${EVENT_KEY$6}`;\nconst EVENT_HIDDEN$5 = `hidden${EVENT_KEY$6}`;\nconst EVENT_SHOW$5 = `show${EVENT_KEY$6}`;\nconst EVENT_SHOWN$5 = `shown${EVENT_KEY$6}`;\nconst EVENT_CLICK_DATA_API$3 = `click${EVENT_KEY$6}${DATA_API_KEY$3}`;\nconst EVENT_KEYDOWN_DATA_API = `keydown${EVENT_KEY$6}${DATA_API_KEY$3}`;\nconst EVENT_KEYUP_DATA_API = `keyup${EVENT_KEY$6}${DATA_API_KEY$3}`;\nconst CLASS_NAME_SHOW$6 = 'show';\nconst CLASS_NAME_DROPUP = 'dropup';\nconst CLASS_NAME_DROPEND = 'dropend';\nconst CLASS_NAME_DROPSTART = 'dropstart';\nconst CLASS_NAME_DROPUP_CENTER = 'dropup-center';\nconst CLASS_NAME_DROPDOWN_CENTER = 'dropdown-center';\nconst SELECTOR_DATA_TOGGLE$3 = '[data-bs-toggle=\"dropdown\"]:not(.disabled):not(:disabled)';\nconst SELECTOR_DATA_TOGGLE_SHOWN = `${SELECTOR_DATA_TOGGLE$3}.${CLASS_NAME_SHOW$6}`;\nconst SELECTOR_MENU = '.dropdown-menu';\nconst SELECTOR_NAVBAR = '.navbar';\nconst SELECTOR_NAVBAR_NAV = '.navbar-nav';\nconst SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)';\nconst PLACEMENT_TOP = isRTL() ? 'top-end' : 'top-start';\nconst PLACEMENT_TOPEND = isRTL() ? 'top-start' : 'top-end';\nconst PLACEMENT_BOTTOM = isRTL() ? 'bottom-end' : 'bottom-start';\nconst PLACEMENT_BOTTOMEND = isRTL() ? 'bottom-start' : 'bottom-end';\nconst PLACEMENT_RIGHT = isRTL() ? 'left-start' : 'right-start';\nconst PLACEMENT_LEFT = isRTL() ? 'right-start' : 'left-start';\nconst PLACEMENT_TOPCENTER = 'top';\nconst PLACEMENT_BOTTOMCENTER = 'bottom';\nconst Default$9 = {\n autoClose: true,\n boundary: 'clippingParents',\n display: 'dynamic',\n offset: [0, 2],\n popperConfig: null,\n reference: 'toggle'\n};\nconst DefaultType$9 = {\n autoClose: '(boolean|string)',\n boundary: '(string|element)',\n display: 'string',\n offset: '(array|string|function)',\n popperConfig: '(null|object|function)',\n reference: '(string|element|object)'\n};\n\n/**\n * Class definition\n */\n\nclass Dropdown extends BaseComponent {\n constructor(element, config) {\n super(element, config);\n this._popper = null;\n this._parent = this._element.parentNode; // dropdown wrapper\n // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/\n this._menu = SelectorEngine.next(this._element, SELECTOR_MENU)[0] || SelectorEngine.prev(this._element, SELECTOR_MENU)[0] || SelectorEngine.findOne(SELECTOR_MENU, this._parent);\n this._inNavbar = this._detectNavbar();\n }\n\n // Getters\n static get Default() {\n return Default$9;\n }\n static get DefaultType() {\n return DefaultType$9;\n }\n static get NAME() {\n return NAME$a;\n }\n\n // Public\n toggle() {\n return this._isShown() ? this.hide() : this.show();\n }\n show() {\n if (isDisabled(this._element) || this._isShown()) {\n return;\n }\n const relatedTarget = {\n relatedTarget: this._element\n };\n const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$5, relatedTarget);\n if (showEvent.defaultPrevented) {\n return;\n }\n this._createPopper();\n\n // If this is a touch-enabled device we add extra\n // empty mouseover listeners to the body's immediate children;\n // only needed because of broken event delegation on iOS\n // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n if ('ontouchstart' in document.documentElement && !this._parent.closest(SELECTOR_NAVBAR_NAV)) {\n for (const element of [].concat(...document.body.children)) {\n EventHandler.on(element, 'mouseover', noop);\n }\n }\n this._element.focus();\n this._element.setAttribute('aria-expanded', true);\n this._menu.classList.add(CLASS_NAME_SHOW$6);\n this._element.classList.add(CLASS_NAME_SHOW$6);\n EventHandler.trigger(this._element, EVENT_SHOWN$5, relatedTarget);\n }\n hide() {\n if (isDisabled(this._element) || !this._isShown()) {\n return;\n }\n const relatedTarget = {\n relatedTarget: this._element\n };\n this._completeHide(relatedTarget);\n }\n dispose() {\n if (this._popper) {\n this._popper.destroy();\n }\n super.dispose();\n }\n update() {\n this._inNavbar = this._detectNavbar();\n if (this._popper) {\n this._popper.update();\n }\n }\n\n // Private\n _completeHide(relatedTarget) {\n const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$5, relatedTarget);\n if (hideEvent.defaultPrevented) {\n return;\n }\n\n // If this is a touch-enabled device we remove the extra\n // empty mouseover listeners we added for iOS support\n if ('ontouchstart' in document.documentElement) {\n for (const element of [].concat(...document.body.children)) {\n EventHandler.off(element, 'mouseover', noop);\n }\n }\n if (this._popper) {\n this._popper.destroy();\n }\n this._menu.classList.remove(CLASS_NAME_SHOW$6);\n this._element.classList.remove(CLASS_NAME_SHOW$6);\n this._element.setAttribute('aria-expanded', 'false');\n Manipulator.removeDataAttribute(this._menu, 'popper');\n EventHandler.trigger(this._element, EVENT_HIDDEN$5, relatedTarget);\n }\n _getConfig(config) {\n config = super._getConfig(config);\n if (typeof config.reference === 'object' && !isElement(config.reference) && typeof config.reference.getBoundingClientRect !== 'function') {\n // Popper virtual elements require a getBoundingClientRect method\n throw new TypeError(`${NAME$a.toUpperCase()}: Option \"reference\" provided type \"object\" without a required \"getBoundingClientRect\" method.`);\n }\n return config;\n }\n _createPopper() {\n if (typeof Popper === 'undefined') {\n throw new TypeError('Bootstrap\\'s dropdowns require Popper (https://popper.js.org)');\n }\n let referenceElement = this._element;\n if (this._config.reference === 'parent') {\n referenceElement = this._parent;\n } else if (isElement(this._config.reference)) {\n referenceElement = getElement(this._config.reference);\n } else if (typeof this._config.reference === 'object') {\n referenceElement = this._config.reference;\n }\n const popperConfig = this._getPopperConfig();\n this._popper = Popper.createPopper(referenceElement, this._menu, popperConfig);\n }\n _isShown() {\n return this._menu.classList.contains(CLASS_NAME_SHOW$6);\n }\n _getPlacement() {\n const parentDropdown = this._parent;\n if (parentDropdown.classList.contains(CLASS_NAME_DROPEND)) {\n return PLACEMENT_RIGHT;\n }\n if (parentDropdown.classList.contains(CLASS_NAME_DROPSTART)) {\n return PLACEMENT_LEFT;\n }\n if (parentDropdown.classList.contains(CLASS_NAME_DROPUP_CENTER)) {\n return PLACEMENT_TOPCENTER;\n }\n if (parentDropdown.classList.contains(CLASS_NAME_DROPDOWN_CENTER)) {\n return PLACEMENT_BOTTOMCENTER;\n }\n\n // We need to trim the value because custom properties can also include spaces\n const isEnd = getComputedStyle(this._menu).getPropertyValue('--bs-position').trim() === 'end';\n if (parentDropdown.classList.contains(CLASS_NAME_DROPUP)) {\n return isEnd ? PLACEMENT_TOPEND : PLACEMENT_TOP;\n }\n return isEnd ? PLACEMENT_BOTTOMEND : PLACEMENT_BOTTOM;\n }\n _detectNavbar() {\n return this._element.closest(SELECTOR_NAVBAR) !== null;\n }\n _getOffset() {\n const {\n offset\n } = this._config;\n if (typeof offset === 'string') {\n return offset.split(',').map(value => Number.parseInt(value, 10));\n }\n if (typeof offset === 'function') {\n return popperData => offset(popperData, this._element);\n }\n return offset;\n }\n _getPopperConfig() {\n const defaultBsPopperConfig = {\n placement: this._getPlacement(),\n modifiers: [{\n name: 'preventOverflow',\n options: {\n boundary: this._config.boundary\n }\n }, {\n name: 'offset',\n options: {\n offset: this._getOffset()\n }\n }]\n };\n\n // Disable Popper if we have a static display or Dropdown is in Navbar\n if (this._inNavbar || this._config.display === 'static') {\n Manipulator.setDataAttribute(this._menu, 'popper', 'static'); // TODO: v6 remove\n defaultBsPopperConfig.modifiers = [{\n name: 'applyStyles',\n enabled: false\n }];\n }\n return {\n ...defaultBsPopperConfig,\n ...execute(this._config.popperConfig, [defaultBsPopperConfig])\n };\n }\n _selectMenuItem({\n key,\n target\n }) {\n const items = SelectorEngine.find(SELECTOR_VISIBLE_ITEMS, this._menu).filter(element => isVisible(element));\n if (!items.length) {\n return;\n }\n\n // if target isn't included in items (e.g. when expanding the dropdown)\n // allow cycling to get the last item in case key equals ARROW_UP_KEY\n getNextActiveElement(items, target, key === ARROW_DOWN_KEY$1, !items.includes(target)).focus();\n }\n\n // Static\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Dropdown.getOrCreateInstance(this, config);\n if (typeof config !== 'string') {\n return;\n }\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n data[config]();\n });\n }\n static clearMenus(event) {\n if (event.button === RIGHT_MOUSE_BUTTON || event.type === 'keyup' && event.key !== TAB_KEY$1) {\n return;\n }\n const openToggles = SelectorEngine.find(SELECTOR_DATA_TOGGLE_SHOWN);\n for (const toggle of openToggles) {\n const context = Dropdown.getInstance(toggle);\n if (!context || context._config.autoClose === false) {\n continue;\n }\n const composedPath = event.composedPath();\n const isMenuTarget = composedPath.includes(context._menu);\n if (composedPath.includes(context._element) || context._config.autoClose === 'inside' && !isMenuTarget || context._config.autoClose === 'outside' && isMenuTarget) {\n continue;\n }\n\n // Tab navigation through the dropdown menu or events from contained inputs shouldn't close the menu\n if (context._menu.contains(event.target) && (event.type === 'keyup' && event.key === TAB_KEY$1 || /input|select|option|textarea|form/i.test(event.target.tagName))) {\n continue;\n }\n const relatedTarget = {\n relatedTarget: context._element\n };\n if (event.type === 'click') {\n relatedTarget.clickEvent = event;\n }\n context._completeHide(relatedTarget);\n }\n }\n static dataApiKeydownHandler(event) {\n // If not an UP | DOWN | ESCAPE key => not a dropdown command\n // If input/textarea && if key is other than ESCAPE => not a dropdown command\n\n const isInput = /input|textarea/i.test(event.target.tagName);\n const isEscapeEvent = event.key === ESCAPE_KEY$2;\n const isUpOrDownEvent = [ARROW_UP_KEY$1, ARROW_DOWN_KEY$1].includes(event.key);\n if (!isUpOrDownEvent && !isEscapeEvent) {\n return;\n }\n if (isInput && !isEscapeEvent) {\n return;\n }\n event.preventDefault();\n\n // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/\n const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE$3) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE$3)[0] || SelectorEngine.next(this, SELECTOR_DATA_TOGGLE$3)[0] || SelectorEngine.findOne(SELECTOR_DATA_TOGGLE$3, event.delegateTarget.parentNode);\n const instance = Dropdown.getOrCreateInstance(getToggleButton);\n if (isUpOrDownEvent) {\n event.stopPropagation();\n instance.show();\n instance._selectMenuItem(event);\n return;\n }\n if (instance._isShown()) {\n // else is escape and we check if it is shown\n event.stopPropagation();\n instance.hide();\n getToggleButton.focus();\n }\n }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE$3, Dropdown.dataApiKeydownHandler);\nEventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown.dataApiKeydownHandler);\nEventHandler.on(document, EVENT_CLICK_DATA_API$3, Dropdown.clearMenus);\nEventHandler.on(document, EVENT_KEYUP_DATA_API, Dropdown.clearMenus);\nEventHandler.on(document, EVENT_CLICK_DATA_API$3, SELECTOR_DATA_TOGGLE$3, function (event) {\n event.preventDefault();\n Dropdown.getOrCreateInstance(this).toggle();\n});\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Dropdown);\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap util/backdrop.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$9 = 'backdrop';\nconst CLASS_NAME_FADE$4 = 'fade';\nconst CLASS_NAME_SHOW$5 = 'show';\nconst EVENT_MOUSEDOWN = `mousedown.bs.${NAME$9}`;\nconst Default$8 = {\n className: 'modal-backdrop',\n clickCallback: null,\n isAnimated: false,\n isVisible: true,\n // if false, we use the backdrop helper without adding any element to the dom\n rootElement: 'body' // give the choice to place backdrop under different elements\n};\nconst DefaultType$8 = {\n className: 'string',\n clickCallback: '(function|null)',\n isAnimated: 'boolean',\n isVisible: 'boolean',\n rootElement: '(element|string)'\n};\n\n/**\n * Class definition\n */\n\nclass Backdrop extends Config {\n constructor(config) {\n super();\n this._config = this._getConfig(config);\n this._isAppended = false;\n this._element = null;\n }\n\n // Getters\n static get Default() {\n return Default$8;\n }\n static get DefaultType() {\n return DefaultType$8;\n }\n static get NAME() {\n return NAME$9;\n }\n\n // Public\n show(callback) {\n if (!this._config.isVisible) {\n execute(callback);\n return;\n }\n this._append();\n const element = this._getElement();\n if (this._config.isAnimated) {\n reflow(element);\n }\n element.classList.add(CLASS_NAME_SHOW$5);\n this._emulateAnimation(() => {\n execute(callback);\n });\n }\n hide(callback) {\n if (!this._config.isVisible) {\n execute(callback);\n return;\n }\n this._getElement().classList.remove(CLASS_NAME_SHOW$5);\n this._emulateAnimation(() => {\n this.dispose();\n execute(callback);\n });\n }\n dispose() {\n if (!this._isAppended) {\n return;\n }\n EventHandler.off(this._element, EVENT_MOUSEDOWN);\n this._element.remove();\n this._isAppended = false;\n }\n\n // Private\n _getElement() {\n if (!this._element) {\n const backdrop = document.createElement('div');\n backdrop.className = this._config.className;\n if (this._config.isAnimated) {\n backdrop.classList.add(CLASS_NAME_FADE$4);\n }\n this._element = backdrop;\n }\n return this._element;\n }\n _configAfterMerge(config) {\n // use getElement() with the default \"body\" to get a fresh Element on each instantiation\n config.rootElement = getElement(config.rootElement);\n return config;\n }\n _append() {\n if (this._isAppended) {\n return;\n }\n const element = this._getElement();\n this._config.rootElement.append(element);\n EventHandler.on(element, EVENT_MOUSEDOWN, () => {\n execute(this._config.clickCallback);\n });\n this._isAppended = true;\n }\n _emulateAnimation(callback) {\n executeAfterTransition(callback, this._getElement(), this._config.isAnimated);\n }\n}\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap util/focustrap.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$8 = 'focustrap';\nconst DATA_KEY$5 = 'bs.focustrap';\nconst EVENT_KEY$5 = `.${DATA_KEY$5}`;\nconst EVENT_FOCUSIN$2 = `focusin${EVENT_KEY$5}`;\nconst EVENT_KEYDOWN_TAB = `keydown.tab${EVENT_KEY$5}`;\nconst TAB_KEY = 'Tab';\nconst TAB_NAV_FORWARD = 'forward';\nconst TAB_NAV_BACKWARD = 'backward';\nconst Default$7 = {\n autofocus: true,\n trapElement: null // The element to trap focus inside of\n};\nconst DefaultType$7 = {\n autofocus: 'boolean',\n trapElement: 'element'\n};\n\n/**\n * Class definition\n */\n\nclass FocusTrap extends Config {\n constructor(config) {\n super();\n this._config = this._getConfig(config);\n this._isActive = false;\n this._lastTabNavDirection = null;\n }\n\n // Getters\n static get Default() {\n return Default$7;\n }\n static get DefaultType() {\n return DefaultType$7;\n }\n static get NAME() {\n return NAME$8;\n }\n\n // Public\n activate() {\n if (this._isActive) {\n return;\n }\n if (this._config.autofocus) {\n this._config.trapElement.focus();\n }\n EventHandler.off(document, EVENT_KEY$5); // guard against infinite focus loop\n EventHandler.on(document, EVENT_FOCUSIN$2, event => this._handleFocusin(event));\n EventHandler.on(document, EVENT_KEYDOWN_TAB, event => this._handleKeydown(event));\n this._isActive = true;\n }\n deactivate() {\n if (!this._isActive) {\n return;\n }\n this._isActive = false;\n EventHandler.off(document, EVENT_KEY$5);\n }\n\n // Private\n _handleFocusin(event) {\n const {\n trapElement\n } = this._config;\n if (event.target === document || event.target === trapElement || trapElement.contains(event.target)) {\n return;\n }\n const elements = SelectorEngine.focusableChildren(trapElement);\n if (elements.length === 0) {\n trapElement.focus();\n } else if (this._lastTabNavDirection === TAB_NAV_BACKWARD) {\n elements[elements.length - 1].focus();\n } else {\n elements[0].focus();\n }\n }\n _handleKeydown(event) {\n if (event.key !== TAB_KEY) {\n return;\n }\n this._lastTabNavDirection = event.shiftKey ? TAB_NAV_BACKWARD : TAB_NAV_FORWARD;\n }\n}\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap util/scrollBar.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';\nconst SELECTOR_STICKY_CONTENT = '.sticky-top';\nconst PROPERTY_PADDING = 'padding-right';\nconst PROPERTY_MARGIN = 'margin-right';\n\n/**\n * Class definition\n */\n\nclass ScrollBarHelper {\n constructor() {\n this._element = document.body;\n }\n\n // Public\n getWidth() {\n // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes\n const documentWidth = document.documentElement.clientWidth;\n return Math.abs(window.innerWidth - documentWidth);\n }\n hide() {\n const width = this.getWidth();\n this._disableOverFlow();\n // give padding to element to balance the hidden scrollbar width\n this._setElementAttributes(this._element, PROPERTY_PADDING, calculatedValue => calculatedValue + width);\n // trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth\n this._setElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING, calculatedValue => calculatedValue + width);\n this._setElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN, calculatedValue => calculatedValue - width);\n }\n reset() {\n this._resetElementAttributes(this._element, 'overflow');\n this._resetElementAttributes(this._element, PROPERTY_PADDING);\n this._resetElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING);\n this._resetElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN);\n }\n isOverflowing() {\n return this.getWidth() > 0;\n }\n\n // Private\n _disableOverFlow() {\n this._saveInitialAttribute(this._element, 'overflow');\n this._element.style.overflow = 'hidden';\n }\n _setElementAttributes(selector, styleProperty, callback) {\n const scrollbarWidth = this.getWidth();\n const manipulationCallBack = element => {\n if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) {\n return;\n }\n this._saveInitialAttribute(element, styleProperty);\n const calculatedValue = window.getComputedStyle(element).getPropertyValue(styleProperty);\n element.style.setProperty(styleProperty, `${callback(Number.parseFloat(calculatedValue))}px`);\n };\n this._applyManipulationCallback(selector, manipulationCallBack);\n }\n _saveInitialAttribute(element, styleProperty) {\n const actualValue = element.style.getPropertyValue(styleProperty);\n if (actualValue) {\n Manipulator.setDataAttribute(element, styleProperty, actualValue);\n }\n }\n _resetElementAttributes(selector, styleProperty) {\n const manipulationCallBack = element => {\n const value = Manipulator.getDataAttribute(element, styleProperty);\n // We only want to remove the property if the value is `null`; the value can also be zero\n if (value === null) {\n element.style.removeProperty(styleProperty);\n return;\n }\n Manipulator.removeDataAttribute(element, styleProperty);\n element.style.setProperty(styleProperty, value);\n };\n this._applyManipulationCallback(selector, manipulationCallBack);\n }\n _applyManipulationCallback(selector, callBack) {\n if (isElement(selector)) {\n callBack(selector);\n return;\n }\n for (const sel of SelectorEngine.find(selector, this._element)) {\n callBack(sel);\n }\n }\n}\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap modal.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$7 = 'modal';\nconst DATA_KEY$4 = 'bs.modal';\nconst EVENT_KEY$4 = `.${DATA_KEY$4}`;\nconst DATA_API_KEY$2 = '.data-api';\nconst ESCAPE_KEY$1 = 'Escape';\nconst EVENT_HIDE$4 = `hide${EVENT_KEY$4}`;\nconst EVENT_HIDE_PREVENTED$1 = `hidePrevented${EVENT_KEY$4}`;\nconst EVENT_HIDDEN$4 = `hidden${EVENT_KEY$4}`;\nconst EVENT_SHOW$4 = `show${EVENT_KEY$4}`;\nconst EVENT_SHOWN$4 = `shown${EVENT_KEY$4}`;\nconst EVENT_RESIZE$1 = `resize${EVENT_KEY$4}`;\nconst EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY$4}`;\nconst EVENT_MOUSEDOWN_DISMISS = `mousedown.dismiss${EVENT_KEY$4}`;\nconst EVENT_KEYDOWN_DISMISS$1 = `keydown.dismiss${EVENT_KEY$4}`;\nconst EVENT_CLICK_DATA_API$2 = `click${EVENT_KEY$4}${DATA_API_KEY$2}`;\nconst CLASS_NAME_OPEN = 'modal-open';\nconst CLASS_NAME_FADE$3 = 'fade';\nconst CLASS_NAME_SHOW$4 = 'show';\nconst CLASS_NAME_STATIC = 'modal-static';\nconst OPEN_SELECTOR$1 = '.modal.show';\nconst SELECTOR_DIALOG = '.modal-dialog';\nconst SELECTOR_MODAL_BODY = '.modal-body';\nconst SELECTOR_DATA_TOGGLE$2 = '[data-bs-toggle=\"modal\"]';\nconst Default$6 = {\n backdrop: true,\n focus: true,\n keyboard: true\n};\nconst DefaultType$6 = {\n backdrop: '(boolean|string)',\n focus: 'boolean',\n keyboard: 'boolean'\n};\n\n/**\n * Class definition\n */\n\nclass Modal extends BaseComponent {\n constructor(element, config) {\n super(element, config);\n this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, this._element);\n this._backdrop = this._initializeBackDrop();\n this._focustrap = this._initializeFocusTrap();\n this._isShown = false;\n this._isTransitioning = false;\n this._scrollBar = new ScrollBarHelper();\n this._addEventListeners();\n }\n\n // Getters\n static get Default() {\n return Default$6;\n }\n static get DefaultType() {\n return DefaultType$6;\n }\n static get NAME() {\n return NAME$7;\n }\n\n // Public\n toggle(relatedTarget) {\n return this._isShown ? this.hide() : this.show(relatedTarget);\n }\n show(relatedTarget) {\n if (this._isShown || this._isTransitioning) {\n return;\n }\n const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$4, {\n relatedTarget\n });\n if (showEvent.defaultPrevented) {\n return;\n }\n this._isShown = true;\n this._isTransitioning = true;\n this._scrollBar.hide();\n document.body.classList.add(CLASS_NAME_OPEN);\n this._adjustDialog();\n this._backdrop.show(() => this._showElement(relatedTarget));\n }\n hide() {\n if (!this._isShown || this._isTransitioning) {\n return;\n }\n const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$4);\n if (hideEvent.defaultPrevented) {\n return;\n }\n this._isShown = false;\n this._isTransitioning = true;\n this._focustrap.deactivate();\n this._element.classList.remove(CLASS_NAME_SHOW$4);\n this._queueCallback(() => this._hideModal(), this._element, this._isAnimated());\n }\n dispose() {\n EventHandler.off(window, EVENT_KEY$4);\n EventHandler.off(this._dialog, EVENT_KEY$4);\n this._backdrop.dispose();\n this._focustrap.deactivate();\n super.dispose();\n }\n handleUpdate() {\n this._adjustDialog();\n }\n\n // Private\n _initializeBackDrop() {\n return new Backdrop({\n isVisible: Boolean(this._config.backdrop),\n // 'static' option will be translated to true, and booleans will keep their value,\n isAnimated: this._isAnimated()\n });\n }\n _initializeFocusTrap() {\n return new FocusTrap({\n trapElement: this._element\n });\n }\n _showElement(relatedTarget) {\n // try to append dynamic modal\n if (!document.body.contains(this._element)) {\n document.body.append(this._element);\n }\n this._element.style.display = 'block';\n this._element.removeAttribute('aria-hidden');\n this._element.setAttribute('aria-modal', true);\n this._element.setAttribute('role', 'dialog');\n this._element.scrollTop = 0;\n const modalBody = SelectorEngine.findOne(SELECTOR_MODAL_BODY, this._dialog);\n if (modalBody) {\n modalBody.scrollTop = 0;\n }\n reflow(this._element);\n this._element.classList.add(CLASS_NAME_SHOW$4);\n const transitionComplete = () => {\n if (this._config.focus) {\n this._focustrap.activate();\n }\n this._isTransitioning = false;\n EventHandler.trigger(this._element, EVENT_SHOWN$4, {\n relatedTarget\n });\n };\n this._queueCallback(transitionComplete, this._dialog, this._isAnimated());\n }\n _addEventListeners() {\n EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS$1, event => {\n if (event.key !== ESCAPE_KEY$1) {\n return;\n }\n if (this._config.keyboard) {\n this.hide();\n return;\n }\n this._triggerBackdropTransition();\n });\n EventHandler.on(window, EVENT_RESIZE$1, () => {\n if (this._isShown && !this._isTransitioning) {\n this._adjustDialog();\n }\n });\n EventHandler.on(this._element, EVENT_MOUSEDOWN_DISMISS, event => {\n // a bad trick to segregate clicks that may start inside dialog but end outside, and avoid listen to scrollbar clicks\n EventHandler.one(this._element, EVENT_CLICK_DISMISS, event2 => {\n if (this._element !== event.target || this._element !== event2.target) {\n return;\n }\n if (this._config.backdrop === 'static') {\n this._triggerBackdropTransition();\n return;\n }\n if (this._config.backdrop) {\n this.hide();\n }\n });\n });\n }\n _hideModal() {\n this._element.style.display = 'none';\n this._element.setAttribute('aria-hidden', true);\n this._element.removeAttribute('aria-modal');\n this._element.removeAttribute('role');\n this._isTransitioning = false;\n this._backdrop.hide(() => {\n document.body.classList.remove(CLASS_NAME_OPEN);\n this._resetAdjustments();\n this._scrollBar.reset();\n EventHandler.trigger(this._element, EVENT_HIDDEN$4);\n });\n }\n _isAnimated() {\n return this._element.classList.contains(CLASS_NAME_FADE$3);\n }\n _triggerBackdropTransition() {\n const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED$1);\n if (hideEvent.defaultPrevented) {\n return;\n }\n const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;\n const initialOverflowY = this._element.style.overflowY;\n // return if the following background transition hasn't yet completed\n if (initialOverflowY === 'hidden' || this._element.classList.contains(CLASS_NAME_STATIC)) {\n return;\n }\n if (!isModalOverflowing) {\n this._element.style.overflowY = 'hidden';\n }\n this._element.classList.add(CLASS_NAME_STATIC);\n this._queueCallback(() => {\n this._element.classList.remove(CLASS_NAME_STATIC);\n this._queueCallback(() => {\n this._element.style.overflowY = initialOverflowY;\n }, this._dialog);\n }, this._dialog);\n this._element.focus();\n }\n\n /**\n * The following methods are used to handle overflowing modals\n */\n\n _adjustDialog() {\n const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;\n const scrollbarWidth = this._scrollBar.getWidth();\n const isBodyOverflowing = scrollbarWidth > 0;\n if (isBodyOverflowing && !isModalOverflowing) {\n const property = isRTL() ? 'paddingLeft' : 'paddingRight';\n this._element.style[property] = `${scrollbarWidth}px`;\n }\n if (!isBodyOverflowing && isModalOverflowing) {\n const property = isRTL() ? 'paddingRight' : 'paddingLeft';\n this._element.style[property] = `${scrollbarWidth}px`;\n }\n }\n _resetAdjustments() {\n this._element.style.paddingLeft = '';\n this._element.style.paddingRight = '';\n }\n\n // Static\n static jQueryInterface(config, relatedTarget) {\n return this.each(function () {\n const data = Modal.getOrCreateInstance(this, config);\n if (typeof config !== 'string') {\n return;\n }\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n data[config](relatedTarget);\n });\n }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API$2, SELECTOR_DATA_TOGGLE$2, function (event) {\n const target = SelectorEngine.getElementFromSelector(this);\n if (['A', 'AREA'].includes(this.tagName)) {\n event.preventDefault();\n }\n EventHandler.one(target, EVENT_SHOW$4, showEvent => {\n if (showEvent.defaultPrevented) {\n // only register focus restorer if modal will actually get shown\n return;\n }\n EventHandler.one(target, EVENT_HIDDEN$4, () => {\n if (isVisible(this)) {\n this.focus();\n }\n });\n });\n\n // avoid conflict when clicking modal toggler while another one is open\n const alreadyOpen = SelectorEngine.findOne(OPEN_SELECTOR$1);\n if (alreadyOpen) {\n Modal.getInstance(alreadyOpen).hide();\n }\n const data = Modal.getOrCreateInstance(target);\n data.toggle(this);\n});\nenableDismissTrigger(Modal);\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Modal);\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap offcanvas.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$6 = 'offcanvas';\nconst DATA_KEY$3 = 'bs.offcanvas';\nconst EVENT_KEY$3 = `.${DATA_KEY$3}`;\nconst DATA_API_KEY$1 = '.data-api';\nconst EVENT_LOAD_DATA_API$2 = `load${EVENT_KEY$3}${DATA_API_KEY$1}`;\nconst ESCAPE_KEY = 'Escape';\nconst CLASS_NAME_SHOW$3 = 'show';\nconst CLASS_NAME_SHOWING$1 = 'showing';\nconst CLASS_NAME_HIDING = 'hiding';\nconst CLASS_NAME_BACKDROP = 'offcanvas-backdrop';\nconst OPEN_SELECTOR = '.offcanvas.show';\nconst EVENT_SHOW$3 = `show${EVENT_KEY$3}`;\nconst EVENT_SHOWN$3 = `shown${EVENT_KEY$3}`;\nconst EVENT_HIDE$3 = `hide${EVENT_KEY$3}`;\nconst EVENT_HIDE_PREVENTED = `hidePrevented${EVENT_KEY$3}`;\nconst EVENT_HIDDEN$3 = `hidden${EVENT_KEY$3}`;\nconst EVENT_RESIZE = `resize${EVENT_KEY$3}`;\nconst EVENT_CLICK_DATA_API$1 = `click${EVENT_KEY$3}${DATA_API_KEY$1}`;\nconst EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY$3}`;\nconst SELECTOR_DATA_TOGGLE$1 = '[data-bs-toggle=\"offcanvas\"]';\nconst Default$5 = {\n backdrop: true,\n keyboard: true,\n scroll: false\n};\nconst DefaultType$5 = {\n backdrop: '(boolean|string)',\n keyboard: 'boolean',\n scroll: 'boolean'\n};\n\n/**\n * Class definition\n */\n\nclass Offcanvas extends BaseComponent {\n constructor(element, config) {\n super(element, config);\n this._isShown = false;\n this._backdrop = this._initializeBackDrop();\n this._focustrap = this._initializeFocusTrap();\n this._addEventListeners();\n }\n\n // Getters\n static get Default() {\n return Default$5;\n }\n static get DefaultType() {\n return DefaultType$5;\n }\n static get NAME() {\n return NAME$6;\n }\n\n // Public\n toggle(relatedTarget) {\n return this._isShown ? this.hide() : this.show(relatedTarget);\n }\n show(relatedTarget) {\n if (this._isShown) {\n return;\n }\n const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$3, {\n relatedTarget\n });\n if (showEvent.defaultPrevented) {\n return;\n }\n this._isShown = true;\n this._backdrop.show();\n if (!this._config.scroll) {\n new ScrollBarHelper().hide();\n }\n this._element.setAttribute('aria-modal', true);\n this._element.setAttribute('role', 'dialog');\n this._element.classList.add(CLASS_NAME_SHOWING$1);\n const completeCallBack = () => {\n if (!this._config.scroll || this._config.backdrop) {\n this._focustrap.activate();\n }\n this._element.classList.add(CLASS_NAME_SHOW$3);\n this._element.classList.remove(CLASS_NAME_SHOWING$1);\n EventHandler.trigger(this._element, EVENT_SHOWN$3, {\n relatedTarget\n });\n };\n this._queueCallback(completeCallBack, this._element, true);\n }\n hide() {\n if (!this._isShown) {\n return;\n }\n const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$3);\n if (hideEvent.defaultPrevented) {\n return;\n }\n this._focustrap.deactivate();\n this._element.blur();\n this._isShown = false;\n this._element.classList.add(CLASS_NAME_HIDING);\n this._backdrop.hide();\n const completeCallback = () => {\n this._element.classList.remove(CLASS_NAME_SHOW$3, CLASS_NAME_HIDING);\n this._element.removeAttribute('aria-modal');\n this._element.removeAttribute('role');\n if (!this._config.scroll) {\n new ScrollBarHelper().reset();\n }\n EventHandler.trigger(this._element, EVENT_HIDDEN$3);\n };\n this._queueCallback(completeCallback, this._element, true);\n }\n dispose() {\n this._backdrop.dispose();\n this._focustrap.deactivate();\n super.dispose();\n }\n\n // Private\n _initializeBackDrop() {\n const clickCallback = () => {\n if (this._config.backdrop === 'static') {\n EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED);\n return;\n }\n this.hide();\n };\n\n // 'static' option will be translated to true, and booleans will keep their value\n const isVisible = Boolean(this._config.backdrop);\n return new Backdrop({\n className: CLASS_NAME_BACKDROP,\n isVisible,\n isAnimated: true,\n rootElement: this._element.parentNode,\n clickCallback: isVisible ? clickCallback : null\n });\n }\n _initializeFocusTrap() {\n return new FocusTrap({\n trapElement: this._element\n });\n }\n _addEventListeners() {\n EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => {\n if (event.key !== ESCAPE_KEY) {\n return;\n }\n if (this._config.keyboard) {\n this.hide();\n return;\n }\n EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED);\n });\n }\n\n // Static\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Offcanvas.getOrCreateInstance(this, config);\n if (typeof config !== 'string') {\n return;\n }\n if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n data[config](this);\n });\n }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API$1, SELECTOR_DATA_TOGGLE$1, function (event) {\n const target = SelectorEngine.getElementFromSelector(this);\n if (['A', 'AREA'].includes(this.tagName)) {\n event.preventDefault();\n }\n if (isDisabled(this)) {\n return;\n }\n EventHandler.one(target, EVENT_HIDDEN$3, () => {\n // focus on trigger when it is closed\n if (isVisible(this)) {\n this.focus();\n }\n });\n\n // avoid conflict when clicking a toggler of an offcanvas, while another is open\n const alreadyOpen = SelectorEngine.findOne(OPEN_SELECTOR);\n if (alreadyOpen && alreadyOpen !== target) {\n Offcanvas.getInstance(alreadyOpen).hide();\n }\n const data = Offcanvas.getOrCreateInstance(target);\n data.toggle(this);\n});\nEventHandler.on(window, EVENT_LOAD_DATA_API$2, () => {\n for (const selector of SelectorEngine.find(OPEN_SELECTOR)) {\n Offcanvas.getOrCreateInstance(selector).show();\n }\n});\nEventHandler.on(window, EVENT_RESIZE, () => {\n for (const element of SelectorEngine.find('[aria-modal][class*=show][class*=offcanvas-]')) {\n if (getComputedStyle(element).position !== 'fixed') {\n Offcanvas.getOrCreateInstance(element).hide();\n }\n }\n});\nenableDismissTrigger(Offcanvas);\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Offcanvas);\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap util/sanitizer.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n// js-docs-start allow-list\nconst ARIA_ATTRIBUTE_PATTERN = /^aria-[\\w-]*$/i;\nconst DefaultAllowlist = {\n // Global attributes allowed on any supplied element below.\n '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],\n a: ['target', 'href', 'title', 'rel'],\n area: [],\n b: [],\n br: [],\n col: [],\n code: [],\n dd: [],\n div: [],\n dl: [],\n dt: [],\n em: [],\n hr: [],\n h1: [],\n h2: [],\n h3: [],\n h4: [],\n h5: [],\n h6: [],\n i: [],\n img: ['src', 'srcset', 'alt', 'title', 'width', 'height'],\n li: [],\n ol: [],\n p: [],\n pre: [],\n s: [],\n small: [],\n span: [],\n sub: [],\n sup: [],\n strong: [],\n u: [],\n ul: []\n};\n// js-docs-end allow-list\n\nconst uriAttributes = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']);\n\n/**\n * A pattern that recognizes URLs that are safe wrt. XSS in URL navigation\n * contexts.\n *\n * Shout-out to Angular https://github.com/angular/angular/blob/15.2.8/packages/core/src/sanitization/url_sanitizer.ts#L38\n */\n// eslint-disable-next-line unicorn/better-regex\nconst SAFE_URL_PATTERN = /^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i;\nconst allowedAttribute = (attribute, allowedAttributeList) => {\n const attributeName = attribute.nodeName.toLowerCase();\n if (allowedAttributeList.includes(attributeName)) {\n if (uriAttributes.has(attributeName)) {\n return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue));\n }\n return true;\n }\n\n // Check if a regular expression validates the attribute.\n return allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp).some(regex => regex.test(attributeName));\n};\nfunction sanitizeHtml(unsafeHtml, allowList, sanitizeFunction) {\n if (!unsafeHtml.length) {\n return unsafeHtml;\n }\n if (sanitizeFunction && typeof sanitizeFunction === 'function') {\n return sanitizeFunction(unsafeHtml);\n }\n const domParser = new window.DOMParser();\n const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');\n const elements = [].concat(...createdDocument.body.querySelectorAll('*'));\n for (const element of elements) {\n const elementName = element.nodeName.toLowerCase();\n if (!Object.keys(allowList).includes(elementName)) {\n element.remove();\n continue;\n }\n const attributeList = [].concat(...element.attributes);\n const allowedAttributes = [].concat(allowList['*'] || [], allowList[elementName] || []);\n for (const attribute of attributeList) {\n if (!allowedAttribute(attribute, allowedAttributes)) {\n element.removeAttribute(attribute.nodeName);\n }\n }\n }\n return createdDocument.body.innerHTML;\n}\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap util/template-factory.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$5 = 'TemplateFactory';\nconst Default$4 = {\n allowList: DefaultAllowlist,\n content: {},\n // { selector : text , selector2 : text2 , }\n extraClass: '',\n html: false,\n sanitize: true,\n sanitizeFn: null,\n template: '
'\n};\nconst DefaultType$4 = {\n allowList: 'object',\n content: 'object',\n extraClass: '(string|function)',\n html: 'boolean',\n sanitize: 'boolean',\n sanitizeFn: '(null|function)',\n template: 'string'\n};\nconst DefaultContentType = {\n entry: '(string|element|function|null)',\n selector: '(string|element)'\n};\n\n/**\n * Class definition\n */\n\nclass TemplateFactory extends Config {\n constructor(config) {\n super();\n this._config = this._getConfig(config);\n }\n\n // Getters\n static get Default() {\n return Default$4;\n }\n static get DefaultType() {\n return DefaultType$4;\n }\n static get NAME() {\n return NAME$5;\n }\n\n // Public\n getContent() {\n return Object.values(this._config.content).map(config => this._resolvePossibleFunction(config)).filter(Boolean);\n }\n hasContent() {\n return this.getContent().length > 0;\n }\n changeContent(content) {\n this._checkContent(content);\n this._config.content = {\n ...this._config.content,\n ...content\n };\n return this;\n }\n toHtml() {\n const templateWrapper = document.createElement('div');\n templateWrapper.innerHTML = this._maybeSanitize(this._config.template);\n for (const [selector, text] of Object.entries(this._config.content)) {\n this._setContent(templateWrapper, text, selector);\n }\n const template = templateWrapper.children[0];\n const extraClass = this._resolvePossibleFunction(this._config.extraClass);\n if (extraClass) {\n template.classList.add(...extraClass.split(' '));\n }\n return template;\n }\n\n // Private\n _typeCheckConfig(config) {\n super._typeCheckConfig(config);\n this._checkContent(config.content);\n }\n _checkContent(arg) {\n for (const [selector, content] of Object.entries(arg)) {\n super._typeCheckConfig({\n selector,\n entry: content\n }, DefaultContentType);\n }\n }\n _setContent(template, content, selector) {\n const templateElement = SelectorEngine.findOne(selector, template);\n if (!templateElement) {\n return;\n }\n content = this._resolvePossibleFunction(content);\n if (!content) {\n templateElement.remove();\n return;\n }\n if (isElement(content)) {\n this._putElementInTemplate(getElement(content), templateElement);\n return;\n }\n if (this._config.html) {\n templateElement.innerHTML = this._maybeSanitize(content);\n return;\n }\n templateElement.textContent = content;\n }\n _maybeSanitize(arg) {\n return this._config.sanitize ? sanitizeHtml(arg, this._config.allowList, this._config.sanitizeFn) : arg;\n }\n _resolvePossibleFunction(arg) {\n return execute(arg, [this]);\n }\n _putElementInTemplate(element, templateElement) {\n if (this._config.html) {\n templateElement.innerHTML = '';\n templateElement.append(element);\n return;\n }\n templateElement.textContent = element.textContent;\n }\n}\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap tooltip.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$4 = 'tooltip';\nconst DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn']);\nconst CLASS_NAME_FADE$2 = 'fade';\nconst CLASS_NAME_MODAL = 'modal';\nconst CLASS_NAME_SHOW$2 = 'show';\nconst SELECTOR_TOOLTIP_INNER = '.tooltip-inner';\nconst SELECTOR_MODAL = `.${CLASS_NAME_MODAL}`;\nconst EVENT_MODAL_HIDE = 'hide.bs.modal';\nconst TRIGGER_HOVER = 'hover';\nconst TRIGGER_FOCUS = 'focus';\nconst TRIGGER_CLICK = 'click';\nconst TRIGGER_MANUAL = 'manual';\nconst EVENT_HIDE$2 = 'hide';\nconst EVENT_HIDDEN$2 = 'hidden';\nconst EVENT_SHOW$2 = 'show';\nconst EVENT_SHOWN$2 = 'shown';\nconst EVENT_INSERTED = 'inserted';\nconst EVENT_CLICK$1 = 'click';\nconst EVENT_FOCUSIN$1 = 'focusin';\nconst EVENT_FOCUSOUT$1 = 'focusout';\nconst EVENT_MOUSEENTER = 'mouseenter';\nconst EVENT_MOUSELEAVE = 'mouseleave';\nconst AttachmentMap = {\n AUTO: 'auto',\n TOP: 'top',\n RIGHT: isRTL() ? 'left' : 'right',\n BOTTOM: 'bottom',\n LEFT: isRTL() ? 'right' : 'left'\n};\nconst Default$3 = {\n allowList: DefaultAllowlist,\n animation: true,\n boundary: 'clippingParents',\n container: false,\n customClass: '',\n delay: 0,\n fallbackPlacements: ['top', 'right', 'bottom', 'left'],\n html: false,\n offset: [0, 6],\n placement: 'top',\n popperConfig: null,\n sanitize: true,\n sanitizeFn: null,\n selector: false,\n template: '
' + '
' + '
' + '
',\n title: '',\n trigger: 'hover focus'\n};\nconst DefaultType$3 = {\n allowList: 'object',\n animation: 'boolean',\n boundary: '(string|element)',\n container: '(string|element|boolean)',\n customClass: '(string|function)',\n delay: '(number|object)',\n fallbackPlacements: 'array',\n html: 'boolean',\n offset: '(array|string|function)',\n placement: '(string|function)',\n popperConfig: '(null|object|function)',\n sanitize: 'boolean',\n sanitizeFn: '(null|function)',\n selector: '(string|boolean)',\n template: 'string',\n title: '(string|element|function)',\n trigger: 'string'\n};\n\n/**\n * Class definition\n */\n\nclass Tooltip extends BaseComponent {\n constructor(element, config) {\n if (typeof Popper === 'undefined') {\n throw new TypeError('Bootstrap\\'s tooltips require Popper (https://popper.js.org)');\n }\n super(element, config);\n\n // Private\n this._isEnabled = true;\n this._timeout = 0;\n this._isHovered = null;\n this._activeTrigger = {};\n this._popper = null;\n this._templateFactory = null;\n this._newContent = null;\n\n // Protected\n this.tip = null;\n this._setListeners();\n if (!this._config.selector) {\n this._fixTitle();\n }\n }\n\n // Getters\n static get Default() {\n return Default$3;\n }\n static get DefaultType() {\n return DefaultType$3;\n }\n static get NAME() {\n return NAME$4;\n }\n\n // Public\n enable() {\n this._isEnabled = true;\n }\n disable() {\n this._isEnabled = false;\n }\n toggleEnabled() {\n this._isEnabled = !this._isEnabled;\n }\n toggle() {\n if (!this._isEnabled) {\n return;\n }\n this._activeTrigger.click = !this._activeTrigger.click;\n if (this._isShown()) {\n this._leave();\n return;\n }\n this._enter();\n }\n dispose() {\n clearTimeout(this._timeout);\n EventHandler.off(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler);\n if (this._element.getAttribute('data-bs-original-title')) {\n this._element.setAttribute('title', this._element.getAttribute('data-bs-original-title'));\n }\n this._disposePopper();\n super.dispose();\n }\n show() {\n if (this._element.style.display === 'none') {\n throw new Error('Please use show on visible elements');\n }\n if (!(this._isWithContent() && this._isEnabled)) {\n return;\n }\n const showEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOW$2));\n const shadowRoot = findShadowRoot(this._element);\n const isInTheDom = (shadowRoot || this._element.ownerDocument.documentElement).contains(this._element);\n if (showEvent.defaultPrevented || !isInTheDom) {\n return;\n }\n\n // TODO: v6 remove this or make it optional\n this._disposePopper();\n const tip = this._getTipElement();\n this._element.setAttribute('aria-describedby', tip.getAttribute('id'));\n const {\n container\n } = this._config;\n if (!this._element.ownerDocument.documentElement.contains(this.tip)) {\n container.append(tip);\n EventHandler.trigger(this._element, this.constructor.eventName(EVENT_INSERTED));\n }\n this._popper = this._createPopper(tip);\n tip.classList.add(CLASS_NAME_SHOW$2);\n\n // If this is a touch-enabled device we add extra\n // empty mouseover listeners to the body's immediate children;\n // only needed because of broken event delegation on iOS\n // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n if ('ontouchstart' in document.documentElement) {\n for (const element of [].concat(...document.body.children)) {\n EventHandler.on(element, 'mouseover', noop);\n }\n }\n const complete = () => {\n EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOWN$2));\n if (this._isHovered === false) {\n this._leave();\n }\n this._isHovered = false;\n };\n this._queueCallback(complete, this.tip, this._isAnimated());\n }\n hide() {\n if (!this._isShown()) {\n return;\n }\n const hideEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDE$2));\n if (hideEvent.defaultPrevented) {\n return;\n }\n const tip = this._getTipElement();\n tip.classList.remove(CLASS_NAME_SHOW$2);\n\n // If this is a touch-enabled device we remove the extra\n // empty mouseover listeners we added for iOS support\n if ('ontouchstart' in document.documentElement) {\n for (const element of [].concat(...document.body.children)) {\n EventHandler.off(element, 'mouseover', noop);\n }\n }\n this._activeTrigger[TRIGGER_CLICK] = false;\n this._activeTrigger[TRIGGER_FOCUS] = false;\n this._activeTrigger[TRIGGER_HOVER] = false;\n this._isHovered = null; // it is a trick to support manual triggering\n\n const complete = () => {\n if (this._isWithActiveTrigger()) {\n return;\n }\n if (!this._isHovered) {\n this._disposePopper();\n }\n this._element.removeAttribute('aria-describedby');\n EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDDEN$2));\n };\n this._queueCallback(complete, this.tip, this._isAnimated());\n }\n update() {\n if (this._popper) {\n this._popper.update();\n }\n }\n\n // Protected\n _isWithContent() {\n return Boolean(this._getTitle());\n }\n _getTipElement() {\n if (!this.tip) {\n this.tip = this._createTipElement(this._newContent || this._getContentForTemplate());\n }\n return this.tip;\n }\n _createTipElement(content) {\n const tip = this._getTemplateFactory(content).toHtml();\n\n // TODO: remove this check in v6\n if (!tip) {\n return null;\n }\n tip.classList.remove(CLASS_NAME_FADE$2, CLASS_NAME_SHOW$2);\n // TODO: v6 the following can be achieved with CSS only\n tip.classList.add(`bs-${this.constructor.NAME}-auto`);\n const tipId = getUID(this.constructor.NAME).toString();\n tip.setAttribute('id', tipId);\n if (this._isAnimated()) {\n tip.classList.add(CLASS_NAME_FADE$2);\n }\n return tip;\n }\n setContent(content) {\n this._newContent = content;\n if (this._isShown()) {\n this._disposePopper();\n this.show();\n }\n }\n _getTemplateFactory(content) {\n if (this._templateFactory) {\n this._templateFactory.changeContent(content);\n } else {\n this._templateFactory = new TemplateFactory({\n ...this._config,\n // the `content` var has to be after `this._config`\n // to override config.content in case of popover\n content,\n extraClass: this._resolvePossibleFunction(this._config.customClass)\n });\n }\n return this._templateFactory;\n }\n _getContentForTemplate() {\n return {\n [SELECTOR_TOOLTIP_INNER]: this._getTitle()\n };\n }\n _getTitle() {\n return this._resolvePossibleFunction(this._config.title) || this._element.getAttribute('data-bs-original-title');\n }\n\n // Private\n _initializeOnDelegatedTarget(event) {\n return this.constructor.getOrCreateInstance(event.delegateTarget, this._getDelegateConfig());\n }\n _isAnimated() {\n return this._config.animation || this.tip && this.tip.classList.contains(CLASS_NAME_FADE$2);\n }\n _isShown() {\n return this.tip && this.tip.classList.contains(CLASS_NAME_SHOW$2);\n }\n _createPopper(tip) {\n const placement = execute(this._config.placement, [this, tip, this._element]);\n const attachment = AttachmentMap[placement.toUpperCase()];\n return Popper.createPopper(this._element, tip, this._getPopperConfig(attachment));\n }\n _getOffset() {\n const {\n offset\n } = this._config;\n if (typeof offset === 'string') {\n return offset.split(',').map(value => Number.parseInt(value, 10));\n }\n if (typeof offset === 'function') {\n return popperData => offset(popperData, this._element);\n }\n return offset;\n }\n _resolvePossibleFunction(arg) {\n return execute(arg, [this._element]);\n }\n _getPopperConfig(attachment) {\n const defaultBsPopperConfig = {\n placement: attachment,\n modifiers: [{\n name: 'flip',\n options: {\n fallbackPlacements: this._config.fallbackPlacements\n }\n }, {\n name: 'offset',\n options: {\n offset: this._getOffset()\n }\n }, {\n name: 'preventOverflow',\n options: {\n boundary: this._config.boundary\n }\n }, {\n name: 'arrow',\n options: {\n element: `.${this.constructor.NAME}-arrow`\n }\n }, {\n name: 'preSetPlacement',\n enabled: true,\n phase: 'beforeMain',\n fn: data => {\n // Pre-set Popper's placement attribute in order to read the arrow sizes properly.\n // Otherwise, Popper mixes up the width and height dimensions since the initial arrow style is for top placement\n this._getTipElement().setAttribute('data-popper-placement', data.state.placement);\n }\n }]\n };\n return {\n ...defaultBsPopperConfig,\n ...execute(this._config.popperConfig, [defaultBsPopperConfig])\n };\n }\n _setListeners() {\n const triggers = this._config.trigger.split(' ');\n for (const trigger of triggers) {\n if (trigger === 'click') {\n EventHandler.on(this._element, this.constructor.eventName(EVENT_CLICK$1), this._config.selector, event => {\n const context = this._initializeOnDelegatedTarget(event);\n context.toggle();\n });\n } else if (trigger !== TRIGGER_MANUAL) {\n const eventIn = trigger === TRIGGER_HOVER ? this.constructor.eventName(EVENT_MOUSEENTER) : this.constructor.eventName(EVENT_FOCUSIN$1);\n const eventOut = trigger === TRIGGER_HOVER ? this.constructor.eventName(EVENT_MOUSELEAVE) : this.constructor.eventName(EVENT_FOCUSOUT$1);\n EventHandler.on(this._element, eventIn, this._config.selector, event => {\n const context = this._initializeOnDelegatedTarget(event);\n context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true;\n context._enter();\n });\n EventHandler.on(this._element, eventOut, this._config.selector, event => {\n const context = this._initializeOnDelegatedTarget(event);\n context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = context._element.contains(event.relatedTarget);\n context._leave();\n });\n }\n }\n this._hideModalHandler = () => {\n if (this._element) {\n this.hide();\n }\n };\n EventHandler.on(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler);\n }\n _fixTitle() {\n const title = this._element.getAttribute('title');\n if (!title) {\n return;\n }\n if (!this._element.getAttribute('aria-label') && !this._element.textContent.trim()) {\n this._element.setAttribute('aria-label', title);\n }\n this._element.setAttribute('data-bs-original-title', title); // DO NOT USE IT. Is only for backwards compatibility\n this._element.removeAttribute('title');\n }\n _enter() {\n if (this._isShown() || this._isHovered) {\n this._isHovered = true;\n return;\n }\n this._isHovered = true;\n this._setTimeout(() => {\n if (this._isHovered) {\n this.show();\n }\n }, this._config.delay.show);\n }\n _leave() {\n if (this._isWithActiveTrigger()) {\n return;\n }\n this._isHovered = false;\n this._setTimeout(() => {\n if (!this._isHovered) {\n this.hide();\n }\n }, this._config.delay.hide);\n }\n _setTimeout(handler, timeout) {\n clearTimeout(this._timeout);\n this._timeout = setTimeout(handler, timeout);\n }\n _isWithActiveTrigger() {\n return Object.values(this._activeTrigger).includes(true);\n }\n _getConfig(config) {\n const dataAttributes = Manipulator.getDataAttributes(this._element);\n for (const dataAttribute of Object.keys(dataAttributes)) {\n if (DISALLOWED_ATTRIBUTES.has(dataAttribute)) {\n delete dataAttributes[dataAttribute];\n }\n }\n config = {\n ...dataAttributes,\n ...(typeof config === 'object' && config ? config : {})\n };\n config = this._mergeConfigObj(config);\n config = this._configAfterMerge(config);\n this._typeCheckConfig(config);\n return config;\n }\n _configAfterMerge(config) {\n config.container = config.container === false ? document.body : getElement(config.container);\n if (typeof config.delay === 'number') {\n config.delay = {\n show: config.delay,\n hide: config.delay\n };\n }\n if (typeof config.title === 'number') {\n config.title = config.title.toString();\n }\n if (typeof config.content === 'number') {\n config.content = config.content.toString();\n }\n return config;\n }\n _getDelegateConfig() {\n const config = {};\n for (const [key, value] of Object.entries(this._config)) {\n if (this.constructor.Default[key] !== value) {\n config[key] = value;\n }\n }\n config.selector = false;\n config.trigger = 'manual';\n\n // In the future can be replaced with:\n // const keysWithDifferentValues = Object.entries(this._config).filter(entry => this.constructor.Default[entry[0]] !== this._config[entry[0]])\n // `Object.fromEntries(keysWithDifferentValues)`\n return config;\n }\n _disposePopper() {\n if (this._popper) {\n this._popper.destroy();\n this._popper = null;\n }\n if (this.tip) {\n this.tip.remove();\n this.tip = null;\n }\n }\n\n // Static\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Tooltip.getOrCreateInstance(this, config);\n if (typeof config !== 'string') {\n return;\n }\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n data[config]();\n });\n }\n}\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Tooltip);\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap popover.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$3 = 'popover';\nconst SELECTOR_TITLE = '.popover-header';\nconst SELECTOR_CONTENT = '.popover-body';\nconst Default$2 = {\n ...Tooltip.Default,\n content: '',\n offset: [0, 8],\n placement: 'right',\n template: '
' + '
' + '

' + '
' + '
',\n trigger: 'click'\n};\nconst DefaultType$2 = {\n ...Tooltip.DefaultType,\n content: '(null|string|element|function)'\n};\n\n/**\n * Class definition\n */\n\nclass Popover extends Tooltip {\n // Getters\n static get Default() {\n return Default$2;\n }\n static get DefaultType() {\n return DefaultType$2;\n }\n static get NAME() {\n return NAME$3;\n }\n\n // Overrides\n _isWithContent() {\n return this._getTitle() || this._getContent();\n }\n\n // Private\n _getContentForTemplate() {\n return {\n [SELECTOR_TITLE]: this._getTitle(),\n [SELECTOR_CONTENT]: this._getContent()\n };\n }\n _getContent() {\n return this._resolvePossibleFunction(this._config.content);\n }\n\n // Static\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Popover.getOrCreateInstance(this, config);\n if (typeof config !== 'string') {\n return;\n }\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n data[config]();\n });\n }\n}\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Popover);\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap scrollspy.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$2 = 'scrollspy';\nconst DATA_KEY$2 = 'bs.scrollspy';\nconst EVENT_KEY$2 = `.${DATA_KEY$2}`;\nconst DATA_API_KEY = '.data-api';\nconst EVENT_ACTIVATE = `activate${EVENT_KEY$2}`;\nconst EVENT_CLICK = `click${EVENT_KEY$2}`;\nconst EVENT_LOAD_DATA_API$1 = `load${EVENT_KEY$2}${DATA_API_KEY}`;\nconst CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item';\nconst CLASS_NAME_ACTIVE$1 = 'active';\nconst SELECTOR_DATA_SPY = '[data-bs-spy=\"scroll\"]';\nconst SELECTOR_TARGET_LINKS = '[href]';\nconst SELECTOR_NAV_LIST_GROUP = '.nav, .list-group';\nconst SELECTOR_NAV_LINKS = '.nav-link';\nconst SELECTOR_NAV_ITEMS = '.nav-item';\nconst SELECTOR_LIST_ITEMS = '.list-group-item';\nconst SELECTOR_LINK_ITEMS = `${SELECTOR_NAV_LINKS}, ${SELECTOR_NAV_ITEMS} > ${SELECTOR_NAV_LINKS}, ${SELECTOR_LIST_ITEMS}`;\nconst SELECTOR_DROPDOWN = '.dropdown';\nconst SELECTOR_DROPDOWN_TOGGLE$1 = '.dropdown-toggle';\nconst Default$1 = {\n offset: null,\n // TODO: v6 @deprecated, keep it for backwards compatibility reasons\n rootMargin: '0px 0px -25%',\n smoothScroll: false,\n target: null,\n threshold: [0.1, 0.5, 1]\n};\nconst DefaultType$1 = {\n offset: '(number|null)',\n // TODO v6 @deprecated, keep it for backwards compatibility reasons\n rootMargin: 'string',\n smoothScroll: 'boolean',\n target: 'element',\n threshold: 'array'\n};\n\n/**\n * Class definition\n */\n\nclass ScrollSpy extends BaseComponent {\n constructor(element, config) {\n super(element, config);\n\n // this._element is the observablesContainer and config.target the menu links wrapper\n this._targetLinks = new Map();\n this._observableSections = new Map();\n this._rootElement = getComputedStyle(this._element).overflowY === 'visible' ? null : this._element;\n this._activeTarget = null;\n this._observer = null;\n this._previousScrollData = {\n visibleEntryTop: 0,\n parentScrollTop: 0\n };\n this.refresh(); // initialize\n }\n\n // Getters\n static get Default() {\n return Default$1;\n }\n static get DefaultType() {\n return DefaultType$1;\n }\n static get NAME() {\n return NAME$2;\n }\n\n // Public\n refresh() {\n this._initializeTargetsAndObservables();\n this._maybeEnableSmoothScroll();\n if (this._observer) {\n this._observer.disconnect();\n } else {\n this._observer = this._getNewObserver();\n }\n for (const section of this._observableSections.values()) {\n this._observer.observe(section);\n }\n }\n dispose() {\n this._observer.disconnect();\n super.dispose();\n }\n\n // Private\n _configAfterMerge(config) {\n // TODO: on v6 target should be given explicitly & remove the {target: 'ss-target'} case\n config.target = getElement(config.target) || document.body;\n\n // TODO: v6 Only for backwards compatibility reasons. Use rootMargin only\n config.rootMargin = config.offset ? `${config.offset}px 0px -30%` : config.rootMargin;\n if (typeof config.threshold === 'string') {\n config.threshold = config.threshold.split(',').map(value => Number.parseFloat(value));\n }\n return config;\n }\n _maybeEnableSmoothScroll() {\n if (!this._config.smoothScroll) {\n return;\n }\n\n // unregister any previous listeners\n EventHandler.off(this._config.target, EVENT_CLICK);\n EventHandler.on(this._config.target, EVENT_CLICK, SELECTOR_TARGET_LINKS, event => {\n const observableSection = this._observableSections.get(event.target.hash);\n if (observableSection) {\n event.preventDefault();\n const root = this._rootElement || window;\n const height = observableSection.offsetTop - this._element.offsetTop;\n if (root.scrollTo) {\n root.scrollTo({\n top: height,\n behavior: 'smooth'\n });\n return;\n }\n\n // Chrome 60 doesn't support `scrollTo`\n root.scrollTop = height;\n }\n });\n }\n _getNewObserver() {\n const options = {\n root: this._rootElement,\n threshold: this._config.threshold,\n rootMargin: this._config.rootMargin\n };\n return new IntersectionObserver(entries => this._observerCallback(entries), options);\n }\n\n // The logic of selection\n _observerCallback(entries) {\n const targetElement = entry => this._targetLinks.get(`#${entry.target.id}`);\n const activate = entry => {\n this._previousScrollData.visibleEntryTop = entry.target.offsetTop;\n this._process(targetElement(entry));\n };\n const parentScrollTop = (this._rootElement || document.documentElement).scrollTop;\n const userScrollsDown = parentScrollTop >= this._previousScrollData.parentScrollTop;\n this._previousScrollData.parentScrollTop = parentScrollTop;\n for (const entry of entries) {\n if (!entry.isIntersecting) {\n this._activeTarget = null;\n this._clearActiveClass(targetElement(entry));\n continue;\n }\n const entryIsLowerThanPrevious = entry.target.offsetTop >= this._previousScrollData.visibleEntryTop;\n // if we are scrolling down, pick the bigger offsetTop\n if (userScrollsDown && entryIsLowerThanPrevious) {\n activate(entry);\n // if parent isn't scrolled, let's keep the first visible item, breaking the iteration\n if (!parentScrollTop) {\n return;\n }\n continue;\n }\n\n // if we are scrolling up, pick the smallest offsetTop\n if (!userScrollsDown && !entryIsLowerThanPrevious) {\n activate(entry);\n }\n }\n }\n _initializeTargetsAndObservables() {\n this._targetLinks = new Map();\n this._observableSections = new Map();\n const targetLinks = SelectorEngine.find(SELECTOR_TARGET_LINKS, this._config.target);\n for (const anchor of targetLinks) {\n // ensure that the anchor has an id and is not disabled\n if (!anchor.hash || isDisabled(anchor)) {\n continue;\n }\n const observableSection = SelectorEngine.findOne(decodeURI(anchor.hash), this._element);\n\n // ensure that the observableSection exists & is visible\n if (isVisible(observableSection)) {\n this._targetLinks.set(decodeURI(anchor.hash), anchor);\n this._observableSections.set(anchor.hash, observableSection);\n }\n }\n }\n _process(target) {\n if (this._activeTarget === target) {\n return;\n }\n this._clearActiveClass(this._config.target);\n this._activeTarget = target;\n target.classList.add(CLASS_NAME_ACTIVE$1);\n this._activateParents(target);\n EventHandler.trigger(this._element, EVENT_ACTIVATE, {\n relatedTarget: target\n });\n }\n _activateParents(target) {\n // Activate dropdown parents\n if (target.classList.contains(CLASS_NAME_DROPDOWN_ITEM)) {\n SelectorEngine.findOne(SELECTOR_DROPDOWN_TOGGLE$1, target.closest(SELECTOR_DROPDOWN)).classList.add(CLASS_NAME_ACTIVE$1);\n return;\n }\n for (const listGroup of SelectorEngine.parents(target, SELECTOR_NAV_LIST_GROUP)) {\n // Set triggered links parents as active\n // With both
    and