estimation of dynamic linear model in R

(please help, i'm a beginner in r and desperate for help)

i've been trying to estimate some dynamic linear model in r but nothing had been working for me. My data conserns a y as inflation (named in my excel:INFUSA) and x unemployment (named in my excel:CHOUSA). I used these command with package dlm (i use rstudio) :


model.dlm = dlm(formula = INFUSA ~ CHOUSA , data = CSFE , q = 1)

and this is the error: Error in dlm(formula = INFUSA ~ CHOUSA, data = CSFE, q = 1) : Component(s) m0, C0, FF, V, GG, W is (are) missing

i want a regression of this type: infusa(t)=constant+chousa(t-1) i'm not sure if i am using the right package, i want to try it with ardl command but i can't install it anymore in my version 3.6.0 and i don't know why.

So please if anyone can help with anything i would be very greatfull


To help us help you, could you please prepare a reproducible example (reprex) illustrating your issue? Please have a look at this guide, to see how to create one:

Perhaps the Vignette for the dlm package will be helpful in setting up your model.

I haven't worked with dynamic linear models, but it looks like your model is an ARIMA model with autoregessive order equal to 1. If this is what you're actually trying to achieve, you might be able to use the base R arima function. If you can provide more information about your problem, we may be able to provide code and suggestions more directly tailored to your needs.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.