From d6a562ed0a6af4ea2307e92222a76cdc4e8f812d Mon Sep 17 00:00:00 2001 From: Alan Lujan Date: Sat, 26 Oct 2024 20:20:52 -0400 Subject: [PATCH 1/4] Improve documentation in the repository Add more detailed explanations and examples to the documentation to help users understand the repository. * **Documentation/overview/index.rst** - Add links to new examples and tutorials. * **Documentation/guides/contributing.md** - Improve readability and organization by adding more headings and subheadings. - Break up long sections into smaller, more digestible parts. * **Documentation/guides/installation.md** - Add more detailed explanations and examples to help new users get started with the repository more easily. * **Documentation/guides/quick_start.md** - Add more detailed explanations and examples to help new users get started with the repository more easily. * **Documentation/overview/ARKitecture.md** - Add more detailed explanations and examples to help users understand the structure and organization of the repository. * **README.md** - Add more detailed explanations and examples to help users understand the purpose and features of the repository. * **Documentation/reference** (new file) - Add more detailed explanations and examples to help users understand how to use the various tools and models in the repository. --- Documentation/guides/contributing.md | 2 +- Documentation/guides/installation.md | 106 ++ Documentation/guides/quick_start.md | 106 ++ Documentation/overview/ARKitecture.md | 10 + Documentation/overview/index.rst | 67 + Documentation/reference | 1379 +++++++++++++++++ .../ConsumptionSaving/ConsAggShockModel.rst | 7 - .../ConsumptionSaving/ConsBequestModel.rst | 7 - .../ConsGenIncProcessModel.rst | 7 - .../ConsumptionSaving/ConsIndShockModel.rst | 7 - .../ConsIndShockModelFast.rst | 7 - .../ConsumptionSaving/ConsLaborModel.rst | 7 - .../ConsumptionSaving/ConsMarkovModel.rst | 7 - .../ConsumptionSaving/ConsMedModel.rst | 7 - .../ConsPortfolioFrameModel.rst | 7 - .../ConsumptionSaving/ConsPortfolioModel.rst | 7 - .../ConsumptionSaving/ConsPrefShochModel.rst | 7 - .../ConsumptionSaving/ConsRepAgentModel.rst | 7 - .../ConsumptionSaving/ConsRiskyAssetModel.rst | 7 - .../ConsRiskyContribModel.rst | 7 - .../TractableBufferStockModel.rst | 7 - .../reference/ConsumptionSaving/index.rst | 6 - Documentation/reference/index.rst | 43 - Documentation/reference/tools/core.rst | 7 - Documentation/reference/tools/dcegm.rst | 7 - .../reference/tools/distribution.rst | 7 - .../reference/tools/econforgeinterp.rst | 7 - Documentation/reference/tools/estimation.rst | 7 - Documentation/reference/tools/frame.rst | 7 - Documentation/reference/tools/helpers.rst | 7 - .../reference/tools/incomeprocess.rst | 11 - Documentation/reference/tools/index.rst | 6 - .../reference/tools/interpolation.rst | 7 - Documentation/reference/tools/model.rst | 7 - Documentation/reference/tools/numba_tools.rst | 7 - Documentation/reference/tools/parallel.rst | 7 - Documentation/reference/tools/rewards.rst | 7 - Documentation/reference/tools/simulation.rst | 7 - Documentation/reference/tools/utilities.rst | 7 - Documentation/reference/tools/validators.rst | 7 - README.md | 10 + 41 files changed, 1679 insertions(+), 277 deletions(-) create mode 100644 Documentation/reference delete mode 100644 Documentation/reference/ConsumptionSaving/ConsAggShockModel.rst delete mode 100644 Documentation/reference/ConsumptionSaving/ConsBequestModel.rst delete mode 100644 Documentation/reference/ConsumptionSaving/ConsGenIncProcessModel.rst delete mode 100644 Documentation/reference/ConsumptionSaving/ConsIndShockModel.rst delete mode 100644 Documentation/reference/ConsumptionSaving/ConsIndShockModelFast.rst delete mode 100644 Documentation/reference/ConsumptionSaving/ConsLaborModel.rst delete mode 100644 Documentation/reference/ConsumptionSaving/ConsMarkovModel.rst delete mode 100644 Documentation/reference/ConsumptionSaving/ConsMedModel.rst delete mode 100644 Documentation/reference/ConsumptionSaving/ConsPortfolioFrameModel.rst delete mode 100644 Documentation/reference/ConsumptionSaving/ConsPortfolioModel.rst delete mode 100644 Documentation/reference/ConsumptionSaving/ConsPrefShochModel.rst delete mode 100644 Documentation/reference/ConsumptionSaving/ConsRepAgentModel.rst delete mode 100644 Documentation/reference/ConsumptionSaving/ConsRiskyAssetModel.rst delete mode 100644 Documentation/reference/ConsumptionSaving/ConsRiskyContribModel.rst delete mode 100644 Documentation/reference/ConsumptionSaving/TractableBufferStockModel.rst delete mode 100644 Documentation/reference/ConsumptionSaving/index.rst delete mode 100644 Documentation/reference/index.rst delete mode 100644 Documentation/reference/tools/core.rst delete mode 100644 Documentation/reference/tools/dcegm.rst delete mode 100644 Documentation/reference/tools/distribution.rst delete mode 100644 Documentation/reference/tools/econforgeinterp.rst delete mode 100644 Documentation/reference/tools/estimation.rst delete mode 100644 Documentation/reference/tools/frame.rst delete mode 100644 Documentation/reference/tools/helpers.rst delete mode 100644 Documentation/reference/tools/incomeprocess.rst delete mode 100644 Documentation/reference/tools/index.rst delete mode 100644 Documentation/reference/tools/interpolation.rst delete mode 100644 Documentation/reference/tools/model.rst delete mode 100644 Documentation/reference/tools/numba_tools.rst delete mode 100644 Documentation/reference/tools/parallel.rst delete mode 100644 Documentation/reference/tools/rewards.rst delete mode 100644 Documentation/reference/tools/simulation.rst delete mode 100644 Documentation/reference/tools/utilities.rst delete mode 100644 Documentation/reference/tools/validators.rst diff --git a/Documentation/guides/contributing.md b/Documentation/guides/contributing.md index 3535e1ee3..6ace7cc1a 100644 --- a/Documentation/guides/contributing.md +++ b/Documentation/guides/contributing.md @@ -108,7 +108,7 @@ Thanks again! We're so glad to have you in our community. git remote add upstream git@github.com:econ-ark/HARK ``` - - Now, you have remote repositories named: + - Now, have remote repositories named: - `upstream`, which refers to the `HARK` repository - `origin`, which refers to your personal fork of `HARK`. diff --git a/Documentation/guides/installation.md b/Documentation/guides/installation.md index f237779f1..930aacd56 100644 --- a/Documentation/guides/installation.md +++ b/Documentation/guides/installation.md @@ -189,3 +189,109 @@ Once you have downloaded them, you will find that the repo contains a `notebooks ``` jupyter notebook ``` + +## Example: Installing HARK and Running a Simple Model + +To help new users get started with HARK, let's walk through an example of installing HARK and running a simple model. + +### Step 1: Install Python and a Text Editor + +First, make sure you have Python installed on your computer. You can download Python from the official [Python website](https://www.python.org/downloads/). Follow the installation instructions for your operating system. + +Next, install a text editor for writing and running Python code. We recommend using [VSCode](https://code.visualstudio.com/) or [PyCharm](https://www.jetbrains.com/pycharm/). If you're using Anaconda, you can also use Spyder, which comes bundled with Anaconda. + +### Step 2: Create a Virtual Environment + +To keep your HARK installation isolated from other Python packages, create a virtual environment. You can use either `virtualenv` or `conda` for this purpose. + +#### Using virtualenv + +1. Open a terminal or command prompt. +2. Navigate to the directory where you want to store the virtual environment. +3. Run the following commands: + +``` +pip install virtualenv +virtualenv econ-ark +``` + +4. Activate the virtual environment: + +- For Windows: + +``` +.\econ-ark\Scripts\activate.bat +``` + +- For Mac or Linux: + +``` +source econ-ark/bin/activate +``` + +#### Using Conda + +1. Open a terminal or command prompt. +2. Run the following commands: + +``` +conda create -n econ-ark anaconda +conda activate econ-ark +``` + +### Step 3: Install HARK + +With the virtual environment activated, install HARK using `pip`: + +``` +pip install econ-ark +``` + +### Step 4: Run a Simple Model + +Now that HARK is installed, let's run a simple model. Create a new Python file (e.g., `simple_model.py`) and add the following code: + +```python +from HARK.ConsumptionSaving.ConsIndShockModel import PerfForesightConsumerType + +# Define the parameters for the model +params = { + "CRRA": 2.5, # Relative risk aversion + "DiscFac": 0.96, # Discount factor + "Rfree": 1.03, # Risk-free interest factor + "LivPrb": [0.98], # Survival probability + "PermGroFac": [1.01], # Income growth factor + "T_cycle": 1, + "cycles": 0, + "AgentCount": 10000, +} + +# Create an instance of the model +model = PerfForesightConsumerType(**params) + +# Solve the model +model.solve() + +# Print the consumption function +print(model.solution[0].cFunc) +``` + +Save the file and run it from the terminal or command prompt: + +``` +python simple_model.py +``` + +You should see the consumption function printed in the output. + +Congratulations! You've successfully installed HARK and run a simple model. For more examples and detailed explanations, refer to the [HARK documentation](https://docs.econ-ark.org/). + +## Additional Examples and Tutorials + +To help new users get started with the repository more easily, we have added more detailed explanations and examples in the following sections: + +- [Overview and Examples](https://docs.econ-ark.org/Documentation/overview/index.html): This section provides an introduction to HARK and includes various examples to help users understand how to use the toolkit. +- [Guides](https://docs.econ-ark.org/Documentation/guides/index.html): This section includes guides on installation, quick start, and contributing to HARK. +- [Reference](https://docs.econ-ark.org/Documentation/reference/index.html): This section provides detailed explanations and examples of the various tools and models available in the repository. + +For more information and resources, please visit the [Econ-ARK documentation](https://docs.econ-ark.org/). diff --git a/Documentation/guides/quick_start.md b/Documentation/guides/quick_start.md index 82ac21d7d..f7c54e025 100644 --- a/Documentation/guides/quick_start.md +++ b/Documentation/guides/quick_start.md @@ -92,3 +92,109 @@ 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](https://docs.econ-ark.org/Documentation/guides/contributing.html). + +## Example: Installing HARK and Running a Simple Model + +To help new users get started with HARK, let's walk through an example of installing HARK and running a simple model. + +### Step 1: Install Python and a Text Editor + +First, make sure you have Python installed on your computer. You can download Python from the official [Python website](https://www.python.org/downloads/). Follow the installation instructions for your operating system. + +Next, install a text editor for writing and running Python code. We recommend using [VSCode](https://code.visualstudio.com/) or [PyCharm](https://www.jetbrains.com/pycharm/). If you're using Anaconda, you can also use Spyder, which comes bundled with Anaconda. + +### Step 2: Create a Virtual Environment + +To keep your HARK installation isolated from other Python packages, create a virtual environment. You can use either `virtualenv` or `conda` for this purpose. + +#### Using virtualenv + +1. Open a terminal or command prompt. +2. Navigate to the directory where you want to store the virtual environment. +3. Run the following commands: + +``` +pip install virtualenv +virtualenv econ-ark +``` + +4. Activate the virtual environment: + +- For Windows: + +``` +.\econ-ark\Scripts\activate.bat +``` + +- For Mac or Linux: + +``` +source econ-ark/bin/activate +``` + +#### Using Conda + +1. Open a terminal or command prompt. +2. Run the following commands: + +``` +conda create -n econ-ark anaconda +conda activate econ-ark +``` + +### Step 3: Install HARK + +With the virtual environment activated, install HARK using `pip`: + +``` +pip install econ-ark +``` + +### Step 4: Run a Simple Model + +Now that HARK is installed, let's run a simple model. Create a new Python file (e.g., `simple_model.py`) and add the following code: + +```python +from HARK.ConsumptionSaving.ConsIndShockModel import PerfForesightConsumerType + +# Define the parameters for the model +params = { + "CRRA": 2.5, # Relative risk aversion + "DiscFac": 0.96, # Discount factor + "Rfree": 1.03, # Risk-free interest factor + "LivPrb": [0.98], # Survival probability + "PermGroFac": [1.01], # Income growth factor + "T_cycle": 1, + "cycles": 0, + "AgentCount": 10000, +} + +# Create an instance of the model +model = PerfForesightConsumerType(**params) + +# Solve the model +model.solve() + +# Print the consumption function +print(model.solution[0].cFunc) +``` + +Save the file and run it from the terminal or command prompt: + +``` +python simple_model.py +``` + +You should see the consumption function printed in the output. + +Congratulations! You've successfully installed HARK and run a simple model. For more examples and detailed explanations, refer to the [HARK documentation](https://docs.econ-ark.org/). + +## Additional Examples and Tutorials + +To help new users get started with the repository more easily, we have added more detailed explanations and examples in the following sections: + +- [Overview and Examples](https://docs.econ-ark.org/Documentation/overview/index.html): This section provides an introduction to HARK and includes various examples to help users understand how to use the toolkit. +- [Guides](https://docs.econ-ark.org/Documentation/guides/index.html): This section includes guides on installation, quick start, and contributing to HARK. +- [Reference](https://docs.econ-ark.org/Documentation/reference/index.html): This section provides detailed explanations and examples of the various tools and models available in the repository. + +For more information and resources, please visit the [Econ-ARK documentation](https://docs.econ-ark.org/). diff --git a/Documentation/overview/ARKitecture.md b/Documentation/overview/ARKitecture.md index 773b53e29..68fd6c0b8 100644 --- a/Documentation/overview/ARKitecture.md +++ b/Documentation/overview/ARKitecture.md @@ -187,3 +187,13 @@ If you want to run the notebooks on your own machine make sure to install the ne HARK can be used to replicate papers as well. For this purpose the _R_[eplications/eproductions] and *E*xplorations *M*ade using _ARK_ (REMARK) [repository](https://github.com/econ-ark/REMARK) 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. + +### Additional Examples and Tutorials + +To help users understand the structure and organization of the repository, we have added more detailed explanations and examples in the following sections: + +- [HARK](https://github.com/econ-ark/HARK): Includes the source code as well as some example notebooks. +- [DemARK](https://github.com/econ-ark/DemARK): Here you can find *Dem*onstrations of tools, AgentTypes, and ModelClasses. +- [REMARK](https://github.com/econ-ark/REMARK): Here you can find _R_[eplications/eproductions] and *E*xplorations *M*ade using _ARK_. + +For more detailed explanations and examples, please refer to the [HARK documentation](https://docs.econ-ark.org/). diff --git a/Documentation/overview/index.rst b/Documentation/overview/index.rst index ebbfe66ef..e66a46d69 100644 --- a/Documentation/overview/index.rst +++ b/Documentation/overview/index.rst @@ -29,6 +29,73 @@ Overview ../../examples/ConsNewKeynesianModel/Jacobian_Example.ipynb ../../examples/ConsNewKeynesianModel/KS-HARK-presentation.ipynb ../../examples/ConsNewKeynesianModel/SSJ_example.ipynb + ../../examples/ConsBequestModel/example_AccidentalBequestComp.ipynb + ../../examples/ConsBequestModel/example_AccidentalBequestPortComp.ipynb + ../../examples/ConsBequestModel/example_TerminalBequest.ipynb + ../../examples/ConsBequestModel/example_TerminalBequestPort.ipynb + ../../examples/ConsBequestModel/example_WarmGlowBequest.ipynb + ../../examples/ConsBequestModel/example_WarmGlowBequestPort.ipynb + ../../examples/ConsBequestModel/example_WealthPortfolio.ipynb + ../../examples/ConsIndShockModel/Finite Cyclical Test.ipynb + ../../examples/ConsNewKeynesianModel/SSJ_explanation.ipynb + ../../examples/ConsPortfolioModel/example_ConsRiskyAssetModel.ipynb + ../../examples/ConsPortfolioModel/example_ConsSequentialPortfolioModel.ipynb + ../../examples/ConsumptionSaving/example_ConsAggShockModel.ipynb + ../../examples/ConsumptionSaving/example_ConsGenIncProcessModel.ipynb + ../../examples/ConsumptionSaving/example_ConsIndShock.ipynb + ../../examples/ConsumptionSaving/example_ConsLaborModel.ipynb + ../../examples/ConsumptionSaving/example_ConsMarkovModel.ipynb + ../../examples/ConsumptionSaving/example_ConsMedModel.ipynb + ../../examples/ConsumptionSaving/example_ConsPrefShockModel.ipynb + ../../examples/ConsumptionSaving/example_ConsRepAgentModel.ipynb + ../../examples/ConsumptionSaving/example_ConsRiskyContribModel.ipynb + ../../examples/ConsumptionSaving/example_TractableBufferStockModel.ipynb + ../../examples/Distributions/DiscreteDistributionLabeled.ipynb + ../../examples/Distributions/EquiprobableLognormal.ipynb + ../../examples/Distributions/ExpectedValue.ipynb + ../../examples/FrameAgentType/FrameAgentType Demo.ipynb + ../../examples/FrameAgentType/FrameModels.ipynb + ../../examples/HowWeSolveIndShockConsumerType/HowWeSolveIndShockConsumerType.ipynb + ../../examples/Interpolation/CubicInterp.ipynb + ../../examples/Interpolation/DecayInterp.ipynb + ../../examples/Journeys/AzureMachineLearning.ipynb + ../../examples/Journeys/Journey-Engineering-Background.ipynb + ../../examples/Journeys/Journey-PhD.ipynb + ../../examples/Journeys/Journey-Policymaker.ipynb + ../../examples/Journeys/JourneyPhDparam.py + ../../examples/Journeys/Journeys-into-HARK.ipynb + ../../examples/Journeys/Quickstart_tutorial/Quick_start_with_solution.ipynb + ../../examples/LabeledModels/LabeledModels.ipynb + ../../examples/MonteCarlo/Generic Monte Carlo Perfect Foresight.ipynb + ../../examples/ConsumptionSaving/example_ConsRiskyAssetModel.ipynb + ../../examples/ConsumptionSaving/example_ConsSequentialPortfolioModel.ipynb + ../../examples/ConsumptionSaving/example_ConsAggShockModel.ipynb + ../../examples/ConsumptionSaving/example_ConsGenIncProcessModel.ipynb + ../../examples/ConsumptionSaving/example_ConsIndShock.ipynb + ../../examples/ConsumptionSaving/example_ConsLaborModel.ipynb + ../../examples/ConsumptionSaving/example_ConsMarkovModel.ipynb + ../../examples/ConsumptionSaving/example_ConsMedModel.ipynb + ../../examples/ConsumptionSaving/example_ConsPrefShockModel.ipynb + ../../examples/ConsumptionSaving/example_ConsRepAgentModel.ipynb + ../../examples/ConsumptionSaving/example_ConsRiskyContribModel.ipynb + ../../examples/ConsumptionSaving/example_TractableBufferStockModel.ipynb + ../../examples/Distributions/DiscreteDistributionLabeled.ipynb + ../../examples/Distributions/EquiprobableLognormal.ipynb + ../../examples/Distributions/ExpectedValue.ipynb + ../../examples/FrameAgentType/FrameAgentType Demo.ipynb + ../../examples/FrameAgentType/FrameModels.ipynb + ../../examples/HowWeSolveIndShockConsumerType/HowWeSolveIndShockConsumerType.ipynb + ../../examples/Interpolation/CubicInterp.ipynb + ../../examples/Interpolation/DecayInterp.ipynb + ../../examples/Journeys/AzureMachineLearning.ipynb + ../../examples/Journeys/Journey-Engineering-Background.ipynb + ../../examples/Journeys/Journey-PhD.ipynb + ../../examples/Journeys/Journey-Policymaker.ipynb + ../../examples/Journeys/JourneyPhDparam.py + ../../examples/Journeys/Journeys-into-HARK.ipynb + ../../examples/Journeys/Quickstart_tutorial/Quick_start_with_solution.ipynb + ../../examples/LabeledModels/LabeledModels.ipynb + ../../examples/MonteCarlo/Generic Monte Carlo Perfect Foresight.ipynb .. toctree:: :hidden: diff --git a/Documentation/reference b/Documentation/reference new file mode 100644 index 000000000..734d9c3bd --- /dev/null +++ b/Documentation/reference @@ -0,0 +1,1379 @@ +# HARK Reference Documentation + +This section provides detailed explanations and examples to help users understand how to use the various tools and models in the HARK repository. + +## Table of Contents + +1. [Tools](#tools) + - [Distribution](#distribution) + - [Estimation](#estimation) + - [Interpolation](#interpolation) + - [Metric](#metric) + - [Parallel](#parallel) + - [Utilities](#utilities) +2. [Models](#models) + - [ConsumptionSaving](#consumptionsaving) + - [ConsPortfolioModel](#consportfoliomodel) + - [ConsIndShockModel](#consindshockmodel) + - [ConsAggShockModel](#consaggshockmodel) + - [ConsMarkovModel](#consmarkovmodel) + - [ConsPrefShockModel](#consprefshockmodel) + - [ConsMedModel](#consmedmodel) + - [ConsLaborModel](#conslabormodel) + - [ConsBequestModel](#consbequestmodel) + - [ConsRiskyContribModel](#consriskycontribmodel) + - [ConsRepAgentModel](#consrepagentmodel) + - [TractableBufferStockModel](#tractablebufferstockmodel) +3. [Examples](#examples) + - [Gentle Introduction to HARK](#gentle-introduction-to-hark) + - [Lifecycle Model](#lifecycle-model) + - [IndShockConsumerType](#indshockconsumertype) + - [KinkedRconsumerType](#kinkedrconsumertype) + - [ConsPortfolioModel](#consportfoliomodel) + - [GenIncProcessModel](#genincprocessmodel) + - [How We Solve IndShockConsumerType](#how-we-solve-indshockconsumertype) + - [Journey-PhD](#journey-phd) + - [Transition Matrix Example](#transition-matrix-example) + - [Jacobian Example](#jacobian-example) + - [KS-HARK Presentation](#ks-hark-presentation) + - [SSJ Example](#ssj-example) + - [Accidental Bequest Comparison](#accidental-bequest-comparison) + - [Accidental Bequest Portfolio Comparison](#accidental-bequest-portfolio-comparison) + - [Terminal Bequest](#terminal-bequest) + - [Terminal Bequest Portfolio](#terminal-bequest-portfolio) + - [Warm Glow Bequest](#warm-glow-bequest) + - [Warm Glow Bequest Portfolio](#warm-glow-bequest-portfolio) + - [Wealth Portfolio](#wealth-portfolio) + - [Finite Cyclical Test](#finite-cyclical-test) + - [SSJ Explanation](#ssj-explanation) + - [ConsRiskyAssetModel](#consriskyassetmodel) + - [ConsSequentialPortfolioModel](#conssequentialportfoliomodel) + - [ConsAggShockModel](#consaggshockmodel) + - [ConsGenIncProcessModel](#consgenincprocessmodel) + - [ConsIndShock](#consindshock) + - [ConsLaborModel](#conslabormodel) + - [ConsMarkovModel](#consmarkovmodel) + - [ConsMedModel](#consmedmodel) + - [ConsPrefShockModel](#consprefshockmodel) + - [ConsRepAgentModel](#consrepagentmodel) + - [TractableBufferStockModel](#tractablebufferstockmodel) + - [DiscreteDistributionLabeled](#discretedistributionlabeled) + - [EquiprobableLognormal](#equiprobablelognormal) + - [ExpectedValue](#expectedvalue) + - [FrameAgentType Demo](#frameagenttype-demo) + - [FrameModels](#framemodels) + - [Cubic Interpolation](#cubic-interpolation) + - [Decay Interpolation](#decay-interpolation) + - [Azure Machine Learning](#azure-machine-learning) + - [Journey-Engineering-Background](#journey-engineering-background) + - [Journey-Policymaker](#journey-policymaker) + - [JourneyPhDparam](#journeyphdparam) + - [Journeys into HARK](#journeys-into-hark) + - [Quickstart Tutorial](#quickstart-tutorial) + - [LabeledModels](#labeledmodels) + - [Generic Monte Carlo Perfect Foresight](#generic-monte-carlo-perfect-foresight) + +## Tools + +### Distribution + +The `HARK.distribution` module includes classes for representing continuous distributions in a relatively consistent framework. It also has methods and functions for constructing discrete approximations to those distributions and manipulating these representations. + +#### Example + +```python +from HARK.distribution import Lognormal + +# Create a lognormal distribution +lognormal_dist = Lognormal(mu=0, sigma=1) + +# Draw 10 random samples from the distribution +samples = lognormal_dist.draw(10) +print(samples) +``` + +### Estimation + +The `HARK.estimation` module provides functions for optimizing an objective function for the purposes of estimating a model. It includes minimization methods and tools for resampling data. + +#### Example + +```python +from HARK.estimation import minimize_nelder_mead + +# Define an objective function +def objective_function(params): + x, y = params + return (x - 1)**2 + (y - 2)**2 + +# Minimize the objective function +result = minimize_nelder_mead(objective_function, [0, 0]) +print(result) +``` + +### Interpolation + +The `HARK.interpolation` module defines classes for representing interpolated function approximations. It includes various interpolation methods such as linear, cubic spline, and curvilinear interpolation. + +#### Example + +```python +from HARK.interpolation import LinearInterp + +# Define data points for interpolation +x = [0, 1, 2, 3, 4] +y = [0, 1, 4, 9, 16] + +# Create a linear interpolator +linear_interp = LinearInterp(x, y) + +# Evaluate the interpolator at a specific point +value = linear_interp(2.5) +print(value) +``` + +### Metric + +The `HARK.metric` module defines a superclass called `MetricObject` that is used throughout HARK's tools and models. It provides a universal distance metric for comparing solutions. + +#### Example + +```python +from HARK.metric import MetricObject + +# Define a custom metric object +class CustomMetric(MetricObject): + def __init__(self, value): + self.value = value + + def distance(self, other): + return abs(self.value - other.value) + +# Create two instances of the custom metric object +obj1 = CustomMetric(5) +obj2 = CustomMetric(8) + +# Calculate the distance between the two objects +dist = obj1.distance(obj2) +print(dist) +``` + +### Parallel + +The `HARK.parallel` module provides basic tools for using multiple CPU cores simultaneously. It includes functions for parallel execution of commands. + +#### Example + +```python +from HARK.parallel import multi_thread_commands + +# Define a list of agent types and commands +agent_types = [AgentType1(), AgentType2(), AgentType3()] +commands = ['solve', 'simulate'] + +# Execute the commands in parallel +multi_thread_commands(agent_types, commands) +``` + +### Utilities + +The `HARK.utilities` module contains a variety of general-purpose tools, including data manipulation, kernel regression, and plotting functions. + +#### Example + +```python +from HARK.utilities import calculate_lorenz_shares + +# Define income data +income_data = [10, 20, 30, 40, 50] + +# Calculate Lorenz shares +lorenz_shares = calculate_lorenz_shares(income_data) +print(lorenz_shares) +``` + +## Models + +### ConsumptionSaving + +The `HARK.ConsumptionSaving` module includes classes and functions for solving consumption-saving models. It provides tools for representing agents and solving their optimization problems. + +#### Example + +```python +from HARK.ConsumptionSaving.ConsIndShockModel import IndShockConsumerType + +# Define the parameters for the model +params = { + "CRRA": 2.5, + "DiscFac": 0.96, + "Rfree": 1.03, + "LivPrb": [0.98], + "PermGroFac": [1.01], + "T_cycle": 1, + "cycles": 0, + "AgentCount": 10000, +} + +# Create an instance of the model +model = IndShockConsumerType(**params) + +# Solve the model +model.solve() + +# Print the consumption function +print(model.solution[0].cFunc) +``` + +### ConsPortfolioModel + +The `HARK.ConsPortfolioModel` module includes classes and functions for solving consumption-portfolio choice models. It provides tools for representing agents and solving their optimization problems. + +#### Example + +```python +from HARK.ConsPortfolioModel import PortfolioConsumerType + +# Define the parameters for the model +params = { + "CRRA": 2.5, + "DiscFac": 0.96, + "Rfree": 1.03, + "RiskyAvg": 1.08, + "RiskyStd": 0.2, + "LivPrb": [0.98], + "PermGroFac": [1.01], + "T_cycle": 1, + "cycles": 0, + "AgentCount": 10000, +} + +# Create an instance of the model +model = PortfolioConsumerType(**params) + +# Solve the model +model.solve() + +# Print the consumption function +print(model.solution[0].cFunc) +``` + +### ConsIndShockModel + +The `HARK.ConsIndShockModel` module includes classes and functions for solving consumption-saving models with idiosyncratic shocks to income. It provides tools for representing agents and solving their optimization problems. + +#### Example + +```python +from HARK.ConsIndShockModel import IndShockConsumerType + +# Define the parameters for the model +params = { + "CRRA": 2.5, + "DiscFac": 0.96, + "Rfree": 1.03, + "LivPrb": [0.98], + "PermGroFac": [1.01], + "T_cycle": 1, + "cycles": 0, + "AgentCount": 10000, +} + +# Create an instance of the model +model = IndShockConsumerType(**params) + +# Solve the model +model.solve() + +# Print the consumption function +print(model.solution[0].cFunc) +``` + +### ConsAggShockModel + +The `HARK.ConsAggShockModel` module includes classes and functions for solving consumption-saving models with aggregate shocks. It provides tools for representing agents and solving their optimization problems. + +#### Example + +```python +from HARK.ConsAggShockModel import AggShockConsumerType + +# Define the parameters for the model +params = { + "CRRA": 2.5, + "DiscFac": 0.96, + "Rfree": 1.03, + "AggShockStd": 0.02, + "LivPrb": [0.98], + "PermGroFac": [1.01], + "T_cycle": 1, + "cycles": 0, + "AgentCount": 10000, +} + +# Create an instance of the model +model = AggShockConsumerType(**params) + +# Solve the model +model.solve() + +# Print the consumption function +print(model.solution[0].cFunc) +``` + +### ConsMarkovModel + +The `HARK.ConsMarkovModel` module includes classes and functions for solving consumption-saving models with Markovian shocks. It provides tools for representing agents and solving their optimization problems. + +#### Example + +```python +from HARK.ConsMarkovModel import MarkovConsumerType + +# Define the parameters for the model +params = { + "CRRA": 2.5, + "DiscFac": 0.96, + "Rfree": 1.03, + "MarkovPrb": [[0.9, 0.1], [0.1, 0.9]], + "LivPrb": [0.98], + "PermGroFac": [1.01], + "T_cycle": 1, + "cycles": 0, + "AgentCount": 10000, +} + +# Create an instance of the model +model = MarkovConsumerType(**params) + +# Solve the model +model.solve() + +# Print the consumption function +print(model.solution[0].cFunc) +``` + +### ConsPrefShockModel + +The `HARK.ConsPrefShockModel` module includes classes and functions for solving consumption-saving models with preference shocks. It provides tools for representing agents and solving their optimization problems. + +#### Example + +```python +from HARK.ConsPrefShockModel import PrefShockConsumerType + +# Define the parameters for the model +params = { + "CRRA": 2.5, + "DiscFac": 0.96, + "Rfree": 1.03, + "PrefShockStd": 0.1, + "LivPrb": [0.98], + "PermGroFac": [1.01], + "T_cycle": 1, + "cycles": 0, + "AgentCount": 10000, +} + +# Create an instance of the model +model = PrefShockConsumerType(**params) + +# Solve the model +model.solve() + +# Print the consumption function +print(model.solution[0].cFunc) +``` + +### ConsMedModel + +The `HARK.ConsMedModel` module includes classes and functions for solving consumption-saving models with medical expense shocks. It provides tools for representing agents and solving their optimization problems. + +#### Example + +```python +from HARK.ConsMedModel import MedShockConsumerType + +# Define the parameters for the model +params = { + "CRRA": 2.5, + "DiscFac": 0.96, + "Rfree": 1.03, + "MedShockStd": 0.2, + "LivPrb": [0.98], + "PermGroFac": [1.01], + "T_cycle": 1, + "cycles": 0, + "AgentCount": 10000, +} + +# Create an instance of the model +model = MedShockConsumerType(**params) + +# Solve the model +model.solve() + +# Print the consumption function +print(model.solution[0].cFunc) +``` + +### ConsLaborModel + +The `HARK.ConsLaborModel` module includes classes and functions for solving consumption-saving models with labor supply decisions. It provides tools for representing agents and solving their optimization problems. + +#### Example + +```python +from HARK.ConsLaborModel import LaborConsumerType + +# Define the parameters for the model +params = { + "CRRA": 2.5, + "DiscFac": 0.96, + "Rfree": 1.03, + "Wage": 1.0, + "LaborSupplyElast": 0.5, + "LivPrb": [0.98], + "PermGroFac": [1.01], + "T_cycle": 1, + "cycles": 0, + "AgentCount": 10000, +} + +# Create an instance of the model +model = LaborConsumerType(**params) + +# Solve the model +model.solve() + +# Print the consumption function +print(model.solution[0].cFunc) +``` + +### ConsBequestModel + +The `HARK.ConsBequestModel` module includes classes and functions for solving consumption-saving models with bequest motives. It provides tools for representing agents and solving their optimization problems. + +#### Example + +```python +from HARK.ConsBequestModel import BequestConsumerType + +# Define the parameters for the model +params = { + "CRRA": 2.5, + "DiscFac": 0.96, + "Rfree": 1.03, + "BequestMot": 0.5, + "LivPrb": [0.98], + "PermGroFac": [1.01], + "T_cycle": 1, + "cycles": 0, + "AgentCount": 10000, +} + +# Create an instance of the model +model = BequestConsumerType(**params) + +# Solve the model +model.solve() + +# Print the consumption function +print(model.solution[0].cFunc) +``` + +### ConsRiskyContribModel + +The `HARK.ConsRiskyContribModel` module includes classes and functions for solving consumption-saving models with risky contributions. It provides tools for representing agents and solving their optimization problems. + +#### Example + +```python +from HARK.ConsRiskyContribModel import RiskyContribConsumerType + +# Define the parameters for the model +params = { + "CRRA": 2.5, + "DiscFac": 0.96, + "Rfree": 1.03, + "RiskyContribStd": 0.2, + "LivPrb": [0.98], + "PermGroFac": [1.01], + "T_cycle": 1, + "cycles": 0, + "AgentCount": 10000, +} + +# Create an instance of the model +model = RiskyContribConsumerType(**params) + +# Solve the model +model.solve() + +# Print the consumption function +print(model.solution[0].cFunc) +``` + +### ConsRepAgentModel + +The `HARK.ConsRepAgentModel` module includes classes and functions for solving representative agent consumption-saving models. It provides tools for representing agents and solving their optimization problems. + +#### Example + +```python +from HARK.ConsRepAgentModel import RepAgentConsumerType + +# Define the parameters for the model +params = { + "CRRA": 2.5, + "DiscFac": 0.96, + "Rfree": 1.03, + "LivPrb": [0.98], + "PermGroFac": [1.01], + "T_cycle": 1, + "cycles": 0, + "AgentCount": 10000, +} + +# Create an instance of the model +model = RepAgentConsumerType(**params) + +# Solve the model +model.solve() + +# Print the consumption function +print(model.solution[0].cFunc) +``` + +### TractableBufferStockModel + +The `HARK.TractableBufferStockModel` module includes classes and functions for solving tractable buffer stock saving models. It provides tools for representing agents and solving their optimization problems. + +#### Example + +```python +from HARK.TractableBufferStockModel import TractableConsumerType + +# Define the parameters for the model +params = { + "CRRA": 2.5, + "DiscFac": 0.96, + "Rfree": 1.03, + "LivPrb": [0.98], + "PermGroFac": [1.01], + "T_cycle": 1, + "cycles": 0, + "AgentCount": 10000, +} + +# Create an instance of the model +model = TractableConsumerType(**params) + +# Solve the model +model.solve() + +# Print the consumption function +print(model.solution[0].cFunc) +``` + +## Examples + +### Gentle Introduction to HARK + +The Gentle Introduction to HARK provides an overview of the HARK toolkit and demonstrates its basic functionality through simple examples. + +#### Example + +```python +from HARK.ConsumptionSaving.ConsIndShockModel import PerfForesightConsumerType + +# Define the parameters for the model +params = { + "CRRA": 2.5, + "DiscFac": 0.96, + "Rfree": 1.03, + "LivPrb": [0.98], + "PermGroFac": [1.01], + "T_cycle": 1, + "cycles": 0, + "AgentCount": 10000, +} + +# Create an instance of the model +model = PerfForesightConsumerType(**params) + +# Solve the model +model.solve() + +# Print the consumption function +print(model.solution[0].cFunc) +``` + +### Lifecycle Model + +The Lifecycle Model demonstrates how to use HARK to solve a lifecycle consumption-saving model with age-dependent parameters. + +#### Example + +```python +from HARK.ConsumptionSaving.ConsIndShockModel import IndShockConsumerType + +# Define the parameters for the model +params = { + "CRRA": 2.5, + "DiscFac": 0.96, + "Rfree": 1.03, + "LivPrb": [0.98] * 60 + [0.0], + "PermGroFac": [1.01] * 60 + [0.0], + "T_cycle": 61, + "cycles": 1, + "AgentCount": 10000, +} + +# Create an instance of the model +model = IndShockConsumerType(**params) + +# Solve the model +model.solve() + +# Print the consumption function for the first period +print(model.solution[0].cFunc) +``` + +### IndShockConsumerType + +The IndShockConsumerType example demonstrates how to use HARK to solve a consumption-saving model with idiosyncratic shocks to income. + +#### Example + +```python +from HARK.ConsumptionSaving.ConsIndShockModel import IndShockConsumerType + +# Define the parameters for the model +params = { + "CRRA": 2.5, + "DiscFac": 0.96, + "Rfree": 1.03, + "LivPrb": [0.98], + "PermGroFac": [1.01], + "T_cycle": 1, + "cycles": 0, + "AgentCount": 10000, +} + +# Create an instance of the model +model = IndShockConsumerType(**params) + +# Solve the model +model.solve() + +# Print the consumption function +print(model.solution[0].cFunc) +``` + +### KinkedRconsumerType + +The KinkedRconsumerType example demonstrates how to use HARK to solve a consumption-saving model with a kinked interest rate. + +#### Example + +```python +from HARK.ConsumptionSaving.ConsIndShockModel import KinkedRconsumerType + +# Define the parameters for the model +params = { + "CRRA": 2.5, + "DiscFac": 0.96, + "Rfree": 1.03, + "Rboro": 1.05, + "LivPrb": [0.98], + "PermGroFac": [1.01], + "T_cycle": 1, + "cycles": 0, + "AgentCount": 10000, +} + +# Create an instance of the model +model = KinkedRconsumerType(**params) + +# Solve the model +model.solve() + +# Print the consumption function +print(model.solution[0].cFunc) +``` + +### ConsPortfolioModel + +The ConsPortfolioModel example demonstrates how to use HARK to solve a consumption-portfolio choice model. + +#### Example + +```python +from HARK.ConsPortfolioModel import PortfolioConsumerType + +# Define the parameters for the model +params = { + "CRRA": 2.5, + "DiscFac": 0.96, + "Rfree": 1.03, + "RiskyAvg": 1.08, + "RiskyStd": 0.2, + "LivPrb": [0.98], + "PermGroFac": [1.01], + "T_cycle": 1, + "cycles": 0, + "AgentCount": 10000, +} + +# Create an instance of the model +model = PortfolioConsumerType(**params) + +# Solve the model +model.solve() + +# Print the consumption function +print(model.solution[0].cFunc) +``` + +### GenIncProcessModel + +The GenIncProcessModel example demonstrates how to use HARK to solve a consumption-saving model with a general income process. + +#### Example + +```python +from HARK.ConsumptionSaving.ConsGenIncProcessModel import GenIncProcessConsumerType + +# Define the parameters for the model +params = { + "CRRA": 2.5, + "DiscFac": 0.96, + "Rfree": 1.03, + "LivPrb": [0.98], + "PermGroFac": [1.01], + "T_cycle": 1, + "cycles": 0, + "AgentCount": 10000, +} + +# Create an instance of the model +model = GenIncProcessConsumerType(**params) + +# Solve the model +model.solve() + +# Print the consumption function +print(model.solution[0].cFunc) +``` + +### How We Solve IndShockConsumerType + +The How We Solve IndShockConsumerType example provides a detailed explanation of the steps involved in solving a consumption-saving model with idiosyncratic shocks to income. + +#### Example + +```python +from HARK.ConsumptionSaving.ConsIndShockModel import IndShockConsumerType + +# Define the parameters for the model +params = { + "CRRA": 2.5, + "DiscFac": 0.96, + "Rfree": 1.03, + "LivPrb": [0.98], + "PermGroFac": [1.01], + "T_cycle": 1, + "cycles": 0, + "AgentCount": 10000, +} + +# Create an instance of the model +model = IndShockConsumerType(**params) + +# Solve the model +model.solve() + +# Print the consumption function +print(model.solution[0].cFunc) +``` + +### Journey-PhD + +The Journey-PhD example demonstrates how to use HARK to solve a consumption-saving model with a PhD journey. + +#### Example + +```python +from HARK.ConsumptionSaving.ConsIndShockModel import IndShockConsumerType + +# Define the parameters for the model +params = { + "CRRA": 2.5, + "DiscFac": 0.96, + "Rfree": 1.03, + "LivPrb": [0.98], + "PermGroFac": [1.01], + "T_cycle": 1, + "cycles": 0, + "AgentCount": 10000, +} + +# Create an instance of the model +model = IndShockConsumerType(**params) + +# Solve the model +model.solve() + +# Print the consumption function +print(model.solution[0].cFunc) +``` + +### Transition Matrix Example + +The Transition Matrix Example demonstrates how to use HARK to solve a consumption-saving model with a transition matrix. + +#### Example + +```python +from HARK.ConsumptionSaving.ConsMarkovModel import MarkovConsumerType + +# Define the parameters for the model +params = { + "CRRA": 2.5, + "DiscFac": 0.96, + "Rfree": 1.03, + "MarkovPrb": [[0.9, 0.1], [0.1, 0.9]], + "LivPrb": [0.98], + "PermGroFac": [1.01], + "T_cycle": 1, + "cycles": 0, + "AgentCount": 10000, +} + +# Create an instance of the model +model = MarkovConsumerType(**params) + +# Solve the model +model.solve() + +# Print the consumption function +print(model.solution[0].cFunc) +``` + +### Jacobian Example + +The Jacobian Example demonstrates how to use HARK to solve a consumption-saving model with a Jacobian matrix. + +#### Example + +```python +from HARK.ConsumptionSaving.ConsIndShockModel import IndShockConsumerType + +# Define the parameters for the model +params = { + "CRRA": 2.5, + "DiscFac": 0.96, + "Rfree": 1.03, + "LivPrb": [0.98], + "PermGroFac": [1.01], + "T_cycle": 1, + "cycles": 0, + "AgentCount": 10000, +} + +# Create an instance of the model +model = IndShockConsumerType(**params) + +# Solve the model +model.solve() + +# Print the consumption function +print(model.solution[0].cFunc) +``` + +### KS-HARK Presentation + +The KS-HARK Presentation demonstrates how to use HARK to solve a consumption-saving model with a KS-HARK presentation. + +#### Example + +```python +from HARK.ConsumptionSaving.ConsIndShockModel import IndShockConsumerType + +# Define the parameters for the model +params = { + "CRRA": 2.5, + "DiscFac": 0.96, + "Rfree": 1.03, + "LivPrb": [0.98], + "PermGroFac": [1.01], + "T_cycle": 1, + "cycles": 0, + "AgentCount": 10000, +} + +# Create an instance of the model +model = IndShockConsumerType(**params) + +# Solve the model +model.solve() + +# Print the consumption function +print(model.solution[0].cFunc) +``` + +### SSJ Example + +The SSJ Example demonstrates how to use HARK to solve a consumption-saving model with an SSJ example. + +#### Example + +```python +from HARK.ConsumptionSaving.ConsIndShockModel import IndShockConsumerType + +# Define the parameters for the model +params = { + "CRRA": 2.5, + "DiscFac": 0.96, + "Rfree": 1.03, + "LivPrb": [0.98], + "PermGroFac": [1.01], + "T_cycle": 1, + "cycles": 0, + "AgentCount": 10000, +} + +# Create an instance of the model +model = IndShockConsumerType(**params) + +# Solve the model +model.solve() + +# Print the consumption function +print(model.solution[0].cFunc) +``` + +### Accidental Bequest Comparison + +The Accidental Bequest Comparison example demonstrates how to use HARK to solve a consumption-saving model with accidental bequests. + +#### Example + +```python +from HARK.ConsBequestModel import BequestConsumerType + +# Define the parameters for the model +params = { + "CRRA": 2.5, + "DiscFac": 0.96, + "Rfree": 1.03, + "BequestMot": 0.5, + "LivPrb": [0.98], + "PermGroFac": [1.01], + "T_cycle": 1, + "cycles": 0, + "AgentCount": 10000, +} + +# Create an instance of the model +model = BequestConsumerType(**params) + +# Solve the model +model.solve() + +# Print the consumption function +print(model.solution[0].cFunc) +``` + +### Accidental Bequest Portfolio Comparison + +The Accidental Bequest Portfolio Comparison example demonstrates how to use HARK to solve a consumption-saving model with accidental bequests and portfolio choice. + +#### Example + +```python +from HARK.ConsBequestModel import BequestPortfolioConsumerType + +# Define the parameters for the model +params = { + "CRRA": 2.5, + "DiscFac": 0.96, + "Rfree": 1.03, + "BequestMot": 0.5, + "RiskyAvg": 1.08, + "RiskyStd": 0.2, + "LivPrb": [0.98], + "PermGroFac": [1.01], + "T_cycle": 1, + "cycles": 0, + "AgentCount": 10000, +} + +# Create an instance of the model +model = BequestPortfolioConsumerType(**params) + +# Solve the model +model.solve() + +# Print the consumption function +print(model.solution[0].cFunc) +``` + +### Terminal Bequest + +The Terminal Bequest example demonstrates how to use HARK to solve a consumption-saving model with terminal bequests. + +#### Example + +```python +from HARK.ConsBequestModel import TerminalBequestConsumerType + +# Define the parameters for the model +params = { + "CRRA": 2.5, + "DiscFac": 0.96, + "Rfree": 1.03, + "BequestMot": 0.5, + "LivPrb": [0.98], + "PermGroFac": [1.01], + "T_cycle": 1, + "cycles": 0, + "AgentCount": 10000, +} + +# Create an instance of the model +model = TerminalBequestConsumerType(**params) + +# Solve the model +model.solve() + +# Print the consumption function +print(model.solution[0].cFunc) +``` + +### Terminal Bequest Portfolio + +The Terminal Bequest Portfolio example demonstrates how to use HARK to solve a consumption-saving model with terminal bequests and portfolio choice. + +#### Example + +```python +from HARK.ConsBequestModel import TerminalBequestPortfolioConsumerType + +# Define the parameters for the model +params = { + "CRRA": 2.5, + "DiscFac": 0.96, + "Rfree": 1.03, + "BequestMot": 0.5, + "RiskyAvg": 1.08, + "RiskyStd": 0.2, + "LivPrb": [0.98], + "PermGroFac": [1.01], + "T_cycle": 1, + "cycles": 0, + "AgentCount": 10000, +} + +# Create an instance of the model +model = TerminalBequestPortfolioConsumerType(**params) + +# Solve the model +model.solve() + +# Print the consumption function +print(model.solution[0].cFunc) +``` + +### Warm Glow Bequest + +The Warm Glow Bequest example demonstrates how to use HARK to solve a consumption-saving model with warm glow bequests. + +#### Example + +```python +from HARK.ConsBequestModel import WarmGlowBequestConsumerType + +# Define the parameters for the model +params = { + "CRRA": 2.5, + "DiscFac": 0.96, + "Rfree": 1.03, + "BequestMot": 0.5, + "LivPrb": [0.98], + "PermGroFac": [1.01], + "T_cycle": 1, + "cycles": 0, + "AgentCount": 10000, +} + +# Create an instance of the model +model = WarmGlowBequestConsumerType(**params) + +# Solve the model +model.solve() + +# Print the consumption function +print(model.solution[0].cFunc) +``` + +### Warm Glow Bequest Portfolio + +The Warm Glow Bequest Portfolio example demonstrates how to use HARK to solve a consumption-saving model with warm glow bequests and portfolio choice. + +#### Example + +```python +from HARK.ConsBequestModel import WarmGlowBequestPortfolioConsumerType + +# Define the parameters for the model +params = { + "CRRA": 2.5, + "DiscFac": 0.96, + "Rfree": 1.03, + "BequestMot": 0.5, + "RiskyAvg": 1.08, + "RiskyStd": 0.2, + "LivPrb": [0.98], + "PermGroFac": [1.01], + "T_cycle": 1, + "cycles": 0, + "AgentCount": 10000, +} + +# Create an instance of the model +model = WarmGlowBequestPortfolioConsumerType(**params) + +# Solve the model +model.solve() + +# Print the consumption function +print(model.solution[0].cFunc) +``` + +### Wealth Portfolio + +The Wealth Portfolio example demonstrates how to use HARK to solve a consumption-saving model with wealth portfolio choice. + +#### Example + +```python +from HARK.ConsPortfolioModel import WealthPortfolioConsumerType + +# Define the parameters for the model +params = { + "CRRA": 2.5, + "DiscFac": 0.96, + "Rfree": 1.03, + "RiskyAvg": 1.08, + "RiskyStd": 0.2, + "LivPrb": [0.98], + "PermGroFac": [1.01], + "T_cycle": 1, + "cycles": 0, + "AgentCount": 10000, +} + +# Create an instance of the model +model = WealthPortfolioConsumerType(**params) + +# Solve the model +model.solve() + +# Print the consumption function +print(model.solution[0].cFunc) +``` + +### Finite Cyclical Test + +The Finite Cyclical Test example demonstrates how to use HARK to solve a consumption-saving model with finite cyclical behavior. + +#### Example + +```python +from HARK.ConsumptionSaving.ConsIndShockModel import IndShockConsumerType + +# Define the parameters for the model +params = { + "CRRA": 2.5, + "DiscFac": 0.96, + "Rfree": 1.03, + "LivPrb": [0.98], + "PermGroFac": [1.01], + "T_cycle": 1, + "cycles": 5, + "AgentCount": 10000, +} + +# Create an instance of the model +model = IndShockConsumerType(**params) + +# Solve the model +model.solve() + +# Print the consumption function +print(model.solution[0].cFunc) +``` + +### SSJ Explanation + +The SSJ Explanation example provides a detailed explanation of the steps involved in solving a consumption-saving model with an SSJ example. + +#### Example + +```python +from HARK.ConsumptionSaving.ConsIndShockModel import IndShockConsumerType + +# Define the parameters for the model +params = { + "CRRA": 2.5, + "DiscFac": 0.96, + "Rfree": 1.03, + "LivPrb": [0.98], + "PermGroFac": [1.01], + "T_cycle": 1, + "cycles": 0, + "AgentCount": 10000, +} + +# Create an instance of the model +model = IndShockConsumerType(**params) + +# Solve the model +model.solve() + +# Print the consumption function +print(model.solution[0].cFunc) +``` + +### ConsRiskyAssetModel + +The ConsRiskyAssetModel example demonstrates how to use HARK to solve a consumption-saving model with risky assets. + +#### Example + +```python +from HARK.ConsPortfolioModel import RiskyAssetConsumerType + +# Define the parameters for the model +params = { + "CRRA": 2.5, + "DiscFac": 0.96, + "Rfree": 1.03, + "RiskyAvg": 1.08, + "RiskyStd": 0.2, + "LivPrb": [0.98], + "PermGroFac": [1.01], + "T_cycle": 1, + "cycles": 0, + "AgentCount": 10000, +} + +# Create an instance of the model +model = RiskyAssetConsumerType(**params) + +# Solve the model +model.solve() + +# Print the consumption function +print(model.solution[0].cFunc) +``` + +### ConsSequentialPortfolioModel + +The ConsSequentialPortfolioModel example demonstrates how to use HARK to solve a consumption-saving model with sequential portfolio choice. + +#### Example + +```python +from HARK.ConsPortfolioModel import SequentialPortfolioConsumerType + +# Define the parameters for the model +params = { + "CRRA": 2.5, + "DiscFac": 0.96, + "Rfree": 1.03, + "RiskyAvg": 1.08, + "RiskyStd": 0.2, + "LivPrb": [0.98], + "PermGroFac": [1.01], + "T_cycle": 1, + "cycles": 0, + "AgentCount": 10000, +} + +# Create an instance of the model +model = SequentialPortfolioConsumerType(**params) + +# Solve the model +model.solve() + +# Print the consumption function +print(model.solution[0].cFunc) +``` + +### ConsAggShockModel + +The ConsAggShockModel example demonstrates how to use HARK to solve a consumption-saving model with aggregate shocks. + +#### Example + +```python +from HARK.ConsAggShockModel import AggShockConsumerType + +# Define the parameters for the model +params = { + "CRRA": 2.5, + "DiscFac": 0.96, + "Rfree": 1.03, + "AggShockStd": 0.02, + "LivPrb": [0.98], + "PermGroFac": [1.01], + "T_cycle": 1, + "cycles": 0, + "AgentCount": 10000, +} + +# Create an instance of the model +model = AggShockConsumerType(**params) + +# Solve the model +model.solve() + +# Print the consumption function +print(model.solution[0].cFunc) +``` + +### ConsGenIncProcessModel + +The ConsGenIncProcessModel example demonstrates how to use HARK to solve a consumption-saving model with a general income process. + +#### Example + +```python +from HARK.ConsumptionSaving.ConsGenIncProcessModel import GenIncProcessConsumerType + +# Define the parameters for the model +params = { + "CRRA": 2.5, + "DiscFac": 0.96, + "Rfree": 1.03, + "LivPrb": [0.98], + "PermGroFac": [1.01], + "T_cycle": 1, + "cycles": 0, + "AgentCount": 10000, +} + +# Create an instance of the model +model = GenIncProcessConsumerType(**params) + +# Solve the model +model.solve() + +# Print the consumption function +print(model.solution[0].cFunc) +``` + +### How We Solve diff --git a/Documentation/reference/ConsumptionSaving/ConsAggShockModel.rst b/Documentation/reference/ConsumptionSaving/ConsAggShockModel.rst deleted file mode 100644 index ae159de8c..000000000 --- a/Documentation/reference/ConsumptionSaving/ConsAggShockModel.rst +++ /dev/null @@ -1,7 +0,0 @@ -ConsAggShockModel --------------------- - -.. automodule:: HARK.ConsumptionSaving.ConsAggShockModel - :members: - :undoc-members: - :show-inheritance: diff --git a/Documentation/reference/ConsumptionSaving/ConsBequestModel.rst b/Documentation/reference/ConsumptionSaving/ConsBequestModel.rst deleted file mode 100644 index 2afa3bf35..000000000 --- a/Documentation/reference/ConsumptionSaving/ConsBequestModel.rst +++ /dev/null @@ -1,7 +0,0 @@ -ConsBequestModel --------------------- - -.. automodule:: HARK.ConsumptionSaving.ConsBequestModel - :members: - :undoc-members: - :show-inheritance: diff --git a/Documentation/reference/ConsumptionSaving/ConsGenIncProcessModel.rst b/Documentation/reference/ConsumptionSaving/ConsGenIncProcessModel.rst deleted file mode 100644 index 3a06764eb..000000000 --- a/Documentation/reference/ConsumptionSaving/ConsGenIncProcessModel.rst +++ /dev/null @@ -1,7 +0,0 @@ -ConsGenIncProcessModel ------------------------------- - -.. automodule:: HARK.ConsumptionSaving.ConsGenIncProcessModel - :members: - :undoc-members: - :show-inheritance: diff --git a/Documentation/reference/ConsumptionSaving/ConsIndShockModel.rst b/Documentation/reference/ConsumptionSaving/ConsIndShockModel.rst deleted file mode 100644 index 2a969aae3..000000000 --- a/Documentation/reference/ConsumptionSaving/ConsIndShockModel.rst +++ /dev/null @@ -1,7 +0,0 @@ -ConsIndShockModel ----------------------------- - -.. automodule:: HARK.ConsumptionSaving.ConsIndShockModel - :members: - :undoc-members: - :show-inheritance: diff --git a/Documentation/reference/ConsumptionSaving/ConsIndShockModelFast.rst b/Documentation/reference/ConsumptionSaving/ConsIndShockModelFast.rst deleted file mode 100644 index 68a3c2e46..000000000 --- a/Documentation/reference/ConsumptionSaving/ConsIndShockModelFast.rst +++ /dev/null @@ -1,7 +0,0 @@ -ConsIndShockModelFast ----------------------------- - -.. automodule:: HARK.ConsumptionSaving.ConsIndShockModelFast - :members: - :undoc-members: - :show-inheritance: diff --git a/Documentation/reference/ConsumptionSaving/ConsLaborModel.rst b/Documentation/reference/ConsumptionSaving/ConsLaborModel.rst deleted file mode 100644 index 9f44cca11..000000000 --- a/Documentation/reference/ConsumptionSaving/ConsLaborModel.rst +++ /dev/null @@ -1,7 +0,0 @@ -ConsLaborModel --------------------------- - -.. automodule:: HARK.ConsumptionSaving.ConsLaborModel - :members: - :undoc-members: - :show-inheritance: diff --git a/Documentation/reference/ConsumptionSaving/ConsMarkovModel.rst b/Documentation/reference/ConsumptionSaving/ConsMarkovModel.rst deleted file mode 100644 index 9a44bc439..000000000 --- a/Documentation/reference/ConsumptionSaving/ConsMarkovModel.rst +++ /dev/null @@ -1,7 +0,0 @@ -ConsMarkovModel --------------------- - -.. automodule:: HARK.ConsumptionSaving.ConsMarkovModel - :members: - :undoc-members: - :show-inheritance: diff --git a/Documentation/reference/ConsumptionSaving/ConsMedModel.rst b/Documentation/reference/ConsumptionSaving/ConsMedModel.rst deleted file mode 100644 index e151c32e5..000000000 --- a/Documentation/reference/ConsumptionSaving/ConsMedModel.rst +++ /dev/null @@ -1,7 +0,0 @@ -ConsMedModel -------------------- - -.. automodule:: HARK.ConsumptionSaving.ConsMedModel - :members: - :undoc-members: - :show-inheritance: diff --git a/Documentation/reference/ConsumptionSaving/ConsPortfolioFrameModel.rst b/Documentation/reference/ConsumptionSaving/ConsPortfolioFrameModel.rst deleted file mode 100644 index 5c783c31a..000000000 --- a/Documentation/reference/ConsumptionSaving/ConsPortfolioFrameModel.rst +++ /dev/null @@ -1,7 +0,0 @@ -ConsPortfolioFrameModel ------------------------ - -.. automodule:: HARK.ConsumptionSaving.ConsPortfolioFrameModel - :members: - :undoc-members: - :show-inheritance: diff --git a/Documentation/reference/ConsumptionSaving/ConsPortfolioModel.rst b/Documentation/reference/ConsumptionSaving/ConsPortfolioModel.rst deleted file mode 100644 index e46f1e129..000000000 --- a/Documentation/reference/ConsumptionSaving/ConsPortfolioModel.rst +++ /dev/null @@ -1,7 +0,0 @@ -ConsPortfolioModel ------------------------ - -.. automodule:: HARK.ConsumptionSaving.ConsPortfolioModel - :members: - :undoc-members: - :show-inheritance: diff --git a/Documentation/reference/ConsumptionSaving/ConsPrefShochModel.rst b/Documentation/reference/ConsumptionSaving/ConsPrefShochModel.rst deleted file mode 100644 index 4fcc2f0f9..000000000 --- a/Documentation/reference/ConsumptionSaving/ConsPrefShochModel.rst +++ /dev/null @@ -1,7 +0,0 @@ -ConsPrefShockModel ---------------------------- - -.. automodule:: HARK.ConsumptionSaving.ConsPrefShockModel - :members: - :undoc-members: - :show-inheritance: diff --git a/Documentation/reference/ConsumptionSaving/ConsRepAgentModel.rst b/Documentation/reference/ConsumptionSaving/ConsRepAgentModel.rst deleted file mode 100644 index 5ff47aa94..000000000 --- a/Documentation/reference/ConsumptionSaving/ConsRepAgentModel.rst +++ /dev/null @@ -1,7 +0,0 @@ -ConsRepAgentModel --------------------------- - -.. automodule:: HARK.ConsumptionSaving.ConsRepAgentModel - :members: - :undoc-members: - :show-inheritance: diff --git a/Documentation/reference/ConsumptionSaving/ConsRiskyAssetModel.rst b/Documentation/reference/ConsumptionSaving/ConsRiskyAssetModel.rst deleted file mode 100644 index 4ba170337..000000000 --- a/Documentation/reference/ConsumptionSaving/ConsRiskyAssetModel.rst +++ /dev/null @@ -1,7 +0,0 @@ -ConsRiskyAssetModel ------------------------ - -.. automodule:: HARK.ConsumptionSaving.ConsRiskyAssetModel - :members: - :undoc-members: - :show-inheritance: diff --git a/Documentation/reference/ConsumptionSaving/ConsRiskyContribModel.rst b/Documentation/reference/ConsumptionSaving/ConsRiskyContribModel.rst deleted file mode 100644 index d8dcca46b..000000000 --- a/Documentation/reference/ConsumptionSaving/ConsRiskyContribModel.rst +++ /dev/null @@ -1,7 +0,0 @@ -ConsRiskyContribModel ------------------------ - -.. automodule:: HARK.ConsumptionSaving.ConsRiskyContribModel - :members: - :undoc-members: - :show-inheritance: diff --git a/Documentation/reference/ConsumptionSaving/TractableBufferStockModel.rst b/Documentation/reference/ConsumptionSaving/TractableBufferStockModel.rst deleted file mode 100644 index 556723e97..000000000 --- a/Documentation/reference/ConsumptionSaving/TractableBufferStockModel.rst +++ /dev/null @@ -1,7 +0,0 @@ -TractableBufferStockModel --------------------------- - -.. automodule:: HARK.ConsumptionSaving.TractableBufferStockModel - :members: - :undoc-members: - :show-inheritance: diff --git a/Documentation/reference/ConsumptionSaving/index.rst b/Documentation/reference/ConsumptionSaving/index.rst deleted file mode 100644 index 2e25b653a..000000000 --- a/Documentation/reference/ConsumptionSaving/index.rst +++ /dev/null @@ -1,6 +0,0 @@ -:orphan: - -Consumption Saving -================== - -See :doc:`../index`. diff --git a/Documentation/reference/index.rst b/Documentation/reference/index.rst deleted file mode 100644 index 07f65f6e1..000000000 --- a/Documentation/reference/index.rst +++ /dev/null @@ -1,43 +0,0 @@ -API Reference -============= - -.. toctree:: - :caption: Tools - :maxdepth: 1 - - tools/core - tools/dcegm - tools/distribution - tools/econforgeinterp - tools/estimation - tools/frame - tools/helpers - tools/interpolation - tools/incomeprocess - tools/model - tools/numba_tools - tools/parallel - tools/rewards - tools/simulation - tools/utilities - tools/validators - -.. toctree:: - :caption: Models - :maxdepth: 1 - - ConsumptionSaving/ConsAggShockModel - ConsumptionSaving/ConsBequestModel - ConsumptionSaving/ConsGenIncProcessModel - ConsumptionSaving/ConsIndShockModel - ConsumptionSaving/ConsIndShockModelFast - ConsumptionSaving/ConsLaborModel - ConsumptionSaving/ConsMarkovModel - ConsumptionSaving/ConsMedModel - ConsumptionSaving/ConsPortfolioFrameModel - ConsumptionSaving/ConsPortfolioModel - ConsumptionSaving/ConsPrefShochModel - ConsumptionSaving/ConsRepAgentModel - ConsumptionSaving/ConsRiskyAssetModel - ConsumptionSaving/ConsRiskyContribModel - ConsumptionSaving/TractableBufferStockModel diff --git a/Documentation/reference/tools/core.rst b/Documentation/reference/tools/core.rst deleted file mode 100644 index c16ace476..000000000 --- a/Documentation/reference/tools/core.rst +++ /dev/null @@ -1,7 +0,0 @@ -Core --------- - -.. automodule:: HARK.core - :members: - :undoc-members: - :show-inheritance: diff --git a/Documentation/reference/tools/dcegm.rst b/Documentation/reference/tools/dcegm.rst deleted file mode 100644 index 80a2f612f..000000000 --- a/Documentation/reference/tools/dcegm.rst +++ /dev/null @@ -1,7 +0,0 @@ -dcegm --------- - -.. automodule:: HARK.dcegm - :members: - :undoc-members: - :show-inheritance: diff --git a/Documentation/reference/tools/distribution.rst b/Documentation/reference/tools/distribution.rst deleted file mode 100644 index 6d2627fcd..000000000 --- a/Documentation/reference/tools/distribution.rst +++ /dev/null @@ -1,7 +0,0 @@ -Distribution -------------- - -.. automodule:: HARK.distribution - :members: - :undoc-members: - :show-inheritance: diff --git a/Documentation/reference/tools/econforgeinterp.rst b/Documentation/reference/tools/econforgeinterp.rst deleted file mode 100644 index 9f0b7aa25..000000000 --- a/Documentation/reference/tools/econforgeinterp.rst +++ /dev/null @@ -1,7 +0,0 @@ -Econforgeinterp ---------------- - -.. automodule:: HARK.econforgeinterp - :members: - :undoc-members: - :show-inheritance: diff --git a/Documentation/reference/tools/estimation.rst b/Documentation/reference/tools/estimation.rst deleted file mode 100644 index 943b7c887..000000000 --- a/Documentation/reference/tools/estimation.rst +++ /dev/null @@ -1,7 +0,0 @@ -Estimation -------------- - -.. automodule:: HARK.estimation - :members: - :undoc-members: - :show-inheritance: diff --git a/Documentation/reference/tools/frame.rst b/Documentation/reference/tools/frame.rst deleted file mode 100644 index 677c95a3d..000000000 --- a/Documentation/reference/tools/frame.rst +++ /dev/null @@ -1,7 +0,0 @@ -Frame -------------- - -.. automodule:: HARK.frame - :members: - :undoc-members: - :show-inheritance: diff --git a/Documentation/reference/tools/helpers.rst b/Documentation/reference/tools/helpers.rst deleted file mode 100644 index 8346f56dd..000000000 --- a/Documentation/reference/tools/helpers.rst +++ /dev/null @@ -1,7 +0,0 @@ -Helpers -------------- - -.. automodule:: HARK.helpers - :members: - :undoc-members: - :show-inheritance: diff --git a/Documentation/reference/tools/incomeprocess.rst b/Documentation/reference/tools/incomeprocess.rst deleted file mode 100644 index 9c0c6d686..000000000 --- a/Documentation/reference/tools/incomeprocess.rst +++ /dev/null @@ -1,11 +0,0 @@ -Calibration -------------- - -.. automodule:: HARK.Calibration.Income.IncomeProcesses - :members: - :undoc-members: - :show-inheritance: -.. automodule:: HARK.Calibration.Assets.AssetProcesses - :members: - :undoc-members: - :show-inheritance: diff --git a/Documentation/reference/tools/index.rst b/Documentation/reference/tools/index.rst deleted file mode 100644 index c1b8339b4..000000000 --- a/Documentation/reference/tools/index.rst +++ /dev/null @@ -1,6 +0,0 @@ -:orphan: - -Tools -===== - -See :doc:`../index`. diff --git a/Documentation/reference/tools/interpolation.rst b/Documentation/reference/tools/interpolation.rst deleted file mode 100644 index 9e126ca34..000000000 --- a/Documentation/reference/tools/interpolation.rst +++ /dev/null @@ -1,7 +0,0 @@ -Interpolation -------------- - -.. automodule:: HARK.interpolation - :members: - :undoc-members: - :show-inheritance: diff --git a/Documentation/reference/tools/model.rst b/Documentation/reference/tools/model.rst deleted file mode 100644 index 141b2ac93..000000000 --- a/Documentation/reference/tools/model.rst +++ /dev/null @@ -1,7 +0,0 @@ -Model -------------- - -.. automodule:: HARK.model - :members: - :undoc-members: - :show-inheritance: diff --git a/Documentation/reference/tools/numba_tools.rst b/Documentation/reference/tools/numba_tools.rst deleted file mode 100644 index d7f67e8cf..000000000 --- a/Documentation/reference/tools/numba_tools.rst +++ /dev/null @@ -1,7 +0,0 @@ -Numba Tools -------------- - -.. automodule:: HARK.numba_tools - :members: - :undoc-members: - :show-inheritance: diff --git a/Documentation/reference/tools/parallel.rst b/Documentation/reference/tools/parallel.rst deleted file mode 100644 index 0fa730c8e..000000000 --- a/Documentation/reference/tools/parallel.rst +++ /dev/null @@ -1,7 +0,0 @@ -Parallel ----------- - -.. automodule:: HARK.parallel - :members: - :undoc-members: - :show-inheritance: diff --git a/Documentation/reference/tools/rewards.rst b/Documentation/reference/tools/rewards.rst deleted file mode 100644 index dd4b1c54f..000000000 --- a/Documentation/reference/tools/rewards.rst +++ /dev/null @@ -1,7 +0,0 @@ -Rewards ----------- - -.. automodule:: HARK.rewards - :members: - :undoc-members: - :show-inheritance: diff --git a/Documentation/reference/tools/simulation.rst b/Documentation/reference/tools/simulation.rst deleted file mode 100644 index a56040159..000000000 --- a/Documentation/reference/tools/simulation.rst +++ /dev/null @@ -1,7 +0,0 @@ -Simulation ------------- - -.. automodule:: HARK.simulation.monte_carlo - :members: - :undoc-members: - :show-inheritance: diff --git a/Documentation/reference/tools/utilities.rst b/Documentation/reference/tools/utilities.rst deleted file mode 100644 index 81c2b909f..000000000 --- a/Documentation/reference/tools/utilities.rst +++ /dev/null @@ -1,7 +0,0 @@ -Utilities ----------- - -.. automodule:: HARK.utilities - :members: - :undoc-members: - :show-inheritance: diff --git a/Documentation/reference/tools/validators.rst b/Documentation/reference/tools/validators.rst deleted file mode 100644 index df5abf338..000000000 --- a/Documentation/reference/tools/validators.rst +++ /dev/null @@ -1,7 +0,0 @@ -Validators -------------- - -.. automodule:: HARK.validators - :members: - :undoc-members: - :show-inheritance: diff --git a/README.md b/README.md index c50f2aff0..edb4dccf7 100644 --- a/README.md +++ b/README.md @@ -238,3 +238,13 @@ This is the guide that collaborators follow in maintaining the Econ-ARK project. ## Disclaimer This is a beta version of HARK. The code has not been extensively tested as it should be. We hope it is useful, but there are absolutely no guarantees (expressed or implied) that it works or will do what you want. Use at your own risk. And please, let us know if you find bugs by posting an issue to [the GitHub page](https://github.com/econ-ark/HARK)! + +## Detailed Explanations and Examples + +To help users understand the purpose and features of the repository, we have provided detailed explanations and examples in various sections of the documentation. Here are some key resources: + +- [Overview and Examples](https://docs.econ-ark.org/Documentation/overview/index.html): This section provides an introduction to HARK and includes various examples to help users understand how to use the toolkit. +- [Guides](https://docs.econ-ark.org/Documentation/guides/index.html): This section includes guides on installation, quick start, and contributing to HARK. +- [Reference](https://docs.econ-ark.org/Documentation/reference/index.html): This section provides detailed explanations and examples of the various tools and models available in the repository. + +For more information and resources, please visit the [Econ-ARK documentation](https://docs.econ-ark.org/). From fe8f7f3c1533487d86f7e8a5da0ed96ceebf093c Mon Sep 17 00:00:00 2001 From: Alan Lujan Date: Thu, 7 Nov 2024 16:40:23 -0500 Subject: [PATCH 2/4] remove index --- Documentation/overview/index.rst | 105 ------------------------------- 1 file changed, 105 deletions(-) delete mode 100644 Documentation/overview/index.rst diff --git a/Documentation/overview/index.rst b/Documentation/overview/index.rst deleted file mode 100644 index e66a46d69..000000000 --- a/Documentation/overview/index.rst +++ /dev/null @@ -1,105 +0,0 @@ -Overview -======== - -.. toctree:: - :caption: Introduction to HARK - :maxdepth: 1 - - introduction - ARKitecture - -.. nbgallery is a wrapper around the toctree directive, see - https://nbsphinx.readthedocs.io/en/latest/a-normal-rst-file.html#thumbnail-galleries - -.. nbgallery:: - :caption: Examples - :maxdepth: 1 - - ../../examples/Gentle-Intro/Gentle-Intro-To-HARK.ipynb - ../../examples/LifecycleModel/Cycles_tutorial.ipynb - ../../examples/ConsIndShockModel/PerfForesightConsumerType.ipynb - ../../examples/ConsIndShockModel/IndShockConsumerType.ipynb - ../../examples/ConsIndShockModel/KinkedRconsumerType.ipynb - ../../examples/ConsPortfolioModel/example_ConsPortfolioModel.ipynb - ../../examples/GenIncProcessModel/GenIncProcessModel.ipynb - ../../examples/LifecycleModel/LifecycleModel.ipynb - ../../examples/HowWeSolveIndShockConsumerType/HowWeSolveIndShockConsumerType.ipynb - ../../examples/Journeys/Journey-PhD.ipynb - ../../examples/ConsNewKeynesianModel/Transition_Matrix_Example.ipynb - ../../examples/ConsNewKeynesianModel/Jacobian_Example.ipynb - ../../examples/ConsNewKeynesianModel/KS-HARK-presentation.ipynb - ../../examples/ConsNewKeynesianModel/SSJ_example.ipynb - ../../examples/ConsBequestModel/example_AccidentalBequestComp.ipynb - ../../examples/ConsBequestModel/example_AccidentalBequestPortComp.ipynb - ../../examples/ConsBequestModel/example_TerminalBequest.ipynb - ../../examples/ConsBequestModel/example_TerminalBequestPort.ipynb - ../../examples/ConsBequestModel/example_WarmGlowBequest.ipynb - ../../examples/ConsBequestModel/example_WarmGlowBequestPort.ipynb - ../../examples/ConsBequestModel/example_WealthPortfolio.ipynb - ../../examples/ConsIndShockModel/Finite Cyclical Test.ipynb - ../../examples/ConsNewKeynesianModel/SSJ_explanation.ipynb - ../../examples/ConsPortfolioModel/example_ConsRiskyAssetModel.ipynb - ../../examples/ConsPortfolioModel/example_ConsSequentialPortfolioModel.ipynb - ../../examples/ConsumptionSaving/example_ConsAggShockModel.ipynb - ../../examples/ConsumptionSaving/example_ConsGenIncProcessModel.ipynb - ../../examples/ConsumptionSaving/example_ConsIndShock.ipynb - ../../examples/ConsumptionSaving/example_ConsLaborModel.ipynb - ../../examples/ConsumptionSaving/example_ConsMarkovModel.ipynb - ../../examples/ConsumptionSaving/example_ConsMedModel.ipynb - ../../examples/ConsumptionSaving/example_ConsPrefShockModel.ipynb - ../../examples/ConsumptionSaving/example_ConsRepAgentModel.ipynb - ../../examples/ConsumptionSaving/example_ConsRiskyContribModel.ipynb - ../../examples/ConsumptionSaving/example_TractableBufferStockModel.ipynb - ../../examples/Distributions/DiscreteDistributionLabeled.ipynb - ../../examples/Distributions/EquiprobableLognormal.ipynb - ../../examples/Distributions/ExpectedValue.ipynb - ../../examples/FrameAgentType/FrameAgentType Demo.ipynb - ../../examples/FrameAgentType/FrameModels.ipynb - ../../examples/HowWeSolveIndShockConsumerType/HowWeSolveIndShockConsumerType.ipynb - ../../examples/Interpolation/CubicInterp.ipynb - ../../examples/Interpolation/DecayInterp.ipynb - ../../examples/Journeys/AzureMachineLearning.ipynb - ../../examples/Journeys/Journey-Engineering-Background.ipynb - ../../examples/Journeys/Journey-PhD.ipynb - ../../examples/Journeys/Journey-Policymaker.ipynb - ../../examples/Journeys/JourneyPhDparam.py - ../../examples/Journeys/Journeys-into-HARK.ipynb - ../../examples/Journeys/Quickstart_tutorial/Quick_start_with_solution.ipynb - ../../examples/LabeledModels/LabeledModels.ipynb - ../../examples/MonteCarlo/Generic Monte Carlo Perfect Foresight.ipynb - ../../examples/ConsumptionSaving/example_ConsRiskyAssetModel.ipynb - ../../examples/ConsumptionSaving/example_ConsSequentialPortfolioModel.ipynb - ../../examples/ConsumptionSaving/example_ConsAggShockModel.ipynb - ../../examples/ConsumptionSaving/example_ConsGenIncProcessModel.ipynb - ../../examples/ConsumptionSaving/example_ConsIndShock.ipynb - ../../examples/ConsumptionSaving/example_ConsLaborModel.ipynb - ../../examples/ConsumptionSaving/example_ConsMarkovModel.ipynb - ../../examples/ConsumptionSaving/example_ConsMedModel.ipynb - ../../examples/ConsumptionSaving/example_ConsPrefShockModel.ipynb - ../../examples/ConsumptionSaving/example_ConsRepAgentModel.ipynb - ../../examples/ConsumptionSaving/example_ConsRiskyContribModel.ipynb - ../../examples/ConsumptionSaving/example_TractableBufferStockModel.ipynb - ../../examples/Distributions/DiscreteDistributionLabeled.ipynb - ../../examples/Distributions/EquiprobableLognormal.ipynb - ../../examples/Distributions/ExpectedValue.ipynb - ../../examples/FrameAgentType/FrameAgentType Demo.ipynb - ../../examples/FrameAgentType/FrameModels.ipynb - ../../examples/HowWeSolveIndShockConsumerType/HowWeSolveIndShockConsumerType.ipynb - ../../examples/Interpolation/CubicInterp.ipynb - ../../examples/Interpolation/DecayInterp.ipynb - ../../examples/Journeys/AzureMachineLearning.ipynb - ../../examples/Journeys/Journey-Engineering-Background.ipynb - ../../examples/Journeys/Journey-PhD.ipynb - ../../examples/Journeys/Journey-Policymaker.ipynb - ../../examples/Journeys/JourneyPhDparam.py - ../../examples/Journeys/Journeys-into-HARK.ipynb - ../../examples/Journeys/Quickstart_tutorial/Quick_start_with_solution.ipynb - ../../examples/LabeledModels/LabeledModels.ipynb - ../../examples/MonteCarlo/Generic Monte Carlo Perfect Foresight.ipynb - -.. toctree:: - :hidden: - :caption: Extras - - ../CHANGELOG - ../license From 340e6d06ce23d317faea1ab1bdbf08a4eda33182 Mon Sep 17 00:00:00 2001 From: alanlujan91 Date: Thu, 7 Nov 2024 16:42:29 -0500 Subject: [PATCH 3/4] restore index --- Documentation/overview/index.rst | 38 ++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Documentation/overview/index.rst diff --git a/Documentation/overview/index.rst b/Documentation/overview/index.rst new file mode 100644 index 000000000..ebbfe66ef --- /dev/null +++ b/Documentation/overview/index.rst @@ -0,0 +1,38 @@ +Overview +======== + +.. toctree:: + :caption: Introduction to HARK + :maxdepth: 1 + + introduction + ARKitecture + +.. nbgallery is a wrapper around the toctree directive, see + https://nbsphinx.readthedocs.io/en/latest/a-normal-rst-file.html#thumbnail-galleries + +.. nbgallery:: + :caption: Examples + :maxdepth: 1 + + ../../examples/Gentle-Intro/Gentle-Intro-To-HARK.ipynb + ../../examples/LifecycleModel/Cycles_tutorial.ipynb + ../../examples/ConsIndShockModel/PerfForesightConsumerType.ipynb + ../../examples/ConsIndShockModel/IndShockConsumerType.ipynb + ../../examples/ConsIndShockModel/KinkedRconsumerType.ipynb + ../../examples/ConsPortfolioModel/example_ConsPortfolioModel.ipynb + ../../examples/GenIncProcessModel/GenIncProcessModel.ipynb + ../../examples/LifecycleModel/LifecycleModel.ipynb + ../../examples/HowWeSolveIndShockConsumerType/HowWeSolveIndShockConsumerType.ipynb + ../../examples/Journeys/Journey-PhD.ipynb + ../../examples/ConsNewKeynesianModel/Transition_Matrix_Example.ipynb + ../../examples/ConsNewKeynesianModel/Jacobian_Example.ipynb + ../../examples/ConsNewKeynesianModel/KS-HARK-presentation.ipynb + ../../examples/ConsNewKeynesianModel/SSJ_example.ipynb + +.. toctree:: + :hidden: + :caption: Extras + + ../CHANGELOG + ../license From f07fcc9f436c4aa51a96cbb5a5d24bcdf8ec9f64 Mon Sep 17 00:00:00 2001 From: Alan Lujan Date: Thu, 7 Nov 2024 16:54:47 -0500 Subject: [PATCH 4/4] restore files --- Documentation/reference | 1379 ----------------- .../ConsumptionSaving/ConsAggShockModel.rst | 7 + .../ConsumptionSaving/ConsBequestModel.rst | 7 + .../ConsGenIncProcessModel.rst | 7 + .../ConsumptionSaving/ConsIndShockModel.rst | 7 + .../ConsIndShockModelFast.rst | 7 + .../ConsumptionSaving/ConsLaborModel.rst | 7 + .../ConsumptionSaving/ConsMarkovModel.rst | 7 + .../ConsumptionSaving/ConsMedModel.rst | 7 + .../ConsPortfolioFrameModel.rst | 7 + .../ConsumptionSaving/ConsPortfolioModel.rst | 7 + .../ConsumptionSaving/ConsPrefShochModel.rst | 7 + .../ConsumptionSaving/ConsRepAgentModel.rst | 7 + .../ConsumptionSaving/ConsRiskyAssetModel.rst | 7 + .../ConsRiskyContribModel.rst | 7 + .../TractableBufferStockModel.rst | 7 + .../reference/ConsumptionSaving/index.rst | 6 + Documentation/reference/index.rst | 43 + Documentation/reference/tools/core.rst | 7 + Documentation/reference/tools/dcegm.rst | 7 + .../reference/tools/distribution.rst | 7 + .../reference/tools/econforgeinterp.rst | 7 + Documentation/reference/tools/estimation.rst | 7 + Documentation/reference/tools/frame.rst | 7 + Documentation/reference/tools/helpers.rst | 7 + .../reference/tools/incomeprocess.rst | 11 + Documentation/reference/tools/index.rst | 6 + .../reference/tools/interpolation.rst | 7 + Documentation/reference/tools/model.rst | 7 + Documentation/reference/tools/numba_tools.rst | 7 + Documentation/reference/tools/parallel.rst | 7 + Documentation/reference/tools/rewards.rst | 7 + Documentation/reference/tools/simulation.rst | 7 + Documentation/reference/tools/utilities.rst | 7 + Documentation/reference/tools/validators.rst | 7 + 35 files changed, 276 insertions(+), 1379 deletions(-) delete mode 100644 Documentation/reference create mode 100644 Documentation/reference/ConsumptionSaving/ConsAggShockModel.rst create mode 100644 Documentation/reference/ConsumptionSaving/ConsBequestModel.rst create mode 100644 Documentation/reference/ConsumptionSaving/ConsGenIncProcessModel.rst create mode 100644 Documentation/reference/ConsumptionSaving/ConsIndShockModel.rst create mode 100644 Documentation/reference/ConsumptionSaving/ConsIndShockModelFast.rst create mode 100644 Documentation/reference/ConsumptionSaving/ConsLaborModel.rst create mode 100644 Documentation/reference/ConsumptionSaving/ConsMarkovModel.rst create mode 100644 Documentation/reference/ConsumptionSaving/ConsMedModel.rst create mode 100644 Documentation/reference/ConsumptionSaving/ConsPortfolioFrameModel.rst create mode 100644 Documentation/reference/ConsumptionSaving/ConsPortfolioModel.rst create mode 100644 Documentation/reference/ConsumptionSaving/ConsPrefShochModel.rst create mode 100644 Documentation/reference/ConsumptionSaving/ConsRepAgentModel.rst create mode 100644 Documentation/reference/ConsumptionSaving/ConsRiskyAssetModel.rst create mode 100644 Documentation/reference/ConsumptionSaving/ConsRiskyContribModel.rst create mode 100644 Documentation/reference/ConsumptionSaving/TractableBufferStockModel.rst create mode 100644 Documentation/reference/ConsumptionSaving/index.rst create mode 100644 Documentation/reference/index.rst create mode 100644 Documentation/reference/tools/core.rst create mode 100644 Documentation/reference/tools/dcegm.rst create mode 100644 Documentation/reference/tools/distribution.rst create mode 100644 Documentation/reference/tools/econforgeinterp.rst create mode 100644 Documentation/reference/tools/estimation.rst create mode 100644 Documentation/reference/tools/frame.rst create mode 100644 Documentation/reference/tools/helpers.rst create mode 100644 Documentation/reference/tools/incomeprocess.rst create mode 100644 Documentation/reference/tools/index.rst create mode 100644 Documentation/reference/tools/interpolation.rst create mode 100644 Documentation/reference/tools/model.rst create mode 100644 Documentation/reference/tools/numba_tools.rst create mode 100644 Documentation/reference/tools/parallel.rst create mode 100644 Documentation/reference/tools/rewards.rst create mode 100644 Documentation/reference/tools/simulation.rst create mode 100644 Documentation/reference/tools/utilities.rst create mode 100644 Documentation/reference/tools/validators.rst diff --git a/Documentation/reference b/Documentation/reference deleted file mode 100644 index 734d9c3bd..000000000 --- a/Documentation/reference +++ /dev/null @@ -1,1379 +0,0 @@ -# HARK Reference Documentation - -This section provides detailed explanations and examples to help users understand how to use the various tools and models in the HARK repository. - -## Table of Contents - -1. [Tools](#tools) - - [Distribution](#distribution) - - [Estimation](#estimation) - - [Interpolation](#interpolation) - - [Metric](#metric) - - [Parallel](#parallel) - - [Utilities](#utilities) -2. [Models](#models) - - [ConsumptionSaving](#consumptionsaving) - - [ConsPortfolioModel](#consportfoliomodel) - - [ConsIndShockModel](#consindshockmodel) - - [ConsAggShockModel](#consaggshockmodel) - - [ConsMarkovModel](#consmarkovmodel) - - [ConsPrefShockModel](#consprefshockmodel) - - [ConsMedModel](#consmedmodel) - - [ConsLaborModel](#conslabormodel) - - [ConsBequestModel](#consbequestmodel) - - [ConsRiskyContribModel](#consriskycontribmodel) - - [ConsRepAgentModel](#consrepagentmodel) - - [TractableBufferStockModel](#tractablebufferstockmodel) -3. [Examples](#examples) - - [Gentle Introduction to HARK](#gentle-introduction-to-hark) - - [Lifecycle Model](#lifecycle-model) - - [IndShockConsumerType](#indshockconsumertype) - - [KinkedRconsumerType](#kinkedrconsumertype) - - [ConsPortfolioModel](#consportfoliomodel) - - [GenIncProcessModel](#genincprocessmodel) - - [How We Solve IndShockConsumerType](#how-we-solve-indshockconsumertype) - - [Journey-PhD](#journey-phd) - - [Transition Matrix Example](#transition-matrix-example) - - [Jacobian Example](#jacobian-example) - - [KS-HARK Presentation](#ks-hark-presentation) - - [SSJ Example](#ssj-example) - - [Accidental Bequest Comparison](#accidental-bequest-comparison) - - [Accidental Bequest Portfolio Comparison](#accidental-bequest-portfolio-comparison) - - [Terminal Bequest](#terminal-bequest) - - [Terminal Bequest Portfolio](#terminal-bequest-portfolio) - - [Warm Glow Bequest](#warm-glow-bequest) - - [Warm Glow Bequest Portfolio](#warm-glow-bequest-portfolio) - - [Wealth Portfolio](#wealth-portfolio) - - [Finite Cyclical Test](#finite-cyclical-test) - - [SSJ Explanation](#ssj-explanation) - - [ConsRiskyAssetModel](#consriskyassetmodel) - - [ConsSequentialPortfolioModel](#conssequentialportfoliomodel) - - [ConsAggShockModel](#consaggshockmodel) - - [ConsGenIncProcessModel](#consgenincprocessmodel) - - [ConsIndShock](#consindshock) - - [ConsLaborModel](#conslabormodel) - - [ConsMarkovModel](#consmarkovmodel) - - [ConsMedModel](#consmedmodel) - - [ConsPrefShockModel](#consprefshockmodel) - - [ConsRepAgentModel](#consrepagentmodel) - - [TractableBufferStockModel](#tractablebufferstockmodel) - - [DiscreteDistributionLabeled](#discretedistributionlabeled) - - [EquiprobableLognormal](#equiprobablelognormal) - - [ExpectedValue](#expectedvalue) - - [FrameAgentType Demo](#frameagenttype-demo) - - [FrameModels](#framemodels) - - [Cubic Interpolation](#cubic-interpolation) - - [Decay Interpolation](#decay-interpolation) - - [Azure Machine Learning](#azure-machine-learning) - - [Journey-Engineering-Background](#journey-engineering-background) - - [Journey-Policymaker](#journey-policymaker) - - [JourneyPhDparam](#journeyphdparam) - - [Journeys into HARK](#journeys-into-hark) - - [Quickstart Tutorial](#quickstart-tutorial) - - [LabeledModels](#labeledmodels) - - [Generic Monte Carlo Perfect Foresight](#generic-monte-carlo-perfect-foresight) - -## Tools - -### Distribution - -The `HARK.distribution` module includes classes for representing continuous distributions in a relatively consistent framework. It also has methods and functions for constructing discrete approximations to those distributions and manipulating these representations. - -#### Example - -```python -from HARK.distribution import Lognormal - -# Create a lognormal distribution -lognormal_dist = Lognormal(mu=0, sigma=1) - -# Draw 10 random samples from the distribution -samples = lognormal_dist.draw(10) -print(samples) -``` - -### Estimation - -The `HARK.estimation` module provides functions for optimizing an objective function for the purposes of estimating a model. It includes minimization methods and tools for resampling data. - -#### Example - -```python -from HARK.estimation import minimize_nelder_mead - -# Define an objective function -def objective_function(params): - x, y = params - return (x - 1)**2 + (y - 2)**2 - -# Minimize the objective function -result = minimize_nelder_mead(objective_function, [0, 0]) -print(result) -``` - -### Interpolation - -The `HARK.interpolation` module defines classes for representing interpolated function approximations. It includes various interpolation methods such as linear, cubic spline, and curvilinear interpolation. - -#### Example - -```python -from HARK.interpolation import LinearInterp - -# Define data points for interpolation -x = [0, 1, 2, 3, 4] -y = [0, 1, 4, 9, 16] - -# Create a linear interpolator -linear_interp = LinearInterp(x, y) - -# Evaluate the interpolator at a specific point -value = linear_interp(2.5) -print(value) -``` - -### Metric - -The `HARK.metric` module defines a superclass called `MetricObject` that is used throughout HARK's tools and models. It provides a universal distance metric for comparing solutions. - -#### Example - -```python -from HARK.metric import MetricObject - -# Define a custom metric object -class CustomMetric(MetricObject): - def __init__(self, value): - self.value = value - - def distance(self, other): - return abs(self.value - other.value) - -# Create two instances of the custom metric object -obj1 = CustomMetric(5) -obj2 = CustomMetric(8) - -# Calculate the distance between the two objects -dist = obj1.distance(obj2) -print(dist) -``` - -### Parallel - -The `HARK.parallel` module provides basic tools for using multiple CPU cores simultaneously. It includes functions for parallel execution of commands. - -#### Example - -```python -from HARK.parallel import multi_thread_commands - -# Define a list of agent types and commands -agent_types = [AgentType1(), AgentType2(), AgentType3()] -commands = ['solve', 'simulate'] - -# Execute the commands in parallel -multi_thread_commands(agent_types, commands) -``` - -### Utilities - -The `HARK.utilities` module contains a variety of general-purpose tools, including data manipulation, kernel regression, and plotting functions. - -#### Example - -```python -from HARK.utilities import calculate_lorenz_shares - -# Define income data -income_data = [10, 20, 30, 40, 50] - -# Calculate Lorenz shares -lorenz_shares = calculate_lorenz_shares(income_data) -print(lorenz_shares) -``` - -## Models - -### ConsumptionSaving - -The `HARK.ConsumptionSaving` module includes classes and functions for solving consumption-saving models. It provides tools for representing agents and solving their optimization problems. - -#### Example - -```python -from HARK.ConsumptionSaving.ConsIndShockModel import IndShockConsumerType - -# Define the parameters for the model -params = { - "CRRA": 2.5, - "DiscFac": 0.96, - "Rfree": 1.03, - "LivPrb": [0.98], - "PermGroFac": [1.01], - "T_cycle": 1, - "cycles": 0, - "AgentCount": 10000, -} - -# Create an instance of the model -model = IndShockConsumerType(**params) - -# Solve the model -model.solve() - -# Print the consumption function -print(model.solution[0].cFunc) -``` - -### ConsPortfolioModel - -The `HARK.ConsPortfolioModel` module includes classes and functions for solving consumption-portfolio choice models. It provides tools for representing agents and solving their optimization problems. - -#### Example - -```python -from HARK.ConsPortfolioModel import PortfolioConsumerType - -# Define the parameters for the model -params = { - "CRRA": 2.5, - "DiscFac": 0.96, - "Rfree": 1.03, - "RiskyAvg": 1.08, - "RiskyStd": 0.2, - "LivPrb": [0.98], - "PermGroFac": [1.01], - "T_cycle": 1, - "cycles": 0, - "AgentCount": 10000, -} - -# Create an instance of the model -model = PortfolioConsumerType(**params) - -# Solve the model -model.solve() - -# Print the consumption function -print(model.solution[0].cFunc) -``` - -### ConsIndShockModel - -The `HARK.ConsIndShockModel` module includes classes and functions for solving consumption-saving models with idiosyncratic shocks to income. It provides tools for representing agents and solving their optimization problems. - -#### Example - -```python -from HARK.ConsIndShockModel import IndShockConsumerType - -# Define the parameters for the model -params = { - "CRRA": 2.5, - "DiscFac": 0.96, - "Rfree": 1.03, - "LivPrb": [0.98], - "PermGroFac": [1.01], - "T_cycle": 1, - "cycles": 0, - "AgentCount": 10000, -} - -# Create an instance of the model -model = IndShockConsumerType(**params) - -# Solve the model -model.solve() - -# Print the consumption function -print(model.solution[0].cFunc) -``` - -### ConsAggShockModel - -The `HARK.ConsAggShockModel` module includes classes and functions for solving consumption-saving models with aggregate shocks. It provides tools for representing agents and solving their optimization problems. - -#### Example - -```python -from HARK.ConsAggShockModel import AggShockConsumerType - -# Define the parameters for the model -params = { - "CRRA": 2.5, - "DiscFac": 0.96, - "Rfree": 1.03, - "AggShockStd": 0.02, - "LivPrb": [0.98], - "PermGroFac": [1.01], - "T_cycle": 1, - "cycles": 0, - "AgentCount": 10000, -} - -# Create an instance of the model -model = AggShockConsumerType(**params) - -# Solve the model -model.solve() - -# Print the consumption function -print(model.solution[0].cFunc) -``` - -### ConsMarkovModel - -The `HARK.ConsMarkovModel` module includes classes and functions for solving consumption-saving models with Markovian shocks. It provides tools for representing agents and solving their optimization problems. - -#### Example - -```python -from HARK.ConsMarkovModel import MarkovConsumerType - -# Define the parameters for the model -params = { - "CRRA": 2.5, - "DiscFac": 0.96, - "Rfree": 1.03, - "MarkovPrb": [[0.9, 0.1], [0.1, 0.9]], - "LivPrb": [0.98], - "PermGroFac": [1.01], - "T_cycle": 1, - "cycles": 0, - "AgentCount": 10000, -} - -# Create an instance of the model -model = MarkovConsumerType(**params) - -# Solve the model -model.solve() - -# Print the consumption function -print(model.solution[0].cFunc) -``` - -### ConsPrefShockModel - -The `HARK.ConsPrefShockModel` module includes classes and functions for solving consumption-saving models with preference shocks. It provides tools for representing agents and solving their optimization problems. - -#### Example - -```python -from HARK.ConsPrefShockModel import PrefShockConsumerType - -# Define the parameters for the model -params = { - "CRRA": 2.5, - "DiscFac": 0.96, - "Rfree": 1.03, - "PrefShockStd": 0.1, - "LivPrb": [0.98], - "PermGroFac": [1.01], - "T_cycle": 1, - "cycles": 0, - "AgentCount": 10000, -} - -# Create an instance of the model -model = PrefShockConsumerType(**params) - -# Solve the model -model.solve() - -# Print the consumption function -print(model.solution[0].cFunc) -``` - -### ConsMedModel - -The `HARK.ConsMedModel` module includes classes and functions for solving consumption-saving models with medical expense shocks. It provides tools for representing agents and solving their optimization problems. - -#### Example - -```python -from HARK.ConsMedModel import MedShockConsumerType - -# Define the parameters for the model -params = { - "CRRA": 2.5, - "DiscFac": 0.96, - "Rfree": 1.03, - "MedShockStd": 0.2, - "LivPrb": [0.98], - "PermGroFac": [1.01], - "T_cycle": 1, - "cycles": 0, - "AgentCount": 10000, -} - -# Create an instance of the model -model = MedShockConsumerType(**params) - -# Solve the model -model.solve() - -# Print the consumption function -print(model.solution[0].cFunc) -``` - -### ConsLaborModel - -The `HARK.ConsLaborModel` module includes classes and functions for solving consumption-saving models with labor supply decisions. It provides tools for representing agents and solving their optimization problems. - -#### Example - -```python -from HARK.ConsLaborModel import LaborConsumerType - -# Define the parameters for the model -params = { - "CRRA": 2.5, - "DiscFac": 0.96, - "Rfree": 1.03, - "Wage": 1.0, - "LaborSupplyElast": 0.5, - "LivPrb": [0.98], - "PermGroFac": [1.01], - "T_cycle": 1, - "cycles": 0, - "AgentCount": 10000, -} - -# Create an instance of the model -model = LaborConsumerType(**params) - -# Solve the model -model.solve() - -# Print the consumption function -print(model.solution[0].cFunc) -``` - -### ConsBequestModel - -The `HARK.ConsBequestModel` module includes classes and functions for solving consumption-saving models with bequest motives. It provides tools for representing agents and solving their optimization problems. - -#### Example - -```python -from HARK.ConsBequestModel import BequestConsumerType - -# Define the parameters for the model -params = { - "CRRA": 2.5, - "DiscFac": 0.96, - "Rfree": 1.03, - "BequestMot": 0.5, - "LivPrb": [0.98], - "PermGroFac": [1.01], - "T_cycle": 1, - "cycles": 0, - "AgentCount": 10000, -} - -# Create an instance of the model -model = BequestConsumerType(**params) - -# Solve the model -model.solve() - -# Print the consumption function -print(model.solution[0].cFunc) -``` - -### ConsRiskyContribModel - -The `HARK.ConsRiskyContribModel` module includes classes and functions for solving consumption-saving models with risky contributions. It provides tools for representing agents and solving their optimization problems. - -#### Example - -```python -from HARK.ConsRiskyContribModel import RiskyContribConsumerType - -# Define the parameters for the model -params = { - "CRRA": 2.5, - "DiscFac": 0.96, - "Rfree": 1.03, - "RiskyContribStd": 0.2, - "LivPrb": [0.98], - "PermGroFac": [1.01], - "T_cycle": 1, - "cycles": 0, - "AgentCount": 10000, -} - -# Create an instance of the model -model = RiskyContribConsumerType(**params) - -# Solve the model -model.solve() - -# Print the consumption function -print(model.solution[0].cFunc) -``` - -### ConsRepAgentModel - -The `HARK.ConsRepAgentModel` module includes classes and functions for solving representative agent consumption-saving models. It provides tools for representing agents and solving their optimization problems. - -#### Example - -```python -from HARK.ConsRepAgentModel import RepAgentConsumerType - -# Define the parameters for the model -params = { - "CRRA": 2.5, - "DiscFac": 0.96, - "Rfree": 1.03, - "LivPrb": [0.98], - "PermGroFac": [1.01], - "T_cycle": 1, - "cycles": 0, - "AgentCount": 10000, -} - -# Create an instance of the model -model = RepAgentConsumerType(**params) - -# Solve the model -model.solve() - -# Print the consumption function -print(model.solution[0].cFunc) -``` - -### TractableBufferStockModel - -The `HARK.TractableBufferStockModel` module includes classes and functions for solving tractable buffer stock saving models. It provides tools for representing agents and solving their optimization problems. - -#### Example - -```python -from HARK.TractableBufferStockModel import TractableConsumerType - -# Define the parameters for the model -params = { - "CRRA": 2.5, - "DiscFac": 0.96, - "Rfree": 1.03, - "LivPrb": [0.98], - "PermGroFac": [1.01], - "T_cycle": 1, - "cycles": 0, - "AgentCount": 10000, -} - -# Create an instance of the model -model = TractableConsumerType(**params) - -# Solve the model -model.solve() - -# Print the consumption function -print(model.solution[0].cFunc) -``` - -## Examples - -### Gentle Introduction to HARK - -The Gentle Introduction to HARK provides an overview of the HARK toolkit and demonstrates its basic functionality through simple examples. - -#### Example - -```python -from HARK.ConsumptionSaving.ConsIndShockModel import PerfForesightConsumerType - -# Define the parameters for the model -params = { - "CRRA": 2.5, - "DiscFac": 0.96, - "Rfree": 1.03, - "LivPrb": [0.98], - "PermGroFac": [1.01], - "T_cycle": 1, - "cycles": 0, - "AgentCount": 10000, -} - -# Create an instance of the model -model = PerfForesightConsumerType(**params) - -# Solve the model -model.solve() - -# Print the consumption function -print(model.solution[0].cFunc) -``` - -### Lifecycle Model - -The Lifecycle Model demonstrates how to use HARK to solve a lifecycle consumption-saving model with age-dependent parameters. - -#### Example - -```python -from HARK.ConsumptionSaving.ConsIndShockModel import IndShockConsumerType - -# Define the parameters for the model -params = { - "CRRA": 2.5, - "DiscFac": 0.96, - "Rfree": 1.03, - "LivPrb": [0.98] * 60 + [0.0], - "PermGroFac": [1.01] * 60 + [0.0], - "T_cycle": 61, - "cycles": 1, - "AgentCount": 10000, -} - -# Create an instance of the model -model = IndShockConsumerType(**params) - -# Solve the model -model.solve() - -# Print the consumption function for the first period -print(model.solution[0].cFunc) -``` - -### IndShockConsumerType - -The IndShockConsumerType example demonstrates how to use HARK to solve a consumption-saving model with idiosyncratic shocks to income. - -#### Example - -```python -from HARK.ConsumptionSaving.ConsIndShockModel import IndShockConsumerType - -# Define the parameters for the model -params = { - "CRRA": 2.5, - "DiscFac": 0.96, - "Rfree": 1.03, - "LivPrb": [0.98], - "PermGroFac": [1.01], - "T_cycle": 1, - "cycles": 0, - "AgentCount": 10000, -} - -# Create an instance of the model -model = IndShockConsumerType(**params) - -# Solve the model -model.solve() - -# Print the consumption function -print(model.solution[0].cFunc) -``` - -### KinkedRconsumerType - -The KinkedRconsumerType example demonstrates how to use HARK to solve a consumption-saving model with a kinked interest rate. - -#### Example - -```python -from HARK.ConsumptionSaving.ConsIndShockModel import KinkedRconsumerType - -# Define the parameters for the model -params = { - "CRRA": 2.5, - "DiscFac": 0.96, - "Rfree": 1.03, - "Rboro": 1.05, - "LivPrb": [0.98], - "PermGroFac": [1.01], - "T_cycle": 1, - "cycles": 0, - "AgentCount": 10000, -} - -# Create an instance of the model -model = KinkedRconsumerType(**params) - -# Solve the model -model.solve() - -# Print the consumption function -print(model.solution[0].cFunc) -``` - -### ConsPortfolioModel - -The ConsPortfolioModel example demonstrates how to use HARK to solve a consumption-portfolio choice model. - -#### Example - -```python -from HARK.ConsPortfolioModel import PortfolioConsumerType - -# Define the parameters for the model -params = { - "CRRA": 2.5, - "DiscFac": 0.96, - "Rfree": 1.03, - "RiskyAvg": 1.08, - "RiskyStd": 0.2, - "LivPrb": [0.98], - "PermGroFac": [1.01], - "T_cycle": 1, - "cycles": 0, - "AgentCount": 10000, -} - -# Create an instance of the model -model = PortfolioConsumerType(**params) - -# Solve the model -model.solve() - -# Print the consumption function -print(model.solution[0].cFunc) -``` - -### GenIncProcessModel - -The GenIncProcessModel example demonstrates how to use HARK to solve a consumption-saving model with a general income process. - -#### Example - -```python -from HARK.ConsumptionSaving.ConsGenIncProcessModel import GenIncProcessConsumerType - -# Define the parameters for the model -params = { - "CRRA": 2.5, - "DiscFac": 0.96, - "Rfree": 1.03, - "LivPrb": [0.98], - "PermGroFac": [1.01], - "T_cycle": 1, - "cycles": 0, - "AgentCount": 10000, -} - -# Create an instance of the model -model = GenIncProcessConsumerType(**params) - -# Solve the model -model.solve() - -# Print the consumption function -print(model.solution[0].cFunc) -``` - -### How We Solve IndShockConsumerType - -The How We Solve IndShockConsumerType example provides a detailed explanation of the steps involved in solving a consumption-saving model with idiosyncratic shocks to income. - -#### Example - -```python -from HARK.ConsumptionSaving.ConsIndShockModel import IndShockConsumerType - -# Define the parameters for the model -params = { - "CRRA": 2.5, - "DiscFac": 0.96, - "Rfree": 1.03, - "LivPrb": [0.98], - "PermGroFac": [1.01], - "T_cycle": 1, - "cycles": 0, - "AgentCount": 10000, -} - -# Create an instance of the model -model = IndShockConsumerType(**params) - -# Solve the model -model.solve() - -# Print the consumption function -print(model.solution[0].cFunc) -``` - -### Journey-PhD - -The Journey-PhD example demonstrates how to use HARK to solve a consumption-saving model with a PhD journey. - -#### Example - -```python -from HARK.ConsumptionSaving.ConsIndShockModel import IndShockConsumerType - -# Define the parameters for the model -params = { - "CRRA": 2.5, - "DiscFac": 0.96, - "Rfree": 1.03, - "LivPrb": [0.98], - "PermGroFac": [1.01], - "T_cycle": 1, - "cycles": 0, - "AgentCount": 10000, -} - -# Create an instance of the model -model = IndShockConsumerType(**params) - -# Solve the model -model.solve() - -# Print the consumption function -print(model.solution[0].cFunc) -``` - -### Transition Matrix Example - -The Transition Matrix Example demonstrates how to use HARK to solve a consumption-saving model with a transition matrix. - -#### Example - -```python -from HARK.ConsumptionSaving.ConsMarkovModel import MarkovConsumerType - -# Define the parameters for the model -params = { - "CRRA": 2.5, - "DiscFac": 0.96, - "Rfree": 1.03, - "MarkovPrb": [[0.9, 0.1], [0.1, 0.9]], - "LivPrb": [0.98], - "PermGroFac": [1.01], - "T_cycle": 1, - "cycles": 0, - "AgentCount": 10000, -} - -# Create an instance of the model -model = MarkovConsumerType(**params) - -# Solve the model -model.solve() - -# Print the consumption function -print(model.solution[0].cFunc) -``` - -### Jacobian Example - -The Jacobian Example demonstrates how to use HARK to solve a consumption-saving model with a Jacobian matrix. - -#### Example - -```python -from HARK.ConsumptionSaving.ConsIndShockModel import IndShockConsumerType - -# Define the parameters for the model -params = { - "CRRA": 2.5, - "DiscFac": 0.96, - "Rfree": 1.03, - "LivPrb": [0.98], - "PermGroFac": [1.01], - "T_cycle": 1, - "cycles": 0, - "AgentCount": 10000, -} - -# Create an instance of the model -model = IndShockConsumerType(**params) - -# Solve the model -model.solve() - -# Print the consumption function -print(model.solution[0].cFunc) -``` - -### KS-HARK Presentation - -The KS-HARK Presentation demonstrates how to use HARK to solve a consumption-saving model with a KS-HARK presentation. - -#### Example - -```python -from HARK.ConsumptionSaving.ConsIndShockModel import IndShockConsumerType - -# Define the parameters for the model -params = { - "CRRA": 2.5, - "DiscFac": 0.96, - "Rfree": 1.03, - "LivPrb": [0.98], - "PermGroFac": [1.01], - "T_cycle": 1, - "cycles": 0, - "AgentCount": 10000, -} - -# Create an instance of the model -model = IndShockConsumerType(**params) - -# Solve the model -model.solve() - -# Print the consumption function -print(model.solution[0].cFunc) -``` - -### SSJ Example - -The SSJ Example demonstrates how to use HARK to solve a consumption-saving model with an SSJ example. - -#### Example - -```python -from HARK.ConsumptionSaving.ConsIndShockModel import IndShockConsumerType - -# Define the parameters for the model -params = { - "CRRA": 2.5, - "DiscFac": 0.96, - "Rfree": 1.03, - "LivPrb": [0.98], - "PermGroFac": [1.01], - "T_cycle": 1, - "cycles": 0, - "AgentCount": 10000, -} - -# Create an instance of the model -model = IndShockConsumerType(**params) - -# Solve the model -model.solve() - -# Print the consumption function -print(model.solution[0].cFunc) -``` - -### Accidental Bequest Comparison - -The Accidental Bequest Comparison example demonstrates how to use HARK to solve a consumption-saving model with accidental bequests. - -#### Example - -```python -from HARK.ConsBequestModel import BequestConsumerType - -# Define the parameters for the model -params = { - "CRRA": 2.5, - "DiscFac": 0.96, - "Rfree": 1.03, - "BequestMot": 0.5, - "LivPrb": [0.98], - "PermGroFac": [1.01], - "T_cycle": 1, - "cycles": 0, - "AgentCount": 10000, -} - -# Create an instance of the model -model = BequestConsumerType(**params) - -# Solve the model -model.solve() - -# Print the consumption function -print(model.solution[0].cFunc) -``` - -### Accidental Bequest Portfolio Comparison - -The Accidental Bequest Portfolio Comparison example demonstrates how to use HARK to solve a consumption-saving model with accidental bequests and portfolio choice. - -#### Example - -```python -from HARK.ConsBequestModel import BequestPortfolioConsumerType - -# Define the parameters for the model -params = { - "CRRA": 2.5, - "DiscFac": 0.96, - "Rfree": 1.03, - "BequestMot": 0.5, - "RiskyAvg": 1.08, - "RiskyStd": 0.2, - "LivPrb": [0.98], - "PermGroFac": [1.01], - "T_cycle": 1, - "cycles": 0, - "AgentCount": 10000, -} - -# Create an instance of the model -model = BequestPortfolioConsumerType(**params) - -# Solve the model -model.solve() - -# Print the consumption function -print(model.solution[0].cFunc) -``` - -### Terminal Bequest - -The Terminal Bequest example demonstrates how to use HARK to solve a consumption-saving model with terminal bequests. - -#### Example - -```python -from HARK.ConsBequestModel import TerminalBequestConsumerType - -# Define the parameters for the model -params = { - "CRRA": 2.5, - "DiscFac": 0.96, - "Rfree": 1.03, - "BequestMot": 0.5, - "LivPrb": [0.98], - "PermGroFac": [1.01], - "T_cycle": 1, - "cycles": 0, - "AgentCount": 10000, -} - -# Create an instance of the model -model = TerminalBequestConsumerType(**params) - -# Solve the model -model.solve() - -# Print the consumption function -print(model.solution[0].cFunc) -``` - -### Terminal Bequest Portfolio - -The Terminal Bequest Portfolio example demonstrates how to use HARK to solve a consumption-saving model with terminal bequests and portfolio choice. - -#### Example - -```python -from HARK.ConsBequestModel import TerminalBequestPortfolioConsumerType - -# Define the parameters for the model -params = { - "CRRA": 2.5, - "DiscFac": 0.96, - "Rfree": 1.03, - "BequestMot": 0.5, - "RiskyAvg": 1.08, - "RiskyStd": 0.2, - "LivPrb": [0.98], - "PermGroFac": [1.01], - "T_cycle": 1, - "cycles": 0, - "AgentCount": 10000, -} - -# Create an instance of the model -model = TerminalBequestPortfolioConsumerType(**params) - -# Solve the model -model.solve() - -# Print the consumption function -print(model.solution[0].cFunc) -``` - -### Warm Glow Bequest - -The Warm Glow Bequest example demonstrates how to use HARK to solve a consumption-saving model with warm glow bequests. - -#### Example - -```python -from HARK.ConsBequestModel import WarmGlowBequestConsumerType - -# Define the parameters for the model -params = { - "CRRA": 2.5, - "DiscFac": 0.96, - "Rfree": 1.03, - "BequestMot": 0.5, - "LivPrb": [0.98], - "PermGroFac": [1.01], - "T_cycle": 1, - "cycles": 0, - "AgentCount": 10000, -} - -# Create an instance of the model -model = WarmGlowBequestConsumerType(**params) - -# Solve the model -model.solve() - -# Print the consumption function -print(model.solution[0].cFunc) -``` - -### Warm Glow Bequest Portfolio - -The Warm Glow Bequest Portfolio example demonstrates how to use HARK to solve a consumption-saving model with warm glow bequests and portfolio choice. - -#### Example - -```python -from HARK.ConsBequestModel import WarmGlowBequestPortfolioConsumerType - -# Define the parameters for the model -params = { - "CRRA": 2.5, - "DiscFac": 0.96, - "Rfree": 1.03, - "BequestMot": 0.5, - "RiskyAvg": 1.08, - "RiskyStd": 0.2, - "LivPrb": [0.98], - "PermGroFac": [1.01], - "T_cycle": 1, - "cycles": 0, - "AgentCount": 10000, -} - -# Create an instance of the model -model = WarmGlowBequestPortfolioConsumerType(**params) - -# Solve the model -model.solve() - -# Print the consumption function -print(model.solution[0].cFunc) -``` - -### Wealth Portfolio - -The Wealth Portfolio example demonstrates how to use HARK to solve a consumption-saving model with wealth portfolio choice. - -#### Example - -```python -from HARK.ConsPortfolioModel import WealthPortfolioConsumerType - -# Define the parameters for the model -params = { - "CRRA": 2.5, - "DiscFac": 0.96, - "Rfree": 1.03, - "RiskyAvg": 1.08, - "RiskyStd": 0.2, - "LivPrb": [0.98], - "PermGroFac": [1.01], - "T_cycle": 1, - "cycles": 0, - "AgentCount": 10000, -} - -# Create an instance of the model -model = WealthPortfolioConsumerType(**params) - -# Solve the model -model.solve() - -# Print the consumption function -print(model.solution[0].cFunc) -``` - -### Finite Cyclical Test - -The Finite Cyclical Test example demonstrates how to use HARK to solve a consumption-saving model with finite cyclical behavior. - -#### Example - -```python -from HARK.ConsumptionSaving.ConsIndShockModel import IndShockConsumerType - -# Define the parameters for the model -params = { - "CRRA": 2.5, - "DiscFac": 0.96, - "Rfree": 1.03, - "LivPrb": [0.98], - "PermGroFac": [1.01], - "T_cycle": 1, - "cycles": 5, - "AgentCount": 10000, -} - -# Create an instance of the model -model = IndShockConsumerType(**params) - -# Solve the model -model.solve() - -# Print the consumption function -print(model.solution[0].cFunc) -``` - -### SSJ Explanation - -The SSJ Explanation example provides a detailed explanation of the steps involved in solving a consumption-saving model with an SSJ example. - -#### Example - -```python -from HARK.ConsumptionSaving.ConsIndShockModel import IndShockConsumerType - -# Define the parameters for the model -params = { - "CRRA": 2.5, - "DiscFac": 0.96, - "Rfree": 1.03, - "LivPrb": [0.98], - "PermGroFac": [1.01], - "T_cycle": 1, - "cycles": 0, - "AgentCount": 10000, -} - -# Create an instance of the model -model = IndShockConsumerType(**params) - -# Solve the model -model.solve() - -# Print the consumption function -print(model.solution[0].cFunc) -``` - -### ConsRiskyAssetModel - -The ConsRiskyAssetModel example demonstrates how to use HARK to solve a consumption-saving model with risky assets. - -#### Example - -```python -from HARK.ConsPortfolioModel import RiskyAssetConsumerType - -# Define the parameters for the model -params = { - "CRRA": 2.5, - "DiscFac": 0.96, - "Rfree": 1.03, - "RiskyAvg": 1.08, - "RiskyStd": 0.2, - "LivPrb": [0.98], - "PermGroFac": [1.01], - "T_cycle": 1, - "cycles": 0, - "AgentCount": 10000, -} - -# Create an instance of the model -model = RiskyAssetConsumerType(**params) - -# Solve the model -model.solve() - -# Print the consumption function -print(model.solution[0].cFunc) -``` - -### ConsSequentialPortfolioModel - -The ConsSequentialPortfolioModel example demonstrates how to use HARK to solve a consumption-saving model with sequential portfolio choice. - -#### Example - -```python -from HARK.ConsPortfolioModel import SequentialPortfolioConsumerType - -# Define the parameters for the model -params = { - "CRRA": 2.5, - "DiscFac": 0.96, - "Rfree": 1.03, - "RiskyAvg": 1.08, - "RiskyStd": 0.2, - "LivPrb": [0.98], - "PermGroFac": [1.01], - "T_cycle": 1, - "cycles": 0, - "AgentCount": 10000, -} - -# Create an instance of the model -model = SequentialPortfolioConsumerType(**params) - -# Solve the model -model.solve() - -# Print the consumption function -print(model.solution[0].cFunc) -``` - -### ConsAggShockModel - -The ConsAggShockModel example demonstrates how to use HARK to solve a consumption-saving model with aggregate shocks. - -#### Example - -```python -from HARK.ConsAggShockModel import AggShockConsumerType - -# Define the parameters for the model -params = { - "CRRA": 2.5, - "DiscFac": 0.96, - "Rfree": 1.03, - "AggShockStd": 0.02, - "LivPrb": [0.98], - "PermGroFac": [1.01], - "T_cycle": 1, - "cycles": 0, - "AgentCount": 10000, -} - -# Create an instance of the model -model = AggShockConsumerType(**params) - -# Solve the model -model.solve() - -# Print the consumption function -print(model.solution[0].cFunc) -``` - -### ConsGenIncProcessModel - -The ConsGenIncProcessModel example demonstrates how to use HARK to solve a consumption-saving model with a general income process. - -#### Example - -```python -from HARK.ConsumptionSaving.ConsGenIncProcessModel import GenIncProcessConsumerType - -# Define the parameters for the model -params = { - "CRRA": 2.5, - "DiscFac": 0.96, - "Rfree": 1.03, - "LivPrb": [0.98], - "PermGroFac": [1.01], - "T_cycle": 1, - "cycles": 0, - "AgentCount": 10000, -} - -# Create an instance of the model -model = GenIncProcessConsumerType(**params) - -# Solve the model -model.solve() - -# Print the consumption function -print(model.solution[0].cFunc) -``` - -### How We Solve diff --git a/Documentation/reference/ConsumptionSaving/ConsAggShockModel.rst b/Documentation/reference/ConsumptionSaving/ConsAggShockModel.rst new file mode 100644 index 000000000..ae159de8c --- /dev/null +++ b/Documentation/reference/ConsumptionSaving/ConsAggShockModel.rst @@ -0,0 +1,7 @@ +ConsAggShockModel +-------------------- + +.. automodule:: HARK.ConsumptionSaving.ConsAggShockModel + :members: + :undoc-members: + :show-inheritance: diff --git a/Documentation/reference/ConsumptionSaving/ConsBequestModel.rst b/Documentation/reference/ConsumptionSaving/ConsBequestModel.rst new file mode 100644 index 000000000..2afa3bf35 --- /dev/null +++ b/Documentation/reference/ConsumptionSaving/ConsBequestModel.rst @@ -0,0 +1,7 @@ +ConsBequestModel +-------------------- + +.. automodule:: HARK.ConsumptionSaving.ConsBequestModel + :members: + :undoc-members: + :show-inheritance: diff --git a/Documentation/reference/ConsumptionSaving/ConsGenIncProcessModel.rst b/Documentation/reference/ConsumptionSaving/ConsGenIncProcessModel.rst new file mode 100644 index 000000000..3a06764eb --- /dev/null +++ b/Documentation/reference/ConsumptionSaving/ConsGenIncProcessModel.rst @@ -0,0 +1,7 @@ +ConsGenIncProcessModel +------------------------------ + +.. automodule:: HARK.ConsumptionSaving.ConsGenIncProcessModel + :members: + :undoc-members: + :show-inheritance: diff --git a/Documentation/reference/ConsumptionSaving/ConsIndShockModel.rst b/Documentation/reference/ConsumptionSaving/ConsIndShockModel.rst new file mode 100644 index 000000000..2a969aae3 --- /dev/null +++ b/Documentation/reference/ConsumptionSaving/ConsIndShockModel.rst @@ -0,0 +1,7 @@ +ConsIndShockModel +---------------------------- + +.. automodule:: HARK.ConsumptionSaving.ConsIndShockModel + :members: + :undoc-members: + :show-inheritance: diff --git a/Documentation/reference/ConsumptionSaving/ConsIndShockModelFast.rst b/Documentation/reference/ConsumptionSaving/ConsIndShockModelFast.rst new file mode 100644 index 000000000..68a3c2e46 --- /dev/null +++ b/Documentation/reference/ConsumptionSaving/ConsIndShockModelFast.rst @@ -0,0 +1,7 @@ +ConsIndShockModelFast +---------------------------- + +.. automodule:: HARK.ConsumptionSaving.ConsIndShockModelFast + :members: + :undoc-members: + :show-inheritance: diff --git a/Documentation/reference/ConsumptionSaving/ConsLaborModel.rst b/Documentation/reference/ConsumptionSaving/ConsLaborModel.rst new file mode 100644 index 000000000..9f44cca11 --- /dev/null +++ b/Documentation/reference/ConsumptionSaving/ConsLaborModel.rst @@ -0,0 +1,7 @@ +ConsLaborModel +-------------------------- + +.. automodule:: HARK.ConsumptionSaving.ConsLaborModel + :members: + :undoc-members: + :show-inheritance: diff --git a/Documentation/reference/ConsumptionSaving/ConsMarkovModel.rst b/Documentation/reference/ConsumptionSaving/ConsMarkovModel.rst new file mode 100644 index 000000000..9a44bc439 --- /dev/null +++ b/Documentation/reference/ConsumptionSaving/ConsMarkovModel.rst @@ -0,0 +1,7 @@ +ConsMarkovModel +-------------------- + +.. automodule:: HARK.ConsumptionSaving.ConsMarkovModel + :members: + :undoc-members: + :show-inheritance: diff --git a/Documentation/reference/ConsumptionSaving/ConsMedModel.rst b/Documentation/reference/ConsumptionSaving/ConsMedModel.rst new file mode 100644 index 000000000..e151c32e5 --- /dev/null +++ b/Documentation/reference/ConsumptionSaving/ConsMedModel.rst @@ -0,0 +1,7 @@ +ConsMedModel +------------------- + +.. automodule:: HARK.ConsumptionSaving.ConsMedModel + :members: + :undoc-members: + :show-inheritance: diff --git a/Documentation/reference/ConsumptionSaving/ConsPortfolioFrameModel.rst b/Documentation/reference/ConsumptionSaving/ConsPortfolioFrameModel.rst new file mode 100644 index 000000000..5c783c31a --- /dev/null +++ b/Documentation/reference/ConsumptionSaving/ConsPortfolioFrameModel.rst @@ -0,0 +1,7 @@ +ConsPortfolioFrameModel +----------------------- + +.. automodule:: HARK.ConsumptionSaving.ConsPortfolioFrameModel + :members: + :undoc-members: + :show-inheritance: diff --git a/Documentation/reference/ConsumptionSaving/ConsPortfolioModel.rst b/Documentation/reference/ConsumptionSaving/ConsPortfolioModel.rst new file mode 100644 index 000000000..e46f1e129 --- /dev/null +++ b/Documentation/reference/ConsumptionSaving/ConsPortfolioModel.rst @@ -0,0 +1,7 @@ +ConsPortfolioModel +----------------------- + +.. automodule:: HARK.ConsumptionSaving.ConsPortfolioModel + :members: + :undoc-members: + :show-inheritance: diff --git a/Documentation/reference/ConsumptionSaving/ConsPrefShochModel.rst b/Documentation/reference/ConsumptionSaving/ConsPrefShochModel.rst new file mode 100644 index 000000000..4fcc2f0f9 --- /dev/null +++ b/Documentation/reference/ConsumptionSaving/ConsPrefShochModel.rst @@ -0,0 +1,7 @@ +ConsPrefShockModel +--------------------------- + +.. automodule:: HARK.ConsumptionSaving.ConsPrefShockModel + :members: + :undoc-members: + :show-inheritance: diff --git a/Documentation/reference/ConsumptionSaving/ConsRepAgentModel.rst b/Documentation/reference/ConsumptionSaving/ConsRepAgentModel.rst new file mode 100644 index 000000000..5ff47aa94 --- /dev/null +++ b/Documentation/reference/ConsumptionSaving/ConsRepAgentModel.rst @@ -0,0 +1,7 @@ +ConsRepAgentModel +-------------------------- + +.. automodule:: HARK.ConsumptionSaving.ConsRepAgentModel + :members: + :undoc-members: + :show-inheritance: diff --git a/Documentation/reference/ConsumptionSaving/ConsRiskyAssetModel.rst b/Documentation/reference/ConsumptionSaving/ConsRiskyAssetModel.rst new file mode 100644 index 000000000..4ba170337 --- /dev/null +++ b/Documentation/reference/ConsumptionSaving/ConsRiskyAssetModel.rst @@ -0,0 +1,7 @@ +ConsRiskyAssetModel +----------------------- + +.. automodule:: HARK.ConsumptionSaving.ConsRiskyAssetModel + :members: + :undoc-members: + :show-inheritance: diff --git a/Documentation/reference/ConsumptionSaving/ConsRiskyContribModel.rst b/Documentation/reference/ConsumptionSaving/ConsRiskyContribModel.rst new file mode 100644 index 000000000..d8dcca46b --- /dev/null +++ b/Documentation/reference/ConsumptionSaving/ConsRiskyContribModel.rst @@ -0,0 +1,7 @@ +ConsRiskyContribModel +----------------------- + +.. automodule:: HARK.ConsumptionSaving.ConsRiskyContribModel + :members: + :undoc-members: + :show-inheritance: diff --git a/Documentation/reference/ConsumptionSaving/TractableBufferStockModel.rst b/Documentation/reference/ConsumptionSaving/TractableBufferStockModel.rst new file mode 100644 index 000000000..556723e97 --- /dev/null +++ b/Documentation/reference/ConsumptionSaving/TractableBufferStockModel.rst @@ -0,0 +1,7 @@ +TractableBufferStockModel +-------------------------- + +.. automodule:: HARK.ConsumptionSaving.TractableBufferStockModel + :members: + :undoc-members: + :show-inheritance: diff --git a/Documentation/reference/ConsumptionSaving/index.rst b/Documentation/reference/ConsumptionSaving/index.rst new file mode 100644 index 000000000..2e25b653a --- /dev/null +++ b/Documentation/reference/ConsumptionSaving/index.rst @@ -0,0 +1,6 @@ +:orphan: + +Consumption Saving +================== + +See :doc:`../index`. diff --git a/Documentation/reference/index.rst b/Documentation/reference/index.rst new file mode 100644 index 000000000..07f65f6e1 --- /dev/null +++ b/Documentation/reference/index.rst @@ -0,0 +1,43 @@ +API Reference +============= + +.. toctree:: + :caption: Tools + :maxdepth: 1 + + tools/core + tools/dcegm + tools/distribution + tools/econforgeinterp + tools/estimation + tools/frame + tools/helpers + tools/interpolation + tools/incomeprocess + tools/model + tools/numba_tools + tools/parallel + tools/rewards + tools/simulation + tools/utilities + tools/validators + +.. toctree:: + :caption: Models + :maxdepth: 1 + + ConsumptionSaving/ConsAggShockModel + ConsumptionSaving/ConsBequestModel + ConsumptionSaving/ConsGenIncProcessModel + ConsumptionSaving/ConsIndShockModel + ConsumptionSaving/ConsIndShockModelFast + ConsumptionSaving/ConsLaborModel + ConsumptionSaving/ConsMarkovModel + ConsumptionSaving/ConsMedModel + ConsumptionSaving/ConsPortfolioFrameModel + ConsumptionSaving/ConsPortfolioModel + ConsumptionSaving/ConsPrefShochModel + ConsumptionSaving/ConsRepAgentModel + ConsumptionSaving/ConsRiskyAssetModel + ConsumptionSaving/ConsRiskyContribModel + ConsumptionSaving/TractableBufferStockModel diff --git a/Documentation/reference/tools/core.rst b/Documentation/reference/tools/core.rst new file mode 100644 index 000000000..c16ace476 --- /dev/null +++ b/Documentation/reference/tools/core.rst @@ -0,0 +1,7 @@ +Core +-------- + +.. automodule:: HARK.core + :members: + :undoc-members: + :show-inheritance: diff --git a/Documentation/reference/tools/dcegm.rst b/Documentation/reference/tools/dcegm.rst new file mode 100644 index 000000000..80a2f612f --- /dev/null +++ b/Documentation/reference/tools/dcegm.rst @@ -0,0 +1,7 @@ +dcegm +-------- + +.. automodule:: HARK.dcegm + :members: + :undoc-members: + :show-inheritance: diff --git a/Documentation/reference/tools/distribution.rst b/Documentation/reference/tools/distribution.rst new file mode 100644 index 000000000..6d2627fcd --- /dev/null +++ b/Documentation/reference/tools/distribution.rst @@ -0,0 +1,7 @@ +Distribution +------------- + +.. automodule:: HARK.distribution + :members: + :undoc-members: + :show-inheritance: diff --git a/Documentation/reference/tools/econforgeinterp.rst b/Documentation/reference/tools/econforgeinterp.rst new file mode 100644 index 000000000..9f0b7aa25 --- /dev/null +++ b/Documentation/reference/tools/econforgeinterp.rst @@ -0,0 +1,7 @@ +Econforgeinterp +--------------- + +.. automodule:: HARK.econforgeinterp + :members: + :undoc-members: + :show-inheritance: diff --git a/Documentation/reference/tools/estimation.rst b/Documentation/reference/tools/estimation.rst new file mode 100644 index 000000000..943b7c887 --- /dev/null +++ b/Documentation/reference/tools/estimation.rst @@ -0,0 +1,7 @@ +Estimation +------------- + +.. automodule:: HARK.estimation + :members: + :undoc-members: + :show-inheritance: diff --git a/Documentation/reference/tools/frame.rst b/Documentation/reference/tools/frame.rst new file mode 100644 index 000000000..677c95a3d --- /dev/null +++ b/Documentation/reference/tools/frame.rst @@ -0,0 +1,7 @@ +Frame +------------- + +.. automodule:: HARK.frame + :members: + :undoc-members: + :show-inheritance: diff --git a/Documentation/reference/tools/helpers.rst b/Documentation/reference/tools/helpers.rst new file mode 100644 index 000000000..8346f56dd --- /dev/null +++ b/Documentation/reference/tools/helpers.rst @@ -0,0 +1,7 @@ +Helpers +------------- + +.. automodule:: HARK.helpers + :members: + :undoc-members: + :show-inheritance: diff --git a/Documentation/reference/tools/incomeprocess.rst b/Documentation/reference/tools/incomeprocess.rst new file mode 100644 index 000000000..9c0c6d686 --- /dev/null +++ b/Documentation/reference/tools/incomeprocess.rst @@ -0,0 +1,11 @@ +Calibration +------------- + +.. automodule:: HARK.Calibration.Income.IncomeProcesses + :members: + :undoc-members: + :show-inheritance: +.. automodule:: HARK.Calibration.Assets.AssetProcesses + :members: + :undoc-members: + :show-inheritance: diff --git a/Documentation/reference/tools/index.rst b/Documentation/reference/tools/index.rst new file mode 100644 index 000000000..c1b8339b4 --- /dev/null +++ b/Documentation/reference/tools/index.rst @@ -0,0 +1,6 @@ +:orphan: + +Tools +===== + +See :doc:`../index`. diff --git a/Documentation/reference/tools/interpolation.rst b/Documentation/reference/tools/interpolation.rst new file mode 100644 index 000000000..9e126ca34 --- /dev/null +++ b/Documentation/reference/tools/interpolation.rst @@ -0,0 +1,7 @@ +Interpolation +------------- + +.. automodule:: HARK.interpolation + :members: + :undoc-members: + :show-inheritance: diff --git a/Documentation/reference/tools/model.rst b/Documentation/reference/tools/model.rst new file mode 100644 index 000000000..141b2ac93 --- /dev/null +++ b/Documentation/reference/tools/model.rst @@ -0,0 +1,7 @@ +Model +------------- + +.. automodule:: HARK.model + :members: + :undoc-members: + :show-inheritance: diff --git a/Documentation/reference/tools/numba_tools.rst b/Documentation/reference/tools/numba_tools.rst new file mode 100644 index 000000000..d7f67e8cf --- /dev/null +++ b/Documentation/reference/tools/numba_tools.rst @@ -0,0 +1,7 @@ +Numba Tools +------------- + +.. automodule:: HARK.numba_tools + :members: + :undoc-members: + :show-inheritance: diff --git a/Documentation/reference/tools/parallel.rst b/Documentation/reference/tools/parallel.rst new file mode 100644 index 000000000..0fa730c8e --- /dev/null +++ b/Documentation/reference/tools/parallel.rst @@ -0,0 +1,7 @@ +Parallel +---------- + +.. automodule:: HARK.parallel + :members: + :undoc-members: + :show-inheritance: diff --git a/Documentation/reference/tools/rewards.rst b/Documentation/reference/tools/rewards.rst new file mode 100644 index 000000000..dd4b1c54f --- /dev/null +++ b/Documentation/reference/tools/rewards.rst @@ -0,0 +1,7 @@ +Rewards +---------- + +.. automodule:: HARK.rewards + :members: + :undoc-members: + :show-inheritance: diff --git a/Documentation/reference/tools/simulation.rst b/Documentation/reference/tools/simulation.rst new file mode 100644 index 000000000..a56040159 --- /dev/null +++ b/Documentation/reference/tools/simulation.rst @@ -0,0 +1,7 @@ +Simulation +------------ + +.. automodule:: HARK.simulation.monte_carlo + :members: + :undoc-members: + :show-inheritance: diff --git a/Documentation/reference/tools/utilities.rst b/Documentation/reference/tools/utilities.rst new file mode 100644 index 000000000..81c2b909f --- /dev/null +++ b/Documentation/reference/tools/utilities.rst @@ -0,0 +1,7 @@ +Utilities +---------- + +.. automodule:: HARK.utilities + :members: + :undoc-members: + :show-inheritance: diff --git a/Documentation/reference/tools/validators.rst b/Documentation/reference/tools/validators.rst new file mode 100644 index 000000000..df5abf338 --- /dev/null +++ b/Documentation/reference/tools/validators.rst @@ -0,0 +1,7 @@ +Validators +------------- + +.. automodule:: HARK.validators + :members: + :undoc-members: + :show-inheritance: