Two applied statistical modeling exercises implemented from scratch in R using a reproducible RMarkdown workflow. The focus is on likelihood-based modeling, predictive evaluation, and simulation-based Bayesian inference.
Modeled the relationship between CAD-estimated weight
Each observation is modeled as:
with mean structure
Two alternative variance structures were implemented.
Model A
Model B
Parameters were estimated via maximum likelihood by minimizing the negative log-likelihood.
For each observation, predictive distributions were constructed and evaluated using:
- Leave-one-out cross-validation
- Squared Error (point accuracy)
- Dawid–Sebastiani score (distributional accuracy)
A Monte Carlo test was used to assess whether one model provided significantly better predictive performance.
Estimated total population size
with priors
Posterior expectations were approximated using Monte Carlo integration:
All likelihood calculations were implemented using log-Gamma functions for numerical stability.
- Custom log-likelihood functions
- Direct maximum likelihood estimation
- Predictive distribution construction
- Manual leave-one-out cross-validation
- Simulation-based Bayesian computation
- Fully reproducible RMarkdown workflow