Comments (6)
Yes the code is correct, i.e. it should run. Note using 252 days it is not a problem in midasr, the problem is whether the data supports that. Are you replicating with the data in the article?
from midasr.
Thank you for your reply!
As indicated in the article, I collect the data from both CRSP and Schwert’s website (I can roughly replicate table 1). After I rehandling the data, I have 876 monthly observations and 19272 daily observations ( I keep 22 daily observations per month, if a month has less than 22 observations, I use NA at the beginning of that month). Then I get the following result:
eqr<-midas_r(month ~ mls(day, 0:251, 22, nealmon), start = list(day = c(1, -0.006, -0.0002)))
MIDAS regression model
model: month ~ mls(day, 0:251, 22, nealmon)
(Intercept) day1 day2 day3
-0.0004250 0.9999963 -0.0059980 -0.0007948
My understanding is that day1 represents the coefficient of mls function (or the gamma), day2 and day3 represent k1 and k2 in the weights function. Please correct me if I misunderstand the results. My day1 coefficient is very close to 1, which is the number I provided. However, I should get something close to 2.6. I am wondering if this problem is due to my data or due to the initial value I provided?
And when I check the mls(day, 0:251, 22, nealmon) matrix, the first 11 lines are NAs. I am also wondering if this is acceptable?
from midasr.
Can you post the screenshot of the model in the article? Your understanding is correct, so the reason for the result which you do not like is the alignment of the data. Look into eqr$model to see that months and days are aligned properly. NA in the first lines are perfectly normal, since you always lose data at the beginning of the sample due to lags.
If you are sure that the data is aligned properly and you are using the same sample, then you can always check the value of NLS objective function with the parameters in the article. The value of objective function for fitted coefficients can be calculated with the following code:
eqr$fn0(coef(eqr))
Supply parameters of article (the order is important!) and then compare the values. If yours is the smaller one, then it means your values are correct and the optimisation method used in the article did not converge properly. If yours is larger then you need to try different optimisation methods. The JSS article contains examples of how to do that. Note this step can only be done when you ensure that the nealmon specification and the data is the same as used in article.
from midasr.
In the paper, they use:
They multiply the weighted average of r^2 with 22 to aggregate the volatility into the monthly level. The question is about 22 in the model. I am wondering if I should also time 22 to my daily observations before I run the regression model, or I should incorporate the 22 into one of the initial parameters provided?
from midasr.
from midasr.
Thank you, Dr. Zemlys! I really appreciate your help.
from midasr.
Related Issues (20)
- MIDAS when dependent variable has higher frequency [feature] HOT 6
- Covariance estimation with time-series of mixed frequencies HOT 1
- midasR does not update forecast
- Not possible to estimate MIDAS model, more parameters than observations // midasr package HOT 4
- two step ahead forecast HOT 1
- Question of MIDAS with panel data HOT 1
- Error in hAh_test() HOT 4
- Contribution variables
- fitted value of in-sample based on average_forecast()
- Issue with average_forecast HOT 1
- Variable lengths differ (trend) HOT 1
- Stationarity - Transformations for Mixed Frequency Data HOT 1
- markov-switching midas models HOT 3
- error when use select_and_forecast HOT 1
- Impove mlsd to work correctly with dates
- Add forecasting to midas_sp, midas_nlpr, midas_mmm and midas_lstr
- Write proper documentation for non-parametric models
- Lint the package
- Regarding k in the mls() HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from midasr.