Skip to content

Commit 01cfd94

Browse files
committed
Rel 4.4.3 - Ready to rename StatisticalRethinkingStan.jl
1 parent 26d1fde commit 01cfd94

6 files changed

Lines changed: 21 additions & 17 deletions

File tree

Project.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
name = "StatisticalRethinking"
22
uuid = "2d09df54-9d0f-5258-8220-54c2a3d4fbee"
33
authors = ["Rob J Goedman <goedman@icloud.com>, Max Lapan (@Shmuma)"]
4-
version = "4.4.2"
4+
version = "4.4.3"
55

66
[deps]
77
AxisKeys = "94b1ba4f-4ee9-5380-92f1-94cde586c3c5"
88
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
99
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
10+
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
1011
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
1112
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
1213
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ Currently `SR2TuringJupyter.jl` has not yet been renamed. This will be done afte
2121

2222
2. The [SR2TuringPluto.jl](https://github.com/StatisticalRethinkingJulia/SR2TuringPluto.jl) project, also Turing.jl based but using Pluto.jl instead of Jupyter. It will be completely based on Max Lapan's work above, but only in Pluto.
2323

24-
3. The [StatisticalRethinkingStan.jl](https://github.com/StatisticalRethinkingJulia/StatisticalRethinkingStan.jl) project, which uses Stan as implemented in StanSample.jl and StanQuap.jl. See [StanJulia](https://github.com/StanJulia).
24+
3. The [SR2StanPluto.jl](https://github.com/StatisticalRethinkingJulia/SR2StanPluto.jl) project, which uses Stan as implemented in StanSample.jl and StanQuap.jl. See [StanJulia](https://github.com/StanJulia).
2525

2626
There is a fourth option to study the (Turing.jl) models in the Statistical Rethinking book which is in the form of a package and Franklin web pages: [TuringModels.jl](https://github.com/StatisticalRethinkingJulia/TuringModels.jl).
2727

2828
### *Note 2: Version 4 is under development and breaking in many respects.*
2929

3030
Version 4 has a very different setup and is a breaking change from v3 of StatisticalRethinking.jl. See below for what has changed.
3131

32-
For now StatisticalRethinking v3.3.6 is more complete in conjunction with the StatisticalRethinkingStan (v3) and StatisticalRethinkingTuring (v1-3) projects.
32+
For now StatisticalRethinking v3.3.6 is more complete in conjunction with the SR2StanPluto (v3) and SR2TuringPluto (v1-3) projects.
3333

3434
### *Note 3: Large size issue of StatisticalRethinking when `dev`-ed.*
3535

@@ -111,7 +111,7 @@ If interested in either of these projects, please contact me!
111111

112112
Given that Julia provides several very capable packages that support mcmc simulation, it only seemed appropriate to make StatisticalRethinking (v3) on Julia mcmc implementation independent.
113113

114-
The availablility of DynamicHMC, the huge progress made by the Turing.jl team over the last 2 years, the introduction of Julia `projects` in addition to Julia `packages`, the novel approach to notebooks in Pluto.jl and the work by [Karajan](https://github.com/karajan9/statisticalrethinking) and currently [Shuma](https://github.com/Shmuma/rethinking-2ed-julia) were a few of the ideas that triggered exploring a new setup for StatisticalRethinking.jl and the 'course' projects [StatistcalRethinkingStan](https://github.com/StatisticalRethinkingJulia/StatisticalRethinkingStan.jl) and [StatisticalrethinkingTuring](https://github.com/StatisticalRethinkingJulia/StatisticalRethinkingTuring.jl),
114+
The availablility of DynamicHMC, the huge progress made by the Turing.jl team over the last 2 years, the introduction of Julia `projects` in addition to Julia `packages`, the novel approach to notebooks in Pluto.jl and the work by [Karajan](https://github.com/karajan9/statisticalrethinking) and currently [Shuma](https://github.com/Shmuma/rethinking-2ed-julia) were a few of the ideas that triggered exploring a new setup for StatisticalRethinking.jl and the 'course' projects [StatistcalRethinkingStan](https://github.com/StatisticalRethinkingJulia/SR2StanPluto.jl) and [StatisticalrethinkingTuring](https://github.com/StatisticalRethinkingJulia/SR2TuringPluto.jl),
115115

116116
An early, experimental version of [StructuralCausalModels.jl](https://github.com/StatisticalRethinkingJulia/StructuralCausalModels.jl) is also included as a dependency in the StatisticalRethinking.jl package. In the meantime I will definitely keep my eyes on [Dagitty.jl](https://github.com/Shmuma/Dagitty.jl), [Omega.jl](https://github.com/zenna/Omega.jl) and [CausalInference.jl](https://github.com/mschauer/CausalInference.jl). In particular Dagitty.jl has very similar objectives as StructuralCausalModels.jl and over time might replace it in the StatisticalRethinkingJulia ecosystem. For now, StructuralCausalModels does provide ways to convert DAGs to Dagitty and ggm formats.
117117

@@ -121,7 +121,7 @@ Finally, for a good while I have been looking for a great statistics book using
121121

122122
As [StatisticalRethinking](https://github.com/StatisticalRethinkingJulia) v3/4 is also (DrWatson & Pkg) project based and uses Pluto notebooks, I have converted the book `listings` in the first 5 chapters to Pluto Notebooks in a new repository in StatisticalRethinkingJulia, i.e. [StatisticsWithJuliaPlutoNotebooks](https://github.com/StatisticalRethinkingJulia/StatisticsWithJuliaPlutoNotebooks.jl).
123123

124-
After chapter 4, `Statistics with Julia` follows the frequentist approach while `Statistical Rethinking` opts for the Bayesian approach. Most of the material in chapters 5 and 6 of `Statistics with Julia` is therefore also covered using a more Bayesian perspective in the early chapters of the notebook projects [StatisticalRethinkingStan](https://github.com/StatisticalRethinkingJulia/StatisticalRethinkingStan.jl) and [StatisticalRethinkingTuring](https://github.com/StatisticalRethinkingJulia/StatisticalRethinkingTuring.jl).
124+
After chapter 4, `Statistics with Julia` follows the frequentist approach while `Statistical Rethinking` opts for the Bayesian approach. Most of the material in chapters 5 and 6 of `Statistics with Julia` is therefore also covered using a more Bayesian perspective in the early chapters of the notebook projects [SR2StanPluto](https://github.com/StatisticalRethinkingJulia/SR2StanPluto.jl) and [SR2TuringPluto](https://github.com/StatisticalRethinkingJulia/SR2TuringPluto.jl).
125125

126126
## Versions
127127

@@ -168,7 +168,7 @@ Align (stanbased) quap with Turing quap. quap() now returns a NamedTuple that in
168168

169169
StatisticalRethinking.jl v3 is independent of the underlying mcmc package. All scripts previously in StatisticalRethinking.jl v2 holding the snippets have been replaced by Pluto notebooks in the above mentioned mcmc specific `project` repositories.
170170

171-
Initially StatisticalRethinkingTuring.jl will lag StatisticalRethinkingStan.jl somewhat but later this year both will cover the same chapters.
171+
Initially SR2TuringPluto.jl will lag SR2StanPluto.jl somewhat but later this year both will cover the same chapters.
172172

173173
It is the intention to develop *tests* for StatisticalRethinking.jl v3 that work across the different mcmc implementations. This will limit dependencies to the `test/Project.toml`.
174174

@@ -184,7 +184,7 @@ To install the package (from the REPL):
184184
] add StatisticalRethinking
185185
```
186186

187-
but in most cases this package will be a dependency of another package or project, e.g. StatisticalRethinkingStan.jl or StatisticalRethinkingTuring.jl.
187+
but in most cases this package will be a dependency of another package or project, e.g. SR2StanPluto.jl or SR2TuringPluto.jl.
188188

189189
## Documentation
190190

docs/src/srgithub.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
StatisticalRethinking.jl is part of the broader [StatisticalRethinkingJulia](https://github.com/StatisticalRethinkingJulia) Github organization.
44

5-
Implementations of most models using Stan, DynamicHMC and Turing can currently be found in [StanModels](https://github.com/StatisticalRethinkingJulia/StanModels.jl), [DynamicHMCModels](https://github.com/StatisticalRethinkingJulia/DynamicHMCModels.jl) and [TuringModels](https://github.com/StatisticalRethinkingJulia/TuringModels.jl).
6-
75
## Why a StatisticalRethinking v4?
86

97
Over time more and better options become available to express the material covered in Statistical Rethinking. The most important (in my opinion!) is the use of KeyedArrays (provided by [AxisKeys.jl](https://github.com/JuliaArrays/AxisArrays.jl)) for the representation of mcmc chains.
@@ -34,9 +32,9 @@ Currently most visual options are StatsPlots/Plots based, e.g. in MCMCChains.jl
3432

3533
### Using StatisticalRethinking v4
3634

37-
To work through the StatisticalRethinking book using Julia and Stan, download `project` [StatisticalRethinkingStan.jl](https://github.com/StatisticalRethinkingJulia/StatisticalRethinkingStan.jl).
35+
To work through the StatisticalRethinking book using Julia and Stan, download `project` [SR2StanPluto.jl](https://github.com/StatisticalRethinkingJulia/SR2StanPluto.jl).
3836

39-
To work through the StatisticalRethinking book using Julia and Turing, download `project` [StatisticalRethinkingTuring.jl](https://github.com/StatisticalRethinkingJulia/StatisticalRethinkingTuring.jl).
37+
To work through the StatisticalRethinking book using Julia and Turing, download `project` [SR2TuringPluto.jl](https://github.com/StatisticalRethinkingJulia/SR2TuringPluto.jl).
4038

4139
Both projects create a Julia environment where most needed packages are available.
4240

@@ -72,7 +70,7 @@ On a high level, the StatisticalRethinkingJulia ecosystem contains 4 layers:
7270

7371
## Future possible projects
7472

75-
A start has been made with a similar [project](https://github.com/StatisticalRethinkingJulia/StatisticalRethinkingTuring.jl) using Julia and Turing, but unfortunately only the first 5 chapters have been completed. I just don't have the time to continue to work and complete that project. Luckily there is an excellent other package, [TuringModels.jl](https://github.com/StatisticalRethinkingJulia/TuringModels.jl) that contains a selection of the Statistical Rethinking models in Turing.jl's PPL. There is also [Shuma](https://github.com/Shmuma/rethinking-2ed-julia) which is another good starting point to use Turing.jl.
73+
A start has been made with a similar [project](https://github.com/StatisticalRethinkingJulia/SR2TuringPluto.jl) using Julia and Turing, but unfortunately only the first 5 chapters have been completed. I just don't have the time to continue to work and complete that project. Luckily there is an excellent other package, [TuringModels.jl](https://github.com/StatisticalRethinkingJulia/TuringModels.jl) that contains a selection of the Statistical Rethinking models in Turing.jl's PPL. There is also [Shuma](https://github.com/Shmuma/rethinking-2ed-julia) which is another good starting point to use Turing.jl.
7674

7775
Along similar lines, I would love to see a StatisticalRethinkingDHMC.jl, which could be a combination of Soss.jl and DynamicHMC.jl, and a StatisticalRethinkingMamba.jl!
7876

@@ -82,7 +80,7 @@ If interested in either of these projects, please contact me!
8280

8381
Given that Julia provides several very capable packages that support mcmc simulation, it only seemed appropriate to make StatisticalRethinking (v3) on Julia mcmc implementation independent.
8482

85-
The availablility of DynamicHMC, the huge progress made by the Turing.jl team over the last 2 years, the introduction of Julia `projects` in addition to Julia `packages`, the novel approach to notebooks in Pluto.jl and the work by [Karajan](https://github.com/karajan9/statisticalrethinking) and currently [Shuma](https://github.com/Shmuma/rethinking-2ed-julia) were a few of the ideas that triggered exploring a new setup for StatisticalRethinking.jl and the 'course' projects [StatistcalRethinkingStan](https://github.com/StatisticalRethinkingJulia/StatisticalRethinkingStan.jl) and [StatisticalrethinkingTuring](https://github.com/StatisticalRethinkingJulia/StatisticalRethinkingTuring.jl).
83+
The availablility of DynamicHMC, the huge progress made by the Turing.jl team over the last 2 years, the introduction of Julia `projects` in addition to Julia `packages`, the novel approach to notebooks in Pluto.jl and the work by [Karajan](https://github.com/karajan9/statisticalrethinking) and currently [Shuma](https://github.com/Shmuma/rethinking-2ed-julia) were a few of the ideas that triggered exploring a new setup for StatisticalRethinking.jl and the 'course' projects [StatistcalRethinkingStan](https://github.com/StatisticalRethinkingJulia/SR2StanPluto.jl) and [StatisticalrethinkingTuring](https://github.com/StatisticalRethinkingJulia/SR2TuringPluto.jl).
8684

8785
An early, experimental version of [StructuralCausalModels.jl](https://github.com/StatisticalRethinkingJulia/StructuralCausalModels.jl) is also included as a dependency in the StatisticalRethinking.jl package. In the meantime I will definitely keep my eyes on [Dagitty.jl](https://github.com/Shmuma/Dagitty.jl), [Omega.jl](https://github.com/zenna/Omega.jl) and [CausalInference.jl](https://github.com/mschauer/CausalInference.jl). In particular Dagitty.jl has very similar objectives as StructuralCausalModels.jl and over time might replace it in the StatisticalRethinkingJulia ecosystem. For now, StructuralCausalModels does provide ways to convert DAGs to Dagitty and ggm formats.
8886

@@ -92,4 +90,4 @@ Finally, for a good while I have been looking for a great statistics book using
9290

9391
As [StatisticalRethinking](https://github.com/StatisticalRethinkingJulia) v3/4 is also (DrWatson & Pkg) project based and uses Pluto notebooks, I have converted the book `listings` in the first 5 chapters to Pluto Notebooks in a new repository in StatisticalRethinkingJulia, i.e. [StatisticsWithJuliaPlutoNotebooks](https://github.com/StatisticalRethinkingJulia/StatisticsWithJuliaPlutoNotebooks.jl).
9492

95-
After chapter 4, `Statistics with Julia` follows the frequentionist approach while `Statistical Rethinking` opts for the Bayesian approach. Most of the material in chapters 5 and 6 of `Statistics with Julia` is therefore also covered using a more Bayesian perspective in the early chapters of the notebook projects [StatisticalRethinkingStan](https://github.com/StatisticalRethinkingJulia/StatisticalRethinkingStan.jl) and [StatisticalRethinkingTuring](https://github.com/StatisticalRethinkingJulia/StatisticalRethinkingTuring.jl).
93+
After chapter 4, `Statistics with Julia` follows the frequentionist approach while `Statistical Rethinking` opts for the Bayesian approach. Most of the material in chapters 5 and 6 of `Statistics with Julia` is therefore also covered using a more Bayesian perspective in the early chapters of the notebook projects [SR2StanPluto](https://github.com/StatisticalRethinkingJulia/SR2StanPluto.jl) and [SR2TuringPluto](https://github.com/StatisticalRethinkingJulia/SR2TuringPluto.jl).

research/sr_loo_compare.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# work well in Pluto and is nit convenient for SR. Here I'm experimenten
44
# with a more elaborate version.
55
#
6-
# This script needs the StatisticalRethinkingStan project environment.
6+
# This script needs the SR2StanPluto project environment.
77
#
88

99
using StanSample, ParetoSmooth

src/StatisticalRethinking.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ using ParetoSmooth
1616
using ParetoSmoothedImportanceSampling
1717
using MonteCarloMeasurements
1818
using KernelDensity
19+
using Optim
20+
using MCMCChains
21+
using Dates
1922

2023
import StatsBase: sample
2124
import DataFrames: DataFrame
@@ -26,7 +29,7 @@ using DocStringExtensions: SIGNATURES, FIELDS, TYPEDEF
2629

2730
function __init__()
2831
@require Turing="fce5fe82-541a-59a6-adf8-730c64b5f9a0" include("require/turing/turing.jl")
29-
@require Optim="429524aa-4258-5aef-a3af-852621145aeb" include("require/turing/turing_optim_sample.jl")
32+
#@require Optim="429524aa-4258-5aef-a3af-852621145aeb" include("require/turing/turing_optim_sample.jl")
3033

3134
@require StanSample="c1514b29-d3a0-5178-b312-660c88baa699" include("require/stan/stan.jl")
3235

@@ -49,7 +52,7 @@ Relative path using the StatisticalRethinking src/ directory.
4952
sr_path("..", "data")
5053
```
5154
52-
Note that in the projects, e.g. StatisticalRethinkingStan.jl and StatisticalRethinkingTuring.jl, the
55+
Note that in the projects, e.g. SR2StanPluto.jl and SR2TuringPluto.jl, the
5356
DrWatson approach is a better choics, i.e: `sr_datadir(filename)`
5457
5558
"""

src/require/turing/turing.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ include("turing_quap.jl")
44
include("turing_precis.jl")
55
include("turing_plotcoef.jl")
66
include("turing_dataframe.jl")
7+
include("turing_optim_sample.jl")
8+
#include("turing_particles.jl")

0 commit comments

Comments
 (0)