Skip to contents

Fitting Models

Fit Bayesian Stan models.

kb_fit_weight_nereo()
Fit a Nereocystis Weight Model
kb_fit_progress()
Completed Fraction of a Running Fit

Priors

Specify priors for model parameters.

kb_priors_weight_nereo()
Default Priors for the Nereocystis Weight Model
kb_prior_normal()
Normal Prior
kb_prior_exponential()
Exponential Prior

Data

Validate and explore input data.

kb_check_data_weight_nereo()
Validate Nereocystis Weight Model Data
data_weight_sim_nereo
Simulated Nereocystis Weight Dataset
fit_weight_sim_nereo
Example Weight Model Fit

Predictions and Plotting

Predict and visualise model output.

kb_predict_weight()
Predict Weight for New Data
kb_predict_weight_by()
Predict Weight Over a Diameter Sequence by Grouping Factor
kb_plot_predictions()
Plot Model Predictions

Model Summaries and Diagnostics

Summarise fits, extract coefficients and draws, and assess convergence.

samples()
Posterior Draws
kb_stancode()
Stan Source for a Model Fit
tidy(<kb_fit_weight>)
Tidy a Weight Model Fit
coef(<kb_fit>)
Coefficients of a Model Fit
glance(<kb_fit>)
Model Fit Diagnostic Summary
summary(<kb_fit>)
Summarise a Model Fit
augment(<kb_fit>)
Augment Model Data
converged(<kb_fit>)
Convergence of a Model Fit
prior_summary(<kb_fit>)
Prior Summary
log_lik(<kb_fit>)
Pointwise Log-Likelihood
fitted(<kb_fit_weight>)
Fitted Weights
residuals(<kb_fit_weight>)
Deviance Residuals
predict(<kb_fit_weight>)
Predict Method for a Weight Model Fit
posterior_epred(<kb_fit_weight>)
Expected Weight Posterior Draws
posterior_linpred(<kb_fit_weight>)
Linear-Predictor Posterior Draws
posterior_predict(<kb_fit_weight>)
Posterior-Predictive Weight Draws
autoplot(<kb_predictions>)
Autoplot Method for Predictions