Questions tagged [dlm]

dlm refers to the R package for Bayesian and likelihood analysis of dynamic linear models.

dlm refers to the R package for Bayesian and likelihood analysis of dynamic linear models. It can be used for maximum likelihood, Kalman filtering and smoothing, and Bayesian analysis of normal linear state space models, also known as dynamic linear models.

82 questions
12
votes
3 answers

Estimating parameters of a dynamic linear model

I want to implement (in R) the following very simple Dynamic Linear Model for which I have 2 unknown time varying parameters (the variance of the observation error $\epsilon^1_t$ and the variance of the state error $\epsilon^2_t$). $ …
RockScience
  • 2,731
  • 4
  • 27
  • 46
9
votes
1 answer

Fitting a time-varying coefficient DLM

I want to fit a DLM with time-varying coefficients, i.e. an extension to the usual linear regression, $y_t = \theta_1 + \theta_2x_2$. I have a predictor ($x_2$) and a response variable ($y_t$), marine & inland annual fish catches respectively from…
phg
  • 401
  • 1
  • 4
  • 10
8
votes
1 answer

Gaussian state space forecasting with regression effects

The R package dlm implements filtering and smoothing (dlmFilter and dlmSmooth) for models with regression effects, but forecasting is not (yet) available for these models: mod <- dlmModSeas(4)+dlmModReg(cbind(rnorm(100),rnorm(100))) fi <-…
caas
7
votes
1 answer

Difference between Cholesky decomposition and log-cholesky Decomposition

Is there any difference between a Cholesky decomposition and a log-cholesky decomposition? If yes, what is the difference? In the paper "An R package for dynamic linear models" by Giovanni Petris ( he refers to the paper "Unconstrained…
7
votes
3 answers

Maximum likelihood estimation of dlmModReg

I'm studying R package dlm. So far it seems very powerful and flexible package, with nice programming interfaces and good documentation. I've been able to successfully use dlmMLE and dlmModARMA to estimate the parameters of AR(1) process: u <-…
6
votes
1 answer

Constants in a DLM Model R

Good afternoon, I am attempting to fit a state space model of the form: $$ (S_t- \mu) = G*(S_{t-1} - \mu) + E_t $$ $$ Y = F*S_t + v_t $$ Where $Y$ is nx1, $G$ is 3x3, $S_t$ is 3x1, $\mu$ is 3x1, and $F$ is 17x3. For the life of me I cannot figure…
5
votes
2 answers

DLM results looking wonky

I am teaching myself DLM's using R's dlm package and have two strange results. I am modeling a time series using three combined elements: a trend (dlmModPoly), seasonality (dlmModTrig), and moving seasonality (dlmModReg). The first strange result is…
Wayne
  • 19,981
  • 4
  • 50
  • 99
5
votes
0 answers

Predict next set of coordinates in 3D space

Please forgive me if my question does not make sense - I am pretty new to stats and could use some guidance. I would like to predict the next position of an object in 3D space. I have a list for each axis: xData, yData, zData - these lists contain…
4
votes
3 answers

How to do model selection in dynamic linear model?

I am trying to use DLM to model a time series. Candiate model includes local level, local trend and local trend with seasonal part. I do not know how to do model selection. Can AIC be calculated? I found no function in the R package dlm.
user3824
4
votes
3 answers

Simple explanation of dynamic linear models

I'm looking for a really simple explanation of what a dynamic linear model is as I need to explain this to a non-technical audience. I have looked around for examples but they are very maths heavy. I found this explanation below from the dlmodeler…
JassiL
  • 291
  • 3
  • 10
3
votes
1 answer

Help understanding regression models with dlm in R

In the "Dynamic Linear Models with R" book, the Regression models section reads: "The static regression linear model corresponds to the case where $W_t = 0$ for any $t$, so that $\theta_t = \theta$ is constant over time." I am not understanding…
tmakino
  • 739
  • 1
  • 4
  • 14
3
votes
2 answers

Exogenous variables in dlm package

I have been trying to estimate state space models using dlm package in R. The problem is that the model I am estimating requires inclusion of a few exogenous variables. I still can't figure out how to do it. Does any one know how to add exogenous…
3
votes
0 answers

AR1 Modelling using dlmModReg

I'm trying to model AR1 using dlmModReg(). The main purpose is to keep phi a variable so that if phi >1, I know that mean reversion is not occurring. Below is my code: buildFun <- function(x) {dlmModReg(e1, addInt = FALSE, dV = exp(x[1]), dW =…
ShinjiOno
  • 61
  • 1
3
votes
0 answers

How to add stochastic drift in dynamic linear model?

As I'm not able to comment (yet), my question follows the one raised by @mzuba here I would like to use the DLM R package to model the local linear trend model, which unlike mzuba specified, has a stochastic trend. The the model would be something…
Ben
  • 207
  • 1
  • 8
3
votes
0 answers

Kalman filtering in [R] : FKF package and DLM

I am trying to implement a time varying state-space model in [R]. Model includes some exogenous variables that are part of the measurement and transition matrices. I tried multiple packages and my final candidates are to FKF and DLM. However, I…
1
2 3 4 5 6