set_prior | R Documentation |
Setting a prior distribution to an specify model parameter.
set_prior(model, par = "ar", dist = normal(), lag = 0)
model |
a time series model class specified in varstan. |
par |
a string value with the desired parameter which a prior is defined.
Possible arguments are: |
dist |
the distribution of the prior parameter. The only accepted argument
is a |
lag |
an optional integer value, indicates the desired lag of the parameter
to impose a prior. If |
bayesforecast
provides its own functions to manipulate the parameter prior,
this functions return a prior_dist
class, the dist
argument
only accepts this objects.
lag
parameter is an optional value to change the prior distribution of
one parameter in particular, this argument is only valid for: "ar"
, "ma"
,
"arch"
, "garch"
, "mgarch"
, or "breg"
arguments. The lag
option has
to be a integer lower than the total amount of lagged parameters of the model.
For example,
to ONLY change the prior of the second "arch"
parameter in a garch(3,1)
model, a lag = 2
option must be specified.
a time series model class specified in bayesforecast with the changed prior.
Asael Alonzo Matamoros
dat = Sarima(birth,order = c(1,1,2))
dat = set_prior(model = dat, par = "ar", dist = normal(0,2))
dat
dat = set_prior(model = dat, par = "mu0", dist = student(mu = 0,sd = 2.5,df = 7))
dat
dat = set_prior(model = dat, par = "ma",dist= beta(shape1 = 2, shape2 = 2), lag = 2)
dat
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.