from pathlib import Path
import sys
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import lapylace as lp
sys.path.append(str(Path.cwd().parent / 'python'))
from data import ros_pathRegression and Other Stories - Extra code
Additional code versions
- R + Tidyverse version by Bill Behrman
- R + brms + tidyverse version by Solomon A. Kurz (work in progress)
- Python + Bambi version by Ravin Kumar, Tomás Capretto, and Osvaldo Martin (work in progress)
Source: extra.Rmd.
The Python version keeps data handling explicit and uses lapylace for Stan-backed generalized linear models, so the statistical model can be read from a formula rather than from handwritten Stan.
Notes
- Source computation blocks represented: 0.
- Data paths are expressed through the shared
ros_path()helper. - Formula-based Bayesian regressions are routed through
lapylace.stan_glm(). - Plotting and simulation work uses NumPy, pandas, matplotlib idioms.