Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converting Chp_15 and Chp_16 to v4 #217

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1,539 changes: 679 additions & 860 deletions Rethinking_2/Chp_15.ipynb

Large diffs are not rendered by default.

1,731 changes: 1,541 additions & 190 deletions Rethinking_2/Chp_16.ipynb

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions Rethinking_2/Data/Lynx_Hare.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
"Year";"Lynx";"Hare"
1900;4;30
1901;6.1;47.2
1902;9.8;70.2
1903;35.2;77.4
1904;59.4;36.3
1905;41.7;20.6
1906;19;18.1
1907;13;21.4
1908;8.3;22
1909;9.1;25.4
1910;7.4;27.1
1911;8;40.3
1912;12.3;57
1913;19.5;76.6
1914;45.7;52.3
1915;51.1;19.5
1916;29.7;11.2
1917;15.8;7.6
1918;9.7;14.6
1919;10.1;16.2
1920;8.6;24.7
85 changes: 85 additions & 0 deletions Rethinking_2/Data/Panda_nuts.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
"chimpanzee";"age";"sex";"hammer";"nuts_opened";"seconds";"help"
11;3;"m";"G";0;61;"N"
11;3;"m";"G";0;37;"N"
18;4;"f";"wood";0;20;"N"
18;4;"f";"G";0;14;"y"
18;4;"f";"L";0;13;"N"
11;4;"m";"Q";0;24;"N"
11;4;"m";"Q";0;30.5;"N"
17;5;"f";"wood";0;135;"N"
7;5;"m";"G";3;24;"N"
1;5;"m";"L";0;13;"N"
22;5;"m";"wood";0;34;"N"
9;6;"m";"G";58;66.5;"N"
9;6;"m";"G";4;5;"N"
9;6;"m";"G";21;24;"N"
9;6;"m";"G";9;20;"N"
9;6;"m";"G";2;6;"N"
9;6;"m";"G";30;42;"N"
9;6;"m";"G";19;43;"N"
9;6;"m";"G";13;26.5;"N"
9;6;"m";"G";6;14;"N"
15;6;"m";"G";11;27;"N"
7;6;"m";"G";1;12;"y"
9;6;"m";"G";2;17;"N"
1;6;"m";"L";0;4;"N"
7;6;"m";"G";1;17;"N"
13;6;"m";"wood";0;17;"N"
13;6;"m";"G";0;15;"N"
7;6;"m";"G";0;12;"y"
13;6;"m";"G";0;23;"y"
7;6;"m";"wood";0;47;"N"
3;7;"f";"G";4;23;"N"
3;7;"f";"L";0;16;"N"
3;7;"f";"L";0;13.5;"N"
19;7;"m";"G";8;16;"N"
9;7;"m";"G";10;23.5;"N"
9;7;"m";"G";11;33;"N"
9;7;"m";"G";1;3;"N"
16;8;"f";"G";4;12;"N"
2;8;"f";"G";2;10.5;"N"
2;8;"f";"G";1;12;"N"
16;8;"f";"G";0;7.5;"N"
16;8;"f";"G";0;32;"N"
9;8;"m";"G";36;38;"N"
19;8;"m";"G";4;9;"y"
9;8;"m";"G";16;13;"N"
9;8;"m";"G";77;59;"N"
9;8;"m";"G";41;40;"N"
19;8;"m";"G";22;36;"N"
9;8;"m";"G";49;51;"N"
19;8;"m";"G";37;60;"N"
19;8;"m";"G";31;71;"y"
19;8;"m";"G";11;14;"N"
9;8;"m";"G";5;10;"N"
19;8;"m";"G";8;33;"y"
9;8;"m";"L";0;11;"N"
4;9;"f";"G";1;4.5;"N"
4;9;"f";"wood";0;17;"N"
9;9;"m";"G";30;47;"N"
9;9;"m";"G";13;24;"N"
9;9;"m";"G";15;34.5;"N"
4;10;"f";"G";0;2.5;"N"
8;11;"f";"G";4;13;"N"
14;12;"f";"G";10;10;"N"
21;13;"f";"G";5;13;"N"
12;13;"m";"G";51;43;"N"
5;13;"m";"G";3;6;"N"
5;13;"m";"G";4;6.5;"N"
20;14;"m";"G";50;50;"N"
20;14;"m";"G";36;48;"N"
20;14;"m";"G";6;14.5;"N"
20;14;"m";"G";3;8.5;"N"
20;14;"m";"G";4;15;"N"
20;14;"m";"G";7;17;"N"
20;15;"m";"G";41;56.5;"N"
10;15;"m";"G";27;33;"N"
6;15;"m";"G";30;36;"N"
20;15;"m";"G";17;42;"N"
20;15;"m";"G";14;23;"N"
6;15;"m";"G";16;20;"N"
10;15;"m";"G";7;12;"N"
10;15;"m";"G";5;12.5;"N"
6;15;"m";"G";8;13;"N"
6;16;"m";"G";24;20;"N"
6;16;"m";"G";25;36;"N"
16 changes: 2 additions & 14 deletions Rethinking_2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ to install all the dependencies into an isolated environment.

Activate the environment by running:

source activate stat-rethink2-pymc
source activate stat-rethink2-pymc_v4

To use the notebooks you first have to register your new environment as a valid notebook kernel:

python -m ipykernel install --user --name stat-rethink2-pymc3 --display-name "Python 3.10 (stat-rethink2-pymc3)"
python -m ipykernel install --user --name stat-rethink2-pymc_v4 --display-name "Python 3.10 (stat-rethink2-pymc_v4)"

You can start a notebook by running:

Expand All @@ -42,18 +42,6 @@ or use the more modern jupyter lab:
jupyter lab

from the root directory.

## PyMC v4 Updates

Work is on-going to update these notebooks to be compatible with PyMC v4. Currently chapters 2 through 14 have been converted.

If you wish to run these notebooks, please create the v4 environment by running:

conda env create -f environment_v4.yml

and activate it with:

source activate stat-rethink2-pymc_v4

---

Expand Down
11 changes: 7 additions & 4 deletions Rethinking_2/environment.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: stat-rethink2-pymc
name: stat-rethink2-pymc_v4
channels:
- conda-forge
dependencies:
Expand All @@ -7,9 +7,12 @@ dependencies:
- seaborn
- mkl-service
- watermark
- pymc3
- arviz
- theano-pymc
- pymc==4.3.0
- arviz==0.13.0
- aeppl==0.0.38
- aesara==2.8.7
- theano-pymc==1.1.2
- tqdm
- mkl
- mkl-service
- pip
Expand Down
26 changes: 0 additions & 26 deletions Rethinking_2/environment_v4.yml

This file was deleted.