How japanese-maple/computational_statistics works
Purpose and Entry Points
This is a notebook-first Python learning repository implementing and visualizing core computational statistics methods. Each top-level Jupyter notebook is an independent executable entry point rather than part of a packaged application:
• 0_Linear_Regression.ipynb
• 1_Importance_Sampling.ipynb
• 2_Metropolis-Hastings.ipynb
• 3_Gibbs_Sampler.ipynb
Execution Model
Users run notebooks interactively in a Jupyter-compatible Python environment. The notebooks likely combine method setup, numerical simulation, estimation, and visualization in one workflow. There is no indicated shared library, CLI, service runtime, deployment layer, or application backend.
Regression Workflow
0_Linear_Regression.ipynb represents the supervised-estimation portion of the repository. Its architectural role is to demonstrate fitting or visualizing a linear regression model from data, distinct from the later stochastic sampling methods. Generated artifacts are organized under Outputs/Linear_regression.
Importance Sampling Workflow
1_Importance_Sampling.ipynb implements an importance-sampling pipeline: samples are drawn from a proposal distribution, weighted relative to a target distribution, and aggregated into an estimate or visualization. Output material is separated at Outputs/Importance_sampling, making that directory the boundary between notebook computation and persisted results.
Markov Chain Monte Carlo Workflows
Two notebooks implement MCMC approaches:
• 2_Metropolis-Hastings.ipynb defines the proposal/acceptance/rejection chain workflow associated with Metropolis-Hastings; outputs belong in Outputs/Metropolis-Hastings.
• 3_Gibbs_Sampler.ipynb defines a Gibbs-sampling workflow, where state updates are expected to be conditional-coordinate transitions.
These are separate pedagogical implementations, not alternate modules behind a common sampler interface.
Data and Control Flow
The main flow is notebook-local: initialize distributions or data, execute numerical/statistical iterations, then render and/or save results. The Outputs hierarchy is the only explicit shared persistence structure:
• Outputs
• Outputs/Importance_sampling
• Outputs/Linear_regression
• Outputs/Metropolis-Hastings
No input datasets, databases, message queues, HTTP APIs, or external services are represented in the repository tree.
Infrastructure and Boundaries
The material runtime is Python via Jupyter notebooks. Python numerical and plotting dependencies are implied by the stated implementations and visualizations, but no dependency manifest is present. README.md provides the project-level description, while LICENSE defines distribution terms. The absence of package source directories and environment configuration means reproducibility and dependency installation are notebook/user-environment responsibilities.
Main entry points: Outputs Outputs · 0_Linear_Regression.ipynb Linear Regression · 1_Importance_Sampling.ipynb Importance Sampling · 2_Metropolis-Hastings.ipynb Metropolis-Hastings
Components 15
Interactive Runtime
- Jupyter Python · Users execute each notebook interactively.
Notebook Workflows
- Linear Regression · Supervised estimation and visualization workflow.
0_Linear_Regression.ipynb - Regression fit
- Importance Sampling
1_Importance_Sampling.ipynb - Proposal weighting · Draw proposal samples, weight against the target, and aggregate estimates.
- Metropolis-Hastings
2_Metropolis-Hastings.ipynb - Accept/reject chain · Proposal, acceptance, and rejection transitions.
- Gibbs Sampler
3_Gibbs_Sampler.ipynb - Conditional updates · Coordinate-wise conditional state transitions.
Persisted Results
- Outputs · Shared persisted-results hierarchy.
Outputs - Regression results
Outputs/Linear_regression - Importance results
Outputs/Importance_sampling - Metropolis-Hastings results
Outputs/Metropolis-Hastings
Other components
- Project guide
README.md - License
LICENSE
Connections 16
- Project guide → Jupyter Python: describes usage
- License → Project guide: defines terms
- Jupyter Python → Linear Regression: executes
- Jupyter Python → Importance Sampling: executes
- Jupyter Python → Metropolis-Hastings: executes
- Jupyter Python → Gibbs Sampler: executes
- Linear Regression → Regression fit: fits and visualizes
- Regression fit → Regression results: persists results
- Importance Sampling → Proposal weighting: runs
- Proposal weighting → Importance results: persists results
- Metropolis-Hastings → Accept/reject chain: runs
- Accept/reject chain → Metropolis-Hastings results: persists results
- Gibbs Sampler → Conditional updates: runs
- Outputs → Regression results: contains
- Outputs → Importance results: contains
- Outputs → Metropolis-Hastings results: contains