Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do dynlm and dlm have same mathematical expressions?

I am currently using dynamic linear regression (dynlm) for my analysis. However, I do also find another model called dynamic linear model (dlm).

I find that dlm has an official mathematical expression by West and Harrison (1989) and everywhere. However, I cannot find an official mathematical expression for dynlm elsewhere. Even the official R program document verbally explains that it is just an extended version of linear regression that allows additional feature but with no explicit mathematical expression.

Can I assume the official mathematical expression for dynlm and dlm identical? If not, may I know the official mathematical expression for dynlm in r programming?

like image 637
Eric Avatar asked Nov 01 '17 10:11

Eric


1 Answers

From Furman university documentation:

The interface and internals of dynlm are very similar to lm, but currently dynlm offers two advantages over the direct use of lm: 1. extended formula processing, 2. preservation of time-series attributes.

For specifying the formula of the model to be fitted, there are additional functions available which facilitate the specification of dynamic models. An example would be d(y) ~ L(y, 2), where d(x, k) is diff(x, lag = k) and L(x, k) is lag(x, lag = -k), note the difference in sign. The default for k is in both cases 1.

The specification of dynamic relationships only makes sense if there is an underlying ordering of the observations. Currently, lm offers only limited support for such data, hence a major aim of dynlm is to preserve time-series properties of the data. Explicit support is currently available for "ts" and "zoo" series. Internally, the data is kept as a "zoo" series and coerced back to "ts" if the original dependent variable was of that class (and not internal NAs were created by the na.action).

like image 121
jtillman Avatar answered Sep 19 '22 13:09

jtillman