Learn R Programming

kDGLM (version 1.2.0)

Poisson: Poisson outcome for kDGLM models

Description

Creates an outcome with Poisson distribution with the chosen parameter.

Usage

Poisson(lambda, data, offset = as.matrix(data)^0)

Value

A object of the class dlm_distr

Arguments

lambda

character: The name of the linear predictor associated with the rate (mean) parameter of the Poisson distribution. The parameter is treated as unknown and equal to the exponential of the associated linear predictor.

data

numeric: The values of the observed data.

offset

numeric: The offset at each observation. Must have the same shape as data.

Details

For evaluating the posterior parameters, we use the method proposed in ArtigokParametrico;textualkDGLM.

For the details about the implementation see ArtigoPacote;textualkDGLM.

References

See Also

fit_model

Other auxiliary functions for a creating outcomes: Gamma(), Multinom(), Normal(), summary.dlm_distr()

Examples

Run this code

data <- c(AirPassengers)

level <- polynomial_block(rate = 1, D = 0.95, order = 2)
season <- harmonic_block(rate = 1, period = 12, D = 0.975)

outcome <- Poisson(lambda = "rate", data = data)

fitted.data <- fit_model(level, season,
  AirPassengers = outcome
)
summary(fitted.data)

plot(fitted.data, plot.pkg = "base")

Run the code above in your browser using DataLab