-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
In case of perfect multi-collinearity, td()
runs into a ‘singular matrix’ issue (example by @felicitaskemeny):
library(tempdisagg)
y <- ts(rnorm(n = 20), start = 1995)
x <- ts(rnorm(n = 80), start = 1995, freq = 4)
dummy <- ts(rep(0, 80), start = 1995, freq = 4)
disagg <- td(y ~ x + dummy)
#> Error in backsolve(R, c1 - C1 %*% v): singular matrix in 'backsolve'. First zero in diagonal [3]
The solution of course is to drop the dummy. But lm()
is smarter and does that autmatically for you.
y2 <- ts(rnorm(n=80), start=1995, freq=4)
lm(y2 ~ x + dummy)
#>
#> Call:
#> lm(formula = y2 ~ x + dummy)
#>
#> Coefficients:
#> (Intercept) x dummy
#> 0.01285 0.19844 NA
Should we have something similar in td()
?
Created on 2020-09-09 by the reprex package (v0.3.0)
Metadata
Metadata
Assignees
Labels
No labels