Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

priors

Prior objects for bssm models


Description

These simple objects of class bssm_prior are used to construct a prior distributions for the MCMC runs of bssm package. Currently supported priors are uniform (uniform()), half-normal (halfnormal()), normal (normal()), gamma (gamma), and truncated normal distribution (tnormal()).All parameters are vectorized so for regression coefficient vector beta you can define prior for example as normal(0, 0, c(10, 20)).

Usage

uniform(init, min, max)

halfnormal(init, sd)

normal(init, mean, sd)

tnormal(init, mean, sd, min = -Inf, max = Inf)

gamma(init, shape, rate)

Arguments

init

Initial value for the parameter, used in initializing the model components and as a starting value in MCMC.

min

Lower bound of the uniform and truncated normal prior.

max

Upper bound of the uniform and truncated normal prior.

sd

Standard deviation of the (underlying i.e. non-truncated) Normal distribution.

mean

Mean of the Normal prior.

shape

Shape parameter of the Gamma prior.

rate

Rate parameter of the Gamma prior.

Value

object of class bssm_prior.

Examples

# create uniform prior on [-1, 1] for one parameter with initial value 0.2:
uniform(0.2, -1, 1)
# two normal priors at once i.e. for coefficients beta:
normal(init = c(0.1, 2), mean = 0, sd = c(1, 2))

bssm

Bayesian Inference of Non-Linear and Non-Gaussian State Space Models

v1.1.4
GPL (>= 2)
Authors
Jouni Helske [aut, cre] (<https://orcid.org/0000-0001-7130-793X>), Matti Vihola [aut] (<https://orcid.org/0000-0002-8041-7222>)
Initial release
2021-04-13

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.