mpiktas / midasr

R package for mixed frequency time series data analysis.
http://mpiktas.github.io/midasr/
Other
74 stars 34 forks source link

Error in hAh_test() #75

Closed QAQ-Ahuahuahuahua closed 4 years ago

QAQ-Ahuahuahuahua commented 4 years ago

Hi there,

When I was trying to use hAh_test() to test my model, I have encountered this error. Error in prep_hAh(x) : Unrestricted model cannot be estimated due to the lack of degrees of freedom, testing the restriction is not possible

The midas model is like this: m1 <- midas_r(Y~mls(X1, 0:13, 12, almonp) + mls(X2, 0:4, 3, almonp) + mls(X3, 0:7, 3, almonp) + mls(X4, 0, 1) + mls(Y, 1, 1),start=list(X1=rep(1,3) ,X2=rep(1,3),X3=rep(1,3)))

My target variable is a quarterly data, togethered with independent variables: X1,X2,X3,X4. X1 is a weekly data(m=12, four weeks for a month). X2 and X3 are monthly, and X4 is quarterly. All the data are from 2014M1 to 2020M6.

How can I get a right hAh_test value rather than NA?

Any help is greatly appreciated.

vzemlys commented 4 years ago

There are more high frequency lags in your model than there are observations. This means that you cannot estimate U-MIDAS model and this is why you get an error message saying exactly that. Hope it helps.

Vaidotas

On 2020-09-27, Sun at 17:20, 阿华华华华 notifications@github.com wrote:

Hi there,

When I was trying to use hAh_test() to test my model, I have encountered this error.

Error in prep_hAh(x) : Unrestricted model cannot be estimated due to the lack of degrees of freedom, testing the restriction is not possible

The midas model is like this:

m1 <- midas_r(Y~mls(X1, 0:13, 12, almonp) + mls(X2, 0:4, 3, almonp) + mls(X3, 0:7, 3, almonp) + mls(X4, 0, 1) + mls(Y, 1, 1),start=list(X1=rep(1,3) ,X2=rep(1,3),X3=rep(1,3)))

My target variable is a quarterly data, togethered with independent variables: X1,X2,X3,X4. X1 is a weekly data(m=12, four weeks for a month). X2 and X3 are monthly, and X4 is quarterly. All the data are from 2014M1 to 2020M6.

How can I get a right hAh_test value rather than NA?

Any help is greatly appreciated.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mpiktas/midasr/issues/75, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACOKZ3ATCT7NZ4NJTLKYFDSH5C23ANCNFSM4R3SULWA .

QAQ-Ahuahuahuahua commented 4 years ago

So the way to solve this error is to reduce the total lags in model or increase observations? What's more, if the result of hAh_test() is NA or error, does it mean my midas model with restriction cannot be adopted?

Thanks a lot

vzemlys commented 4 years ago

Hi,

Both will help.

If the hAh_test is NA this only means that you cannot test whether restriction is the correct one. Other criterias for model validity should be used.

Vaidotas

Le 28 sept. 2020 à 11:28, 阿华华华华 notifications@github.com a écrit :

So the way to solve this error is to reduce the total lags in model or increase observations? What's more, if the result of hAh_test() is NA or error, does it mean my midas model with restriction cannot be adopted?

Thanks a lot

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mpiktas/midasr/issues/75#issuecomment-699861403, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACOKZ4LU5A6MITFMKM2WDDSIBCJDANCNFSM4R3SULWA.

QAQ-Ahuahuahuahua commented 4 years ago

Got it. Thanks!