get_pred: Get Predictions from Stan Model Fit

View source: R/get_pred.R

get_predR Documentation

Get Predictions from Stan Model Fit

Description

Extracts predicted values from a Stan model fit.

Usage

get_pred(stan_fit)

Arguments

stan_fit

A stanfit object returned by get_stanfit.

Value

A summary of the predictions and bar charts of each prediction. If no forecasts were requested, the summary has zero rows and the plot list is empty.

Examples


  # Generate toy data
  y_data <- data_simu(n = 60, alpha = 0.5, rho = 0.3, lambda = 5,
                      mod_type = "zi", distri = "poi")

  # Fit a small Stan model (may take > 5s on first compile)
  stan_fit <- get_stanfit(mod_type = "zi", distri = "poi", y = y_data)

  # Get predicted values from the Stan model fit
  get_pred(stan_fit = stan_fit)



ZIHINAR1 documentation built on Nov. 10, 2026, 9:07 a.m.