Weights: Specify priors for the weights in a Mix prior.

View source: R/SpecPrior-generators.R

WeightsR Documentation

Specify priors for the weights in a Mix prior.

Description

In normal usage, it is better to accept the default priors for the weights than to specify them explicitly. End users are therefore unlikely to need this function.

Usage

Weights(mean = 0, sd = 1, damp = Damp(), scale1 = HalfT(), scale2 = HalfT())

Arguments

mean

The mean of the prior for mean. Defaults to 0.

sd

The standard deviation of the prior for mean. Defaults to 1.

damp

An object of class Damp.

scale1

An object of class HalfT defining the prior for error1.

scale2

An object of class HalfT defining the prior for error2.

Details

A Mix prior treats an interaction as a mixture of normal distributions. The weights, also referred as mixture parameters, evolve over time. The evolution of the weight for each component is governed by an auto-regressive time series model. Specifically, transformed values of the weights are modelled using

level1[k,h] = level2[k,h] + error1[k,h]

level2[k,h] = mean + damp * level2[k-1,h] + error2[k,h]

mean has a normal prior.

damp has the boundary-avoiding prior described in Gelman et al (2004) p316-317. This prior is equivalent to assuming a Beta(2, 2) prior on the transformed parameter (damp+0.5)/2.

error1 and error2 both have half-t priors. These priors have the defaults described in HalfT.

Value

An object of class Weights.

See Also

Mixture priors are specified using Mix. The weights in a mixture prior are specified using Weights.


StatisticsNZ/demest documentation built on Nov. 2, 2023, 7:56 p.m.