mpiktas / midasr

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

which is the parameters of nealmon in midas_r ? #47

Closed zhouxiandong closed 7 years ago

zhouxiandong commented 7 years ago

Hello, I'm sorry to that I'm not good at english. Thank you your work for the midas_r package,it's very usefull for me. But there are some problem I can't understand need your hlep. First, I don't know which is the parameters of nealmon in the function midas_r(). like the code in the user_guide: eq.r <- midas_r(y ~ trend + mls(x, 0:7, 4, nealmon) + mls(z,0:16, 12, nealmon), start = list(x = c(1, -0.5), z = c(2,0.5, -0.1))) In this code ,which is the parameters of function nealmon use? Second, aslo in the previous code, the lag K is 7 and 16, but I don't understand why the results of summary(eq.r) only 3 variables as follow:

Formula y ~ trend + mls(x, 0:7, 4, nealmon) + mls(z, 0:16, 12, nealmon)

Parameters:

Estimate Std. Error t value Pr(>|t|)

(Intercept) 1.988196 0.115299 17.24 < 2e-16 ***

trend 0.099883 0.000777 128.57 < 2e-16 ***

x1 1.353343 0.151220 8.95 < 2e-16 ***

x2 -0.507566 0.096670 -5.25 3.3e-07 ***

z1 2.263473 0.172815 13.10 < 2e-16 ***

z2 0.409653 0.155685 2.63 0.00905 **

z3 -0.072979 0.020392 -3.58 0.00042 ***

---## Signif. codes: 0 '_**' 0.001 '_' 0.01 '' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.932 on 242 degrees of freedom

vzemlys commented 7 years ago

In this example there are two nealmon restrictions, one for variable x and one for variable z. The starting parameters for the optimisation, for the nealmon restriction ofx variable are in list element x and similarly starting parameters for the nealmon restriction of z variable are in list element z. Note that nealmon restriction depends on the length of parameter, i.e. if you pass vector of length 2, it uses polynomial of order one, if you pass vector of length 3, it uses polynomial of order 2.

The summary method for midas_r returns the coefficients of MIDAS restriction. The starting values for x and for z tells midas_r to use exponential polynomials of order 1 and 2 respectively, hence you get the corresponding coefficients (the first coefficient is the multiplier).

The JSS article (https://www.jstatsoft.org/article/view/v072i04) has a detailed specification of this example, I suggest to study it more carefully.

zhouxiandong commented 7 years ago

Thank you very much!