-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to resolve error in dropvar: Determination of full column rank design matrix failed #35
Comments
Have you tried using
|
Thanks a lot for your quick reply G-man!! But in a way I'd still want to resolve the original error or at least trace the reason for it. After all when using Any ideas? |
My best guess is that the problem does not stem from the |
A new idea just occurred to me. Have you tried applying |
Excellent idea G-man - thanks, I will also try this!! At the moment, I suspect it could be related to simply retaining too many indicators for the number of observations... With my ARDL(2,2) resulting in 32 co-variates and then the I'm currently simply sending the initially retained indicators through another block search (essentially taking all the retained indicators and adding them into another If this works, then perhaps we need to think about whether this is a problem that could generally be present in different MIS applications. But at least the solution for such a problem would be fairly straightforward (simply check whether there are too many retained indicators for the number of observations, sending them back into block-search for the final GETS union - and if another block-search still retains too many indicators for the model to work then printing an explicit error message that the model is not well-defined). Will keep you updated, but really appreciate your help!! :) |
I had a peak at the ZIP-file you provided. Out of curiosity, I applied
So, 1901 columns out of a total of 2738 were dropped due to exact colinearity! Note also that it took a minute or two on my (average) laptop to drop the columns. Now, there might be a "bug" or "issue" somewhere in |
Thanks G-Man! I don't think they were necessarily dropped due to exact collinearity! Indeed, each indicator is a unique coefficient-step dummy that should not be collinear to any other dummy. I think Consider this: set.seed(1)
x <- matrix(rnorm(20), ncol = 5) # more columns than rows
dropvar(x) #one column dropped *as if it were collinear - but isn't!" It could well be that this is the intended behaviour - G-Man you're better equipped to judge this. I would have expected to receive an error here rather than getting an output that just drops one non-collinear column. In my particular case, I'm trying to use MIS as my But perhaps this is just an issue that will continue to pop up with MIS applications or very large |
Interesting! We should probably look into the Related to this, note that in your example there is an easy fix:
If you try to do something similar with you Note that, in the uis argument of |
Hoping someone can help me with this - and perhaps a motivation for additional checks within the
isat
function to prevent this ahead of where it occurs.Problem Description
I'm attempting to use
isat
using a user-specified indicatoruis
, which is simply a MIS object of the x-regressors interacted with thesim()
function (so a multiplicative matrix to check for breaks in the coefficient). The screenshot below shows a model also usingiis
andsis
, but the same happens when just usinguis
.Now admittedly, this is a large sample (t = above 2000) with k = 10 and and ARDL(2) model, so you can imagine that running the uis takes a long time. I run it with a
tol = 1e-15
- but using less (e.g. the default1e-7
) also fails with asingular matrix in "a" in "solve"
error. Using this, rather than with daily data but with weekly or monthly data, actually works.Error
Everything works great until the final
GETS union of retained UIS variables...
where I get the errorError: determination of full column rank design matrix failed
.The error occurs within
dropvar
in theisat
function. The error occurs because:qr
command withindropvar
does not have equal rank to themXis
matrix that is entered.dropvar
drops a number of columns usingnewX <- x[, qr.X$pivot[1:qr.X$rank], drop = FALSE]
but the resulting matrix still does not equal therank
of the originalqr
object.Hoping to resolve
Obviously this is fairly frustrating as the function fails with the products of its earlier functions (the individual
getsFun
s on theuis
) - and in this case it is after a really intensive estimation procedure, which is difficult to debug.Ideally I would:
gets
union of theuis
because it takes a long time to get there. And can we think about improving the error message for the user? What should a user do to resolve this?Replicate using my example
I have included a
.zip
file withmXis
object that is being used in thedropvar
function and a tiny replication script (also with the option of usingdropvar
with a browser command, to walk through the function step-by-step using F10).replication of error.zip
save.image()
saved just before theGETS union of retained UIS variables...
command inisat
, containing all data inputs etc.Thanks all for your help!! :)
The text was updated successfully, but these errors were encountered: