Questions tagged [dlm]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
12 views

Log innovation vs squared

I see some state space models specify their innovation process as log innovations and some squaring the term. For example, the examples in the R package DLM favours the use of log innovations when ...
2
votes
0answers
33 views

FFBS algorithm for estimating mean log-return parameter in stochastic volatility jump model

I am currently attempting to replicate this model: https://arxiv.org/pdf/1809.01501.pdf in r. My (first) problem is regarding how to sample from conditional posterior for mu, $(μ_{(j)}|Y_n, J_{(j−1)}...
0
votes
0answers
19 views

Difference between dlm and bsts

I'm working on a project which asks me to analysis the Facebook's stock price, and I have to do it the Bayesian way. This assignment doesn't have a particular goal and we are free to decide the what ...
0
votes
1answer
33 views

Two time-varying coefficients in Kalman filter with DLM package [closed]

I am trying to estimate a model that has two time varying coefficients in R using the "DLM" package. My measurement equation would be = Yt = F1tx1t + F2tx2t + v The state equations are: F1t = F1t-...
0
votes
0answers
23 views

Can someone explain me how cumulative association in distributed lag models works?

I'm trying to fit some distributed lag models with dlnm package in R. When I specify cumul=TRUE, I obtain extra parameters ...
1
vote
1answer
45 views

Parameter estimation in Dynamic Linear Models

I am currently developing a DLM of the following form $$\underset{k \times 1} {y_t} = \underset{k \times n}A \underset{n \times 1}{\theta_t} + \epsilon_t$$ $$\theta_t = \mu + \underset{n \times n}B\...
0
votes
0answers
7 views

Impulse response function from dlmMLE estimates

Is there an alternative to the irf() function in R, which can be manually specified? I have estimated parameters of a state-space model via ...
0
votes
0answers
42 views

Using dlmMLE to estimate state space parameters

I have been trying to use the dlmMLE function from the R package dlm to estimate parameters ...
1
vote
0answers
66 views

Multilevel dynamic linear models in R

I am interested in fitting a multilevel bayesian structural time series with a hierarchical structure of the dynamic regression coefficients. The reason I want to do this is is that I have a number of ...
0
votes
1answer
30 views

Custom Space State model using DLM in R

DLM package in R can model linear space state models of the form: I have a different category of equation which is also a linear polynomial equation of order 1 with constant coefficients. I would ...
1
vote
0answers
42 views

Hierarchical time series using DLM

I am developing a forecasting solution using R's dlm package and it is proving to be very useful for most of our requirements. However, I am also keen on sharing information among different time ...
2
votes
0answers
41 views

Time varying representation of Okun's law

I've estimated a dynamic linear model to capture time varying parameters in an Okun's law type of model: I set the starting values for the state vector all equal to zero and estimate the system ...
1
vote
0answers
34 views

What do the outputs of the function dlmSmooth from R's dlm package mean?

In the vignette for the R package dlm: link on page 12, the author runs the function dlmSmooth to smooth the data and the function returns an object which is ...
1
vote
0answers
101 views

Unable to recover time varying AR1 parameter from State Space model

I am trying to do a Time varying parameters regression. The equation is as follows: $y_t = a + b_t * x_{1t} + \epsilon_t$ Here a is fixed while $b_t$ is AR1. My state space equations are : There ...
1
vote
1answer
227 views

Estimating State Space Model Parameters

I'm having a bit of difficulty estimating parameters in DLM in R and I was wondering if I could get a bit of help with it. I have a system of equations given as: $p_{t} = m_{t} + s_{t}$ $m_{t} = m_{...
1
vote
0answers
62 views

Parameter estimation using dlmModReg

I am trying to use dlmModReg to estimate the regression coefficient lambda (fixed) of the explanatory variable x (27 zeroes followed by one) as applied to the Nile data. My code is this - ...
1
vote
3answers
1k views

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 ...
6
votes
1answer
1k views

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 ( ...
0
votes
0answers
42 views

Parameter estimation of dlmModReg using maximum likelihood estimation

I am learning dlm package in R. I have two dataset. I want to do prediction on the date when there is no real measurement. ...
0
votes
1answer
135 views

Convert a state-space model with exogenous input to one without

I have a state space model of the form \begin{align} x_{t+1} &= Ax_t + Bu_t + w_t\\ y_t &= Cx_t + Du_t + v_t \end{align} where $u$ is the exogenous input. Also, $ w_t \sim N(0, Q)$ and $v_t \...
0
votes
0answers
57 views

state space implementation using DLM FKF

state space model , I am trying to implement is as follows $$ y_t= CY + FF* X_t + Ve_t$$ $$(X_t-m0)= GG (X_{t-1}-m0) +W\eta_t$$ In DLM I am using following modification(because DLM does not allow ...
0
votes
0answers
275 views

ARIMA model for GDP

I am working through example 3.2.6 in 'Dynamic linear models with R' by Petris. I have download the quarterly deseasonalised USA GDP data located here: http://definetti.uark.edu/dlm/ (it's the data ...
1
vote
0answers
74 views

Dynamic Linear Models - prior specification

I am using the DLM package to make forecasts for some of my time series. I wonder how the priors should be elicited. For a Local State space model, one needs to specify the level of data prior to t=1....
2
votes
1answer
376 views

DLM representation of ARIMA models

I am working through example 3.2.6 in 'Dynamic linear models with R' by Petris. I have download the USA GDP data located here: http://definetti.uark.edu/dlm/ The example starts by estimating the ...
0
votes
1answer
163 views

ARIMA in state space and Kalman filter for predicted values [closed]

Given the coefficients of an arima Model arimaM <- arima(y, order = c(1,0,2), transform.pars = FALSE, fixed = c(0.5,2,1.5,NA)) how can I compute the one step ...
2
votes
0answers
194 views

Missing data in Gibbs sampling for dynamic linear models

Suppose I have the following DLM: $x_t = \Phi x_{t-1} + w_t$ $y_t = A x_t + v_t$ $x_0 \sim N(\mu_0,\Sigma_0)$ $w_t \sim N(0,Q)$ $v_t \sim N(0,R)$ Let $\Theta = \{\mu_0,\Sigma_0,\Phi,Q,A,R\}$. I ...
0
votes
1answer
101 views

Creating DLM object in R : Non symmetric W (error matrix in state equation)

I am using DLM package in R for estimating state space model While creating DLM object in R I am getting the following error "Error in all.equal(x\$W, t(x\$W)) && all (eigen(x\$W)$values >= 0)...
2
votes
1answer
189 views

DLM implementation of the mean reverting model

I am trying to use DLM package in R to estimate a state space repersentation of the term structure model, where observation and state equation are as follows $y(t )= F* x_t +e_t$ $x_t- \mu = G* (x_{...
1
vote
0answers
667 views

Normalized data on a rolling window

I have a whole set of data on [0,T] with an observation variable y(t), and a feature x(t), ...
0
votes
0answers
70 views

Verifying that dlm is working correctly

I am new to the dlm package and I am writing a simulation to verify that dlm is working correctly. Here is how I proceed: I create an AR1 series with parameters $\phi$ and $\sigma^2$. Then I try to ...
0
votes
1answer
635 views

multi-factor time-varying CAPM using kalman filter

I am trying to implement a time-varying CAPM model using the kalman filter. I have already found numerous examples in R and python using the DLM and the pykalman packages but the problem is that they ...
1
vote
0answers
58 views

Correct way of building a confidence interval

My AR(1) model is $y_t = \phi y_{t-1} + \epsilon_t \quad where \quad \epsilon_t \sim \mathcal{N}(0,1) $ Here $\sigma^2 = Var(\epsilon_t) = 1$ Basically in this code I generate random values for phi ...
0
votes
1answer
339 views

Difference between Dynamic Factor Model (DFM) and Dynamic Linear Model (DLM)

one simple question: what is the difference between a Dynamic Factor Model (DFM) and a Dynamic Linear Model (DLM) ?
1
vote
0answers
565 views

How does the dlmMLE function work?

How does the dlmMLE in package dlm in R work? Are the maximum likelihood estimates coming from the Kalman filter or by numerical optimization. If it is using numerical optimization,what is the ...
1
vote
1answer
132 views

Model approach for extending Dynamic Linear Models - Nested Regression Relationships

I have three multivariate random variables $X_t$, $Y_t$, and $Z_t$. I have been very happily modeling the relationship between $Y_t$ and $X_t$ through a dynamic linear model $$Y_t = X_t\beta_t + ...
0
votes
0answers
282 views

Different AIC values using lm, dlm and dlmodeler

I would like to compare a model with time varying slope coefficient to a model with constant slope coefficient. In order to do this, I use the R package "dlm" to set up the models and calculate the ...
1
vote
0answers
199 views

DLM model for data with seasonality

I am trying to explore the changing relationship between two monthly time series data. DLM package in R comes into my attention as I would like to see the beta change between the two dataset $A$ (...
3
votes
0answers
161 views

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 ...
2
votes
1answer
322 views

Forecasting elections by using survey data (in R)

In advance: my sincere apologies for any incompleteness, lack of knowledge and general stupidity in this post. I am doing my ultimate best to be as complete and thorough as possible - but I could ...
5
votes
0answers
562 views

Predict next set of coordinates in 3D space [closed]

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 ...
1
vote
0answers
253 views

dlm package not forecasting properly with dlmModTrig

I'm having trouble forecasting a time series with a trigonometric component using dlmModTrig. So far I have: buildFun<-function(x){ dlmInven<- dlmModTrig (s=12, dV=0, q=2, dW=exp (x1))+...
1
vote
1answer
784 views

How to specify VAR dynamics of factors in Dynamic Factor Model in R

I'm working on a forecasting model. The standard form for it is: $y_t=\Lambda^*f_t+u_t\\f_t=A_1f_{t-1}+...+A_pf_{t-p}+e_t$ where $f_t$ is a vector of factors obtained from Principal Component ...
1
vote
0answers
155 views

How do I Forecast new Yts given new Xt's using a Dynamic Linear Model?

I am trying to forecast predict new observations of interest rates given new data using the DLM modeling framework. Essentially, my problem is this: I have a training set (a set of data i want to ...
2
votes
0answers
448 views

auto.arima and DLM give different values for loglikelihood

I want to estimate an ARIMA model on my timeseries, then represent it in state space format, mainly because it will be more responsive to change in pattern. I used ...
3
votes
0answers
625 views

Kalman filtering in [R] : FKF package and DLM [closed]

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 ...
2
votes
0answers
492 views

Online time series forecasting with DLM

I have estimated a univariate time series model, consisting of a random walk and an AR component. Now the goal is to make forecast about a couple of steps ahead as new data comes in, in an online ...
1
vote
0answers
304 views

DLM, regression and multiple time series

I'm working with incoming traffic data at multiple spots along a long road. Let's denote the traffic at time t at point $j$ by $x_j(t)$. For each spot, a univariate model, such as local level plus AR(...
0
votes
0answers
141 views

DLM with autocorrelated and non gaussian residuals

I quite new to state-space modelling, and I've been working on a DLM right now, using the dlm package (Petris, 2009). I want to forecast French car registrations since 1994 (till 2014), on a monthly ...
2
votes
2answers
2k views

DLM package, issues about specifying models with time-varying coefficient

I've been working on DLM package for the past few weeks. I've read the package manual and the paper written by Petris "dlm: an R package for Bayesian analysis of Dynamic Linear Models", but I am still ...
3
votes
0answers
92 views

Measurement Error in Dynamic Linear Model

I have fitted a dlm model as follow: ...