zero_sum_prior {kDGLM}R Documentation

Zero sum prior

Description

Defines the prior of a structural block to be such that the latent states sum zero with probability one.

Usage

zero_sum_prior(
  block,
  var.index = 1:block$n,
  weights = rep(1, length(var.index))
)

Arguments

block

dlm_block object: The structural block.

var.index

integer: The index of the variables from which to set the prior.

weights

numeric: A vector indicating which linear transformation of the data is 0 with probability 1. Default is equivalent to a zero-sum restriction.

Details

The covariance matrix of the evolution and the drift parameter are also altered to guarantee that the zero sum condition will always hold. The discount factor must be the same for all variables whose prior is being modified. For the details about the implementation see dos Santos et al. (2024).

Value

A dlm_block object with the desired prior.

References

Junior, Silvaneo Vieira dos Santos, Mariane Branco Alves, Helio S. Migon (2024). “kDGLM: an R package for Bayesian analysis of Dynamic Generialized Linear Models.”

See Also

Other auxiliary functions for defining priors.: CAR_prior(), joint_prior()

Examples


polynomial_block(mu = 1, D = 0.95) |>
  block_mult(5) |>
  zero_sum_prior()


[Package kDGLM version 1.2.0 Index]