Skip to content

Commit

Permalink
Merge branch 'master' into plumbing/more_param_types
Browse files Browse the repository at this point in the history
  • Loading branch information
mnwhite authored Jun 28, 2024
2 parents 2c985e0 + d86eb93 commit 2ece3ea
Show file tree
Hide file tree
Showing 266 changed files with 79,775 additions and 7,058 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -289,3 +289,6 @@ settings.json
.spyderproject
spyproject
.spyproject

# 20240608: CDC added *private* to avoid accidentally uploading private material
*private*
66 changes: 51 additions & 15 deletions Documentation/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,69 @@ For more information on HARK, see [our Github organization](https://github.com/e

## Changes

### 0.15.0 (in development)
### 0.15.2 (in development)

Release Date: TBA
Release Date: TBD

### Major Changes
#### Major Changes

none yet

#### Minor Changes

- Fixes bug in `AgentPopulation` that caused discretization of distributions to not work. [1275](https://github.com/econ-ark/HARK/pull/1275)
- Adds support for distributions, booleans, and callables as parameters in the `Parameters` class. [1387](https://github.com/econ-ark/HARK/pull/1387)

### 0.15.1

Release Date: June 15, 2024

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

#### Major Changes

none

- Replace object-oriented solvers with single function versions. [1394](https://github.com/econ-ark/HARK/pull/1394)
#### Minor Changes

- Adds example of integration of HARK with SSJ toolkit. [#1447](https://github.com/econ-ark/HARK/pull/1447)
- Maintains compatibility between EconForge interpolation and numba [#1457](https://github.com/econ-ark/HARK/pull/1457)

### 0.15.0

Release Date: June 4, 2024

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

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

#### Major Changes

- Drop official support for Python 3.8 and 3.9, add support for 3.11 and 3.12. [#1415](https://github.com/econ-ark/HARK/pull/1415)
- Replace object-oriented solvers with single function versions. [#1394](https://github.com/econ-ark/HARK/pull/1394)
- Object-oriented solver code has been moved to /HARK/ConsumptionSaving/LegacyOOsolvers.py, for legacy support of downstream projects.
- AgentTypeMonteCarloSimulator now requires model shock, parameter, and dynamics information to be organized into 'blocks'. The DBlock object is introduced. [#1411](https://github.com/econ-ark/HARK/pull/1411)
- RBlock object allows for recursive composition of DBlocks in models, as demonstrated by the AgentTypeMonteCarloSimulator [#1417](https://github.com/econ-ark/HARK/pull/1417/)
- Transtion, reward, state-rulle value function, decision value function, and arrival value function added to DBlock [#1417](https://github.com/econ-ark/HARK/pull/1417/)
- All methods that construct inputs for solvers are now functions that are specified in the dictionary attribute `constructors`. [#1410](https://github.com/econ-ark/HARK/pull/1410)
- Such constructed inputs can use alternate parameterizations / formats by changing the `constructor` function and providing its arguments in `parameters`.
- Move `HARK.datasets` to `HARK.Calibration` for better organization of data and calibration tools. [#1430](https://github.com/econ-ark/HARK/pull/1430)

#### Minor Changes

### Minor Changes

- Adds support for distributions, booleans, and callables as parameters in the `Parameters` class. [1387](https://github.com/econ-ark/HARK/pull/1387)
- Add option to pass pre-built grid to `LinearFast`. [1388](https://github.com/econ-ark/HARK/pull/1388)
- Moves calculation of stable points out of ConsIndShock solver, into method called by post_solve [#1349](https://github.com/econ-ark/HARK/pull/1349)
- Adds cubic spline interpolation and value function construction to "warm glow bequest" models.
- Fixes cubic spline interpolation for ConsMedShockModel.
- Moves computation of "stable points" from inside of ConsIndShock solver to a post-solution method. [1349](https://github.com/econ-ark/HARK/pull/1349)
- Corrects calculation of "human wealth" under risky returns, providing correct limiting linear consumption function. [1403](https://github.com/econ-ark/HARK/pull/1403)
- Moves computation of "stable points" from inside of ConsIndShock solver to a post-solution method. [#1349](https://github.com/econ-ark/HARK/pull/1349)
- Corrects calculation of "human wealth" under risky returns, providing correct limiting linear consumption function. [#1403](https://github.com/econ-ark/HARK/pull/1403)
- Removed 'parameters' from new block definitions; these are now 'calibrations' provided separately.
- Create functions for well-known and repeated calculations in single-function solvers. [1395](https://github.com/econ-ark/HARK/pull/1395)
- Re-work WealthPortfolioSolver to use approximate EGM method [#1404](https://github.com/econ-ark/HARK/pull/1404)
- Default parameter dictionaries for AgentType subclasses have been "flattened": all parameters appear in one place for each model, rather than inheriting from parent models' dictionaries. The only exception is submodels *within* a file when only 1 or 2 parameters are added or changed. [#1425](https://github.com/econ-ark/HARK/pull/1425)
- Fix minor bug in `HARK.distribution.Bernoulli` to allow conversion into `DiscreteDistributionLabeled`. [#1432](https://github.com/econ-ark/HARK/pull/1432)


### 0.14.1

Expand Down Expand Up @@ -57,13 +100,6 @@ Release Date: February 12, 2024
- Adds option `sim_common_Rrisky` to control whether risky-asset models draw common or idiosyncratic returns in simulation. [#1250](https://github.com/econ-ark/HARK/pull/1250),[#1253](https://github.com/econ-ark/HARK/pull/1253)
- Addresses [#1255](https://github.com/econ-ark/HARK/issues/1255). Makes age-varying stochastic returns possible and draws from their discretized version. [#1262](https://github.com/econ-ark/HARK/pull/1262)
- Fixes bug in the metric that compares dictionaries with the same keys. [#1260](https://github.com/econ-ark/HARK/pull/1260)
- Fixes bug in the calc_jacobian method. [#1342](https://github.com/econ-ark/HARK/pull/1342)
- Fixes bug that prevented risky-asset consumer types from working with time-varying interest rates `Rfree`. [1343](https://github.com/econ-ark/HARK/pull/1343)
- Overhauls and expands condition checking for the ConsIndShock model [#1294](https://github.com/econ-ark/HARK/pull/1294). Condition values and a description of their interpretation is stored in the bilt dictionary of IndShockConsumerType.
- Creates a `models/` directory with Python model configurations for perfect foresight and Fisher 2-period models. [1347](https://github.com/econ-ark/HARK/pull/1347)
- Fixes bug in AgentType simulations where 'who_dies' for period t was being recorded in period t-1 in the history Carlo simulation functions using Python model configurations.[1296](https://github.com/econ-ark/HARK/pull/1296)
- Removes unused `simulation.py` .[1296](https://github.com/econ-ark/HARK/pull/1296)
- Fixes bug that default seed was being used in the initializing of income shock distributions. [1380](https://github.com/econ-ark/HARK/pull/1380)

### 0.13.0

Expand Down
14 changes: 14 additions & 0 deletions Documentation/NARK/.latexmkrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# -*- mode: shell-script; coding: utf-8 -*-
# Google 'latexmk' for explanation of this config file
# latexmk at unix command line will compile the paper
$do_cd = 1;
#$clean_ext = "nav out snm dvi idv tmp xref 4tc out aux log fls fdb_latexmk synctex.gz toc svg png 4ct ps out.ps mk4 lg cfg css html yml upa upb";
@generated_exts = (@generated_exts, 'blg','fdb_latexmk','fls', 'idv','md.tmp','mk4','lg','snm','synctex.gz', 'tex.cfg','nav','out','ps','ps_out','tex.mk4', 'tmp', 'upa','upb','toc','4ct');
$bibtex_use=2;
$pdf_mode = 1;
$rc_report = 1;
$pdflatex="pdflatex -interaction=nonstopmode %O %S";
@default_files = ('*.tex');
$aux_out_dir_report = 0;
$silent = 1;
#warn "PATH = '$ENV{PATH}'\n";
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/bash
# Pull down the latest @resources and replace local files
# with the same names. Leave alone any existing files
# that do not have a counterpart in in the upstream
# written by Claude, edited by CDC

# script should live in directory of the @resources file to be updated

# path to the directory the script lives in

# Set the GitHub repository URL and the desired subdirectory
repo_url="https://github.com/econ-ark/econ-ark-tools.git"

# directory of this script
here="$(realpath $(dirname $0))" # here=/Volumes/Data/Papers/BufferStockTheory/BufferStockTheory-Latest/

# subdirectory path
repo_subdir="@resources"

repo_url_root="https://github.com/econ-ark/econ-ark-tools"
resources="@resources"
repo_dirpath="$repo_url_root/$resources"

# Set the destination directory on your macOS computer
dest_dir="$here/@resources"

# Create a temporary directory for cloning the repository
temp_dir=$(mktemp -d)

# Clone the GitHub repository into the temporary directory
git clone --depth 1 "$repo_url" "$temp_dir"

# Navigate to the desired subdirectory within the cloned repository
pushd . ; cd "$temp_dir/$repo_subdir"

# Copy the contents of the subdirectory to the destination directory
rsync -avh --delete --checksum --itemize-changes --out-format="%i %n%L" . "$dest_dir" | grep '^>f.*c' | tee >(awk 'END { if (NR == 0) print "\nno files were changed\n"; else print NR, "files were changed\n" }')

# Remove the temporary directory
#rm -rf "$temp_dir"

# Return to the source directory
popd
19 changes: 19 additions & 0 deletions Documentation/NARK/@resources/symbols-mapping-latex.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
\newcommand{\aNrm}{a}
\newcommand{\bNrm}{b}
\newcommand{\cNrm}{c}
\newcommand{\dNrm}{d}
\newcommand{\eNrm}{e}
\newcommand{\hNrm}{h}
\newcommand{\wNrm}{w}
\newcommand{\pNrm}{p}
\newcommand{\kNrm}{k}
\newcommand{\mNrm}{m}
\newcommand{\vNrm}{v}
\newcommand{\xNrm}{x}
\newcommand{\yNrm}{y}
\newcommand{\yNrm}{y}
\newcommand{\zNrm}{z}
\newcommand{\prd}{t}
\newcommand{\prdt}{t}
\newcommand{\prdT}{t}
\newcommand{\trmT}{T}
55 changes: 55 additions & 0 deletions Documentation/NARK/@resources/symbols-mapping-prettify
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
("\aNrm" . ?a)
("\bNrm" . ?b)
("\cNrm" . ?c)
("\dNrm" . ?d)
("\eNrm" . ?e)
("\hNrm" . ?h)
("\wNrm" . ?w)
("\pNrm" . ?p)
("\kNrm" . ?k)
("\mNrm" . ?m)
("\vNrm" . ?v)
("\xNrm" . ?x)
("\yNrm" . ?y)
("\yNrm" . ?y)
("\zNrm" . ?z)
("\prd" . ?t)
("\prdt" . ?t)
("\prdT" . ?t)
("\trmT" . ?T)
("\aLvl" . ?𝐚)
("\bLvl" . ?𝐛)
("\cLvl" . ?𝐜)
("\hLvl" . ?𝐡)
("\pLvl" . ?𝐩)
("\kLvl" . ?𝐤)
("\mLvl" . ?𝐦)
("\vLvl" . ?𝐯)
("\yLvl" . ?𝐲)
("\Ex" . ?𝔼)
("\PermGroFac" . ?𝒢)
("\PermGroFacAdj" . ? )
("\PermGroFacAdj" . ? )
("\RNrm" . ?ℛ)
("\vFunc" . ?𝚟)
("\uFunc" . ?𝚞)
("\cFunc" . ?𝚌)
("\DiscFac" . ?β)
("\std" . ?σ)
("\CRRA" . ?ρ)
("\Rfree" . ?R)
("\Risky" . ?𝐑)
("\Rport" . ?ℜ)
("\Shr" . ?Ϛ)
("\TranShkEmp" . ?θ)
("\TranShkEmpDum" . ?ϑ)
("\tranShkEmp" . ?θ)
("\tranShkEmpDum" . ?ϑ)
("\Nrml" . ?𝒩)
("\arvl" . ?←)
("\cntn" . ?→)
("\BegMark" . ?←)
("\EndMark" . ?→)
("\wlthAftr" . ?ẃ)
("\wlthBefr" . ?w)
("\labor" . ?ℓ)
94 changes: 94 additions & 0 deletions Documentation/NARK/@resources/symbols-mapping.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
#!/bin/bash

letter_rules=(
"\\aNrm:a"
"\\bNrm:b"
"\\cNrm:c"
"\\dNrm:d"
"\\eNrm:e"
"\\hNrm:h"
"\\wNrm:w"
"\\pNrm:p"
"\\kNrm:k"
"\\mNrm:m"
"\\vNrm:v"
"\\xNrm:x"
"\\yNrm:y"
"\\yNrm:y"
"\\zNrm:z"
"\\prd:t"
"\\prdt:t"
"\\prdT:t"
"\\trmT:T"
)
unicode_rules=(
"\\aLvl:𝐚"
"\\bLvl:𝐛"
"\\cLvl:𝐜"
"\\hLvl:𝐡"
"\\pLvl:𝐩"
"\\kLvl:𝐤"
"\\mLvl:𝐦"
"\\vLvl:𝐯"
"\\yLvl:𝐲"
"\\Ex:𝔼"
"\\PermGroFac:𝒢"
"\\PermGroFacAdj: "
"\\PermGroFacAdj: "
"\\RNrm:ℛ"
"\\vFunc:𝚟"
"\\uFunc:𝚞"
"\\cFunc:𝚌"
"\\DiscFac:β"
"\\std:σ"
"\\CRRA:ρ"
"\\Rfree:R"
"\\Risky:𝐑"
"\\Rport:ℜ"
"\\Shr:Ϛ"
"\\TranShkEmp:θ"
"\\TranShkEmpDum:ϑ"
"\\tranShkEmp:θ"
"\\tranShkEmpDum:ϑ"
"\\Nrml:𝒩"
"\\arvl:←"
"\\cntn:→"
"\\BegMark:←"
"\\EndMark:→"
"\\wlthAftr:ẃ"
"\\wlthBefr:w"
"\\labor:ℓ"
)

generate_prettify_rules() {
output_file="symbols-mapping-prettify"
> "$output_file"

for rule in "${letter_rules[@]}"; do
IFS=':' read -r command symbol <<< "$rule"
echo "(\"$command\" . ?$symbol)" >> "$output_file"
done

for rule in "${unicode_rules[@]}"; do
IFS=':' read -r command symbol <<< "$rule"
echo "(\"$command\" . ?$symbol)" >> "$output_file"
done

echo "Prettify rules generated in $output_file"
}

generate_prettify_rules

generate_latex_commands() {
output_file="symbols-mapping-latex.tex"
> "$output_file"

for rule in "${letter_rules[@]}"; do
IFS=':' read -r command symbol <<< "$rule"
echo "\\newcommand{$command}{$symbol}" >> "$output_file"
done

echo "LaTeX commands generated in $output_file"
}

generate_latex_commands
17 changes: 17 additions & 0 deletions Documentation/NARK/@resources/tex-add-search-paths.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
% Add the listed directories to the search path
% (allows easy moving of files around later)
% these paths are searched AFTER local config kpsewhich

% *.sty, *.cls
\makeatletter
\def\input@path{{@resources/texlive/texmf-local/tex/latex//}
,{@resources/texlive/latex//}
,{@local//}
}
\makeatother
\makeatletter
\def\bibinput@path{{@resources/texlive/texmf-local/tex/latex//}
,{@resources/texlive/latex//},
,{@local//}
}
\makeatother
Loading

0 comments on commit 2ece3ea

Please sign in to comment.