Description Usage Arguments Details Value Examples

These simple objects of class `bssm_prior`

are used to construct a
prior distributions for the some of the model objects 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))`

.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ```
uniform_prior(init, min, max)
uniform(init, min, max)
halfnormal_prior(init, sd)
halfnormal(init, sd)
normal_prior(init, mean, sd)
normal(init, mean, sd)
tnormal_prior(init, mean, sd, min = -Inf, max = Inf)
tnormal(init, mean, sd, min = -Inf, max = Inf)
gamma_prior(init, shape, rate)
gamma(init, shape, rate)
``` |

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

`min` |
Lower bound of the uniform and truncated normal prior. |

`max` |
Upper bound of the uniform and truncated normal prior. |

`sd` |
Positive value defining the standard deviation of the (underlying i.e. non-truncated) Normal distribution. |

`mean` |
Mean of the Normal prior. |

`shape` |
Positive shape parameter of the Gamma prior. |

`rate` |
Positive rate parameter of the Gamma prior. |

The longer name versions of the prior functions with `_prior`

ending
are identical with shorter versions and they are available only to
avoid clash with R's primitive function `gamma`

(other long prior names
are just for consistent naming).

object of class `bssm_prior`

or `bssm_prior_list`

in case
of multiple priors (i.e. multiple regression coefficients).

1 2 3 4 5 6 7 8 9 10 11 12 | ```
# create uniform prior on [-1, 1] for one parameter with initial value 0.2:
uniform(init = 0.2, min = -1.0, max = 1.0)
# two normal priors at once i.e. for coefficients beta:
normal(init = c(0.1, 2.5), mean = 0.1, sd = c(1.5, 2.8))
# Gamma prior
gamma(init = 0.1, shape = 2.5, rate = 1.1)
# Same as
gamma_prior(init = 0.1, shape = 2.5, rate = 1.1)
# Half-normal
halfnormal(init = 0.01, sd = 0.1)
# Truncated normal
tnormal(init = 5.2, mean = 5.0, sd = 3.0, min = 0.5, max = 9.5)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.