epinowcast
Loading...
Searching...
No Matches
effects_priors_lp.stan File Reference

Go to the source code of this file.

Functions

void effect_priors_lp (vector beta, vector beta_sd, array[,] real beta_sd_p, int fixed, int random)
 

Function Documentation

◆ effect_priors_lp()

void effect_priors_lp ( vector  beta,
vector  beta_sd,
array real  beta_sd_p[,],
int  fixed,
int  random 
)

Specify priors for regression effects

This function sets priors for the regression effects and their standard deviations. It allows for the specification of both fixed and random effects, with the option to apply a normal distribution to the standard deviations of the random effects.

Parameters
betaVector of regression effects.
beta_sdVector of standard deviations for the regression effects.
beta_sd_pParameters for the normal prior on beta_sd. The first row indicates the mean, and the second row the standard deviation.
fixedBinary flag indicating if fixed effect priors are to be set (1) or not (0).
randomBinary flag indicating if random effect priors are to be set (1) or not (0).
Note
The function applies the following priors based on the flags:
  1. If fixed is true, a standard normal prior is applied to beta.
  2. If both fixed and random are true, a normal prior is applied to beta_sd, with parameters specified in beta_sd_p. This allows for flexible prior specification depending on the nature of the regression effects being modeled.

Definition at line 29 of file effects_priors_lp.stan.