You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-55Lines changed: 11 additions & 55 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ These functions are used in Jupyter and Pluto notebook `projects` specifically
13
13
14
14
Currently there are 3 of these notebook projects:
15
15
16
-
1. Max Lapan's [rethinking-2ed-julia](https://github.com/Shmuma/rethinking-2ed-julia) which uses Turing.jl and Jupyter notebooks. This has been forked, renamed to SR2TuringJupyter.jl and modified in a few places (e.g. data files are obtained from StatisticalRethinking.jl).
16
+
1. Max Lapan's [rethinking-2ed-julia](https://github.com/Shmuma/rethinking-2ed-julia) which uses Turing.jl and Jupyter notebooks.
17
17
18
18
2. The [SR2TuringPluto.jl](https://github.com/StatisticalRethinkingJulia/SR2TuringPluto.jl) project, also Turing.jl based but using Pluto.jl instead of Jupyter. It is based on Max Lapan's work above.
19
19
@@ -41,85 +41,41 @@ StatisticalRethinking.jl v4 fits better with the new setup of Pluto notebooks wh
41
41
42
42
3. Capture the draws for further processing. In Turing that is ususally done using MCMCChains.jl, in StanSample.jl v4 it's mostly in the form of a DataFrame, a StanTable, a KeyedArray chains (obtained from AxisKeys.jl).
43
43
44
-
4. Inspect the chains using statistical and visual methods. In many cases this will need one or more statistical packages and one of the graphical options.
44
+
4. For further processing, these projects nearly always convert chains to a DataFrame.
45
+
46
+
5. Inspect the chains using statistical and visual methods. In many cases this will need one or more statistical packages and one of the graphical options.
45
47
46
48
Currently visual options are StatsPlots/Plots based, e.g. in MCMCChains.jl and StatisticalRethinkingPlots.jl.
47
49
48
-
5. The above 4 items could all be done by just using StanSample.jl or Turing.jl.
50
+
5. The above 5 steps could all be done by just using StanSample.jl or Turing.jl.
49
51
50
52
**The book Statistical Rethinking has a different objective and studies how models compare, how models can help (or mislead) and why multilevel modeling might help in some cases.**
51
53
52
54
6. For this, additional packages are available, explained and demonstrated, e.g. StructuralCausalModels.jl, ParetoSmoothedImportanceSampling.jl and quite a few more.
53
55
54
56
## Using StatisticalRethinking v4
55
57
56
-
To work through the StatisticalRethinking book using Julia and Turing, download either of the `projects`[SRTuringJupyter.jl](https://github.com/StatisticalRethinkingJulia/SRTuringJupyter.jl) or [SRTuringPluto.jl](https://github.com/StatisticalRethinkingJulia/SRTuringPluto.jl).
57
-
58
-
To work through the StatisticalRethinking book using Julia and Stan, download `project`[SRStanPluto.jl](https://github.com/StatisticalRethinkingJulia/SRStanPluto.jl).
59
-
60
-
All three projects create a Julia environment where most needed packages are available and can be imported.
61
-
62
-
In addition to providing a Julia package environment, these also contain chapter by chapter Jupyter or Pluto notebooks to work through the Statistical Rethinking book.
63
-
64
-
In order to keep environment packages relatively simple (i.e. have a limited set of dependencies on other Julia packages) StatisticalRethinking consists of 2 layers, a top layer containing mcmc dependent methods (e.g. a model comparison method taking Turing.jl or StanSample.jl derived objects) which in turn call common methods in the bottom layer. The same applies for the graphic packages. This feature relies on Requires.jl and the mcmc dependent methods can be found in `src/require` directories.
65
-
66
-
To tailor StatisticalRethinking.jl for Stan, use (in that order!):
67
-
```
68
-
using StanSample
69
-
using StatisticalRethinking
70
-
```
71
-
72
-
or, for Turing:
73
-
```
74
-
using Turing
75
-
using StatisticalRethinking
76
-
```
77
-
78
-
See the notebook examples.
79
-
80
-
## Structure of StatisticalRethinkingJulia (v4):
81
-
82
-
On a high level, the StatisticalRethinkingJulia ecosystem contains 4 layers:
83
-
84
-
1. The lowest layer provides mcmc methods, currently Turing.jl and StanSample.jl.
85
-
86
-
2. Common (mcmc independent) bottom layer in StatisticalRethinking (and StatisticalRethinkingPlots).
87
-
88
-
3. MCMC dependent top layer in StatisticalRethinking (and StatisticalRethinkingPlots).
89
-
90
-
4. Chapter by chapter notebooks.
91
-
92
-
## Some background info on previous versions
93
-
94
-
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.
58
+
To work through the StatisticalRethinking book using Julia and Turing or Stan, download either one of the above mentioned `projects` and start Pluto.
95
59
96
-
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),
60
+
An early, experimental version of [StructuralCausalModels.jl](https://github.com/StatisticalRethinkingJulia/StructuralCausalModels.jl) is also included as a dependency in the StatisticalRethinking.jl package.
97
61
98
-
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.
62
+
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.
99
63
100
-
The in v3 added introduced dependency [StatsModelComparisons.jl](https://github.com/StatisticalRethinkingJulia/StatsModelComparisons.jl) which provides PSIS and WAIC statistics for model comparison is deprecated in v4. For WAIC, PSIS and LOO ParetoSmoothedImportanceSampling.jl is used.
64
+
Similarly, a dependency [ParetoSmoothedImportanceSampling.jl](https://github.com/StatisticalRethinkingJulia/ParetoSmoothedImportanceSampling.jl)is used which provides PSIS and WAIC statistics for model comparison.
101
65
102
66
## Versions
103
67
104
-
### Version 4 (under construction!)
68
+
### Version 4
105
69
106
70
- Drop the heavy use of @reexport.
107
-
- Switch to ParetoSmooth.jl
108
-
- Enable the use of AxisKeys.jl for mcmc chains if Stan(Sample) is used.
109
-
- Enable a switch to Makie.jl and AlgebraOfGraphics.jl by moving all graphics to StatisticalRethinkingPlots and StatisticalRethinkingMakie (in the future).
110
-
- Use projects to set up the needed Julia environment to run the examples, e.g. SRStanPluto.jl and SRTuringJupyter.jl and SRTuringPluto.jl.
111
-
- Refine 'tailoring' StatisticalRethinking.jl and the graphics packages based on the availability of StanSample, Turing.jl, etc. using Requires.jl.
71
+
- Enable a future switch to Makie.jl and AlgebraOfGraphics.jl by moving all graphics to StatisticalRethinkingPlots and StatisticalRethinkingMakie (in the future).
112
72
- Many more improvements by Max Lapan (@shmuma).
113
73
114
74
### Versions 3.2.1 - 3.3.6
115
75
116
76
- Improvements by Max Lapan.
117
-
- Introduction of StatsModelCoparisons.jl for PSIS and WAIC.
118
-
- Removed dependencied on DynamicHMC (will be covered in StatisticalRethinkingDHMC).
119
77
- Added trankplot.jl.
120
-
- Further separation of methods needed to convert output of mcmc package to SR inputs.
0 commit comments