Project Status | Build Status |
---|---|
After many years I have decided to step away from my work with Stan and Julia. My plan is to be around until the end of 2024 for support if someone decides to step in and take over further development and maintenance work.
At the end of 2024 I'll archive the different packages and projects included in the Github organisations StanJulia, StatisticalRethingJulia and RegressionAndOtherStoriesJulia if no one is interested (and time-wise able!) to take on this work.
I have thoroughly enjoyed working on both Julia and Stan and see both projects mature during the last 15 or so years. And I will always be grateful for the many folks who have helped me on numerous occasions. Both the Julia and the Stan community are awesome to work with! Thanks a lot!
RegressionAndOtherStories.jl contains supporting (Julia) functions and the data files used in "Regression and Other Stories" by Andrew Gelham, Jennifer Hill and Aki Vehtari.
The package is also used in project SR2StanPluto.jl v9+, a revised inplementation of the Statistical Rethinking support functions using Makie.jl, CausalInference.jl and GraphViz.jl.
The supporting functions are intended to be used in (currently) 3 Julia projects (also under development), ROSStanPluto.jl, ROSTuringPluto.jl and SR2StanPluto.
All currently available data files are in .csv
format and located in the data
directory.
If RegressionAndOtherStories.jl is loaded, the files can be read in as a DataFrame using e.g.:
hibbs = CSV.read(ros_datadir("ElectionsEconomy", "hibbs.csv"), DataFrame)
For that purpose ros_datadir()
is exported.
If needed, Stata files (.dat
) have been converted to .csv
files as is illustrated by a few scripts in the scripts
directory, e.g. see scripts\hdi.jl
. To access the Stata files in the R package ROS-Examples RegressionAndOtherStories.jl expects the environment variable JULIA_ROS_HOME
to be defined, e.g.:
ENV["JULIA_ROS_HOME"] = expanduser("~/Projects/R/ROS-Examples")
R itself does not necessarily need to be installed for this to work.
If so desired, direct use of the Stata files is also possible as the Stata to .csv file conversion scripts mentioned above show.
RegressionAndOtherStories.jl v9+ is using Julia's package extension option. In particular Turing, Stan, Makie, GraphViz and CausalInference, if needed, are included as extensions.
Over time I might minimize the use of AlgebraOfGraphics.jl. It is a nice package but also a bit more difficult to tailor (compared to Makie/CairoMakie).
I expect I can use ParetoSmoothedImportanceSampling.jl as is but will take another look at PSIS.jl and ParetoSmooth.jl when revising the relevant chapters.
In the subdirectory src/Maintenance/reset_notebooks.jl
is a function I use in the Pluto notebook projects (SR2StanPluto, ROSStanPluto, etc.). The function potentially makes three changes to selected notebooks:
-
If it finds a line starting with
Pkg.activate
it disables that line ifreset_activate = true
. -
If it finds a line starting with
#Pkg.activate
it enables that line ifset_activate = true
. -
It removes the Project and Manifest sections of all notebooks selected for reset. See the maintenance notebooks in projects such as SR2StanPluto and ROSStanPluto.
Using Pkg.activate(...)
is useful if your workflow uses many different notebooks. E.g., in my workflow I ] up
the project SR2StanPluto
in the REPL before I start opening individual notebooks in Pluto.
Please file issues, comments and questions here.
Pull requests are also welcome.
- Switching to PCDAG and FCIDAG when using CausalInference.jl.
- Redone working with CausalInference.jl.
- Added introductory CausalInference notebooks.
- Redone DAG struct.
- Use GraphViz with CairoMakie.
- switch to use CairoMakie instead of GLMakie.
- Switch to extensions.
- Added simulate function.
- Added scale_df_cols! (scale! conflicted with Makie and other packages).
- Switching to CausalInference.jl as a replacement for StructuralCausalModels.jl.
- Possibly switching to either PSIS.jl or ParetoSmooth.jl as a replacement for ParetoSmoothedImportanceSampling.jl.
- Switched to Makie.jl and GLMakie.jl as back-end.
- Use of GraphViz.jl to display DAGs.
- Primarily following package updates.
- Changed back to use DataFrames directly as basis for summaries.
- Use getindex to access single elements in summary DataFrames (first argument taken vrom
parameters
column in df) - For Stan use array() to group nested columns into a matrix. For Turing continue to use nested_column_to_array.
- Added DataFrame operatior function (not exported).
- Added errorbars_mean and errorbars_draws.
- Added nested_column_to_array.
- Made model_summary String/Symbol agnostic.
- Doc fixes by Pietro Monticone
- Added model_summary(::SampleModel).
- Model_summary and plot_chains (accept both Symbol and Strings)
- Focus on Appendices A and B.
- Focus on chapters 4, 5, 6, 7
- Fine tuning working with ros_functions and ros_notebooks.
- Added maintenance functions for a (large) set of notebooks.
- Is tagging using JuliaHub with setting branch name working?
- Add initial version of notebook maintenance routines.
- Tag this version (if not done by TagBot)
- Fix Makie and AoG glue scripts.
- StatsFuns compat entry to 1.0.
- Switch back to using Requires.jl
- Switch to using
eachindex()
where appropriate. - Experimental versions for chapter 3.
- Chapter 2 mostly done
- Added trankplot function
- Support for the 5 examples from chapter 1 done.
- Added plot_chains() and model_summary() functions.
- Added Makie and AlgebraOfGraphics as dependencies.
Note: Source files for Makie/AoG are all in src/Makie/ to simplify moving those to a separate repo (not my intention right now, but still).
- In sync with both ROS[Turing|Stan]Pluto projects tagged 2.3 and up.
- Initial commit (to registrate the package for usage in projects).
Of course this package is focused on:
which in a sense is a major update to item 3. below.
There is no shortage of other good books on Bayesian statistics. A few of my favorites are:
-
Gelman, Hill: Data Analysis Using Regression and Multilevel/Hierarchical Models
-
Betancourt: A Conceptual Introduction to Hamiltonian Monte Carlo
-
Pearl, Glymour, Jewell: Causal Inference in Statistics: A Primer
A good book to understand most of the Julia constructs used in this book is: