|
epinowcast
|
Go to the source code of this file.
Functions | |
| vector | regression_predictor (array[] real intercept, vector beta, int nobs, int neffs, matrix fdesign, tuple(vector, array[] int, array[] int) sparse, vector beta_sd, matrix rdesign, int add_intercept, int sparse_design, int arima_present, int arima_T, int arima_G, int arima_p, int arima_d, int arima_q, int arima_n_obs, matrix arima_z, vector arima_pacf, vector arima_theta, array[] real arima_sigma, array[] int arima_flat_idx, int gp_present, int gp_T, int gp_G, int gp_M, real gp_L, int gp_type, real gp_nu, int gp_d, matrix gp_PHI, matrix gp_eta, array[] real gp_rho, array[] real gp_alpha, array[] int gp_flat_idx) |
| void | regression_priors_lp (vector beta, vector beta_sd, array[,] real beta_sd_p, int fixed, int random, int arima_present, int arima_p, int arima_q, matrix arima_z, vector arima_pacf, vector arima_theta, array[] real arima_sigma, array[,] real arima_sigma_p, array[,] real arima_pacf_p) |
| void | gp_priors_lp (int gp_present, matrix gp_eta, array[] real gp_rho, array[] real gp_alpha, array[,] real gp_rho_p, array[,] real gp_alpha_p) |
| void gp_priors_lp | ( | int | gp_present, |
| matrix | gp_eta, | ||
| array[]real | gp_rho, | ||
| array[]real | gp_alpha, | ||
| array real | gp_rho_p[,], | ||
| array real | gp_alpha_p[,] ) |
Priors for an approximate Gaussian process latent term.
The spectral coefficients eta get a unit-normal (non-centred) prior. The length scale rho gets a log-normal prior and the magnitude alpha a half-normal prior, with each prior (mean, sd) supplied as data. Inert when gp_present == 0.
Definition at line 111 of file regression.stan.
| vector regression_predictor | ( | array[]real | intercept, |
| vector | beta, | ||
| int | nobs, | ||
| int | neffs, | ||
| matrix | fdesign, | ||
| tuple(vector, array[] int, array[] int) | sparse, | ||
| vector | beta_sd, | ||
| matrix | rdesign, | ||
| int | add_intercept, | ||
| int | sparse_design, | ||
| int | arima_present, | ||
| int | arima_T, | ||
| int | arima_G, | ||
| int | arima_p, | ||
| int | arima_d, | ||
| int | arima_q, | ||
| int | arima_n_obs, | ||
| matrix | arima_z, | ||
| vector | arima_pacf, | ||
| vector | arima_theta, | ||
| array[]real | arima_sigma, | ||
| array[]int | arima_flat_idx, | ||
| int | gp_present, | ||
| int | gp_T, | ||
| int | gp_G, | ||
| int | gp_M, | ||
| real | gp_L, | ||
| int | gp_type, | ||
| real | gp_nu, | ||
| int | gp_d, | ||
| matrix | gp_PHI, | ||
| matrix | gp_eta, | ||
| array[]real | gp_rho, | ||
| array[]real | gp_alpha, | ||
| array[]int | gp_flat_idx ) |
Single entry points for the regression layer.
regression_predictor() composes combine_effects() (fixed + partially-pooled random effects via the design matrices) with apply_arima_residual() (parameter-dependent ARIMA(p, d, q) latent residual) and apply_gp_term() (Hilbert-space approximate Gaussian process). Each module that owns a per-observation predictor calls this once instead of calling the layers separately, so every module routed through it gains the ARIMA and GP latent terms for free.
regression_priors_lp() is the matching one-shot priors helper: effect priors plus ARIMA priors (shocks, MA coefficients, latent standard deviation; partial autocorrelations get an implicit uniform prior via their parameter bounds). GP priors are supplied by the separate gp_priors_lp() helper so the long argument list stays manageable.
Both layers are inert when their term is absent: when arima_present == 0 and gp_present == 0, regression_predictor() returns the bare combine_effects() result; each apply_* call short-circuits on its own presence flag.
Every per-observation module routes through these helpers: expr, expl, refnp, and miss apply the latent terms directly at the observation level, while the sparse-row modules refp and rep supply a flat_idx built from the joint (covariate row x time x group) deduplication so the same gather works at sparse-row granularity. The ARIMA and GP terms share this scheme. See vignettes/arima.Rmd and vignettes/gaussian-process.Rmd.
Definition at line 32 of file regression.stan.
| void regression_priors_lp | ( | vector | beta, |
| vector | beta_sd, | ||
| array real | beta_sd_p[,], | ||
| int | fixed, | ||
| int | random, | ||
| int | arima_present, | ||
| int | arima_p, | ||
| int | arima_q, | ||
| matrix | arima_z, | ||
| vector | arima_pacf, | ||
| vector | arima_theta, | ||
| array[]real | arima_sigma, | ||
| array real | arima_sigma_p[,], | ||
| array real | arima_pacf_p[,] ) |
Definition at line 76 of file regression.stan.