Hello,
Not a huge bug, but probably worth fixing.
EViews version: 14 (April 22 build)
When I use MIDAS, if I set the sample with a gap in the middle, for example 2010Q3–2026Q1 excluding 2020Q1 to 2022Q2 (pandemic), I noticed the R-squared can turn negative. In the regression I was testing, I was getting an R-squared of -0.507 for example... which makes no sense.
Estimation results:
Run A — sample 2010Q3-26Q1 excluding pandemic:
Included observations: 53 after adjustments
R-squared -0.507030 Mean dependent var 0.011627
Adjusted R-squared -0.987998 S.D. dependent var 0.106052
S.E. of regression 0.149530 Sum squared resid 1.050879
(C and 5 lag coefficients estimated on 53 obs)
Run B — full sample 2010Q3-2026Q1, no exclusions:
Included observations: 63 after adjustments
R-squared 0.660304 Mean dependent var 0.011627
Adjusted R-squared 0.630506 S.D. dependent var 0.106052
S.E. of regression 0.064465 Sum squared resid 0.236876
As you can see, the mean dependent variable (0.011627) and S.D. of dependent variable (0.106052) are identical in both runs. So, my pandemic period exclusion is being ignored when it comes to calculating these fit stats.
Similar, the SSR in Run A (1.0509) is clearly being summed over all 63 quarters, including the excluded ones, even though only 53 were used to fit the coefficients. And this is resulting in a negative R-squared.
MIDAS fit statistics (R², SSR, etc..) estimation sample if there's a gap
Moderators: EViews Gareth, EViews Moderator
-
random_user
- Posts: 30
- Joined: Wed Jun 23, 2021 1:48 pm
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13607
- Joined: Tue Sep 16, 2008 5:38 pm
Re: MIDAS fit statistics (R², SSR, etc..) estimation sample if there's a gap
Yep, definitely a bug. We'll fix.
Just if you're interested, here's some code that makes it concrete.
Just if you're interested, here's some code that makes it concrete.
Code: Select all
close @wf
wfcreate(page=q) q 1990 2030
series y=nrnd
pagecreate(page=m) m 1990 2030
series x=nrnd
pageselect q
copy(c=split) m\x *
smpl 1990 2020 2023 2030
equation eq1.midas(midwgt=umidas, fixedlag=3) y c @ m\x
equation eq2.ls y c x_3 x_2 x_1
show eq1
show eq2-
random_user
- Posts: 30
- Joined: Wed Jun 23, 2021 1:48 pm
Re: MIDAS fit statistics (R², SSR, etc..) estimation sample if there's a gap
thank you!
incidentally, wasn't aware of c=split, that's pretty useful.
incidentally, wasn't aware of c=split, that's pretty useful.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13607
- Joined: Tue Sep 16, 2008 5:38 pm
Who is online
Users browsing this forum: No registered users and 2 guests
