Hi, I have attached the historical dataset (titled data) containing numerical variables GDP, HPA, FX and Y - I am interested to predict Y given some future values of GDP, HPA and FX. - Some variables are non-statioanry as per adf.test() - I wanted to implement a VECM framework for modeling cointegration, so I have used *result = VECM(data, lag = 3, r = 1)* , and I get the output below showing that cointegration relationship does exist between these 4 variables: - My question is: How do I get predictions of Y given externally-generated future values of the other variables (for say, upcoming 10 time points), using this result programmatically? Regards, Preetam ############# Model VECM ############# Full sample size: 25 End sample size: 22 Number of variables: 4 Number of estimated slope parameters 40 AIC 23.84198 BIC 70.75681 SSR 156.5155 Cointegrating vector (estimated by ML): GDP HPA FX Y r1 1 2.171994 -6.823215 -0.07767563 ECT Intercept GDP -1 Equation GDP 0.0612(0.0436) 0.0141(0.0687) -0.4268(0.2494) Equation HPA -0.6368(0.2381)* 0.1858(0.3749) 3.1656(1.3609)* Equation FX 0.1307(0.0874) -0.0039(0.1377) 0.1739(0.4997) Equation Y -0.0852(0.4261) 0.3219(0.6711) -5.0248(2.4359). HPA -1 FX -1 Y -1 Equation GDP -0.0910(0.0790) 0.1988(0.2261) 0.0413(0.0299) Equation HPA 0.4891(0.4311) -2.2140(1.2337). -0.3206(0.1631). Equation FX -0.2108(0.1583) -0.2536(0.4530) -0.0303(0.0599) Equation Y -0.3686(0.7716) 0.5234(2.2083) -0.9638(0.2920)** GDP -2 HPA -2 FX -2 Equation GDP -0.2892(0.2452) -0.0622(0.0563) 0.0598(0.1352) Equation HPA -0.7084(1.3379) 0.1877(0.3069) -0.2231(0.7377) Equation FX -0.1773(0.4913) -0.0170(0.1127) -0.2486(0.2709) Equation Y -3.8521(2.3948) -0.4559(0.5494) 1.1239(1.3205) Y -2 Equation GDP 0.0411(0.0279) Equation HPA -0.2447(0.1521) Equation FX -0.0102(0.0559) Equation Y -0.1696(0.2723) -------------- next part -------------- GDP HPA FX Y 0.514662421 0.635997077 1.37802145 1.773342598 0.936722 3.127683176 1.391916535 3.709809052 0.101482324 1.270555421 0.831157511 0.226267793 0.017548634 2.456061547 1.003945759 9.510258161 0.236462416 0.988324147 0.223682679 5.026671536 0.372005149 2.177631629 0.904226065 4.219235789 0.153915709 4.620341653 0.033410743 3.17396006 0.524887329 1.050861084 0.518201484 7.950098612 0.776616937 0.503349512 0.666089868 3.320938471 0.760074361 3.635853456 0.470220952 6.380945175 0.802986662 1.260738545 0.452674872 1.036040804 0.375145127 0.20035625 1.837306306 6.486871565 0.002568896 3.532359526 0.556752154 8.536594244 0.754309276 3.952381767 0.247402168 8.559081716 0.585966577 4.01463047 1.184382133 0.148121669 0.39767356 1.553753452 0.983129422 5.378373676 0.859898623 4.73191381 0.828795696 3.367809329 0.741376169 4.993350692 1.758051281 5.516460988 0.329240391 3.465836416 1.701655508 1.249497907 0.078661064 3.298298811 0.04575857 5.132921426 0.270971873 0.46627043 1.739487411 4.94697541 0.731072625 0.940642982 0.728747166 7.583041122 0.385038046 3.51048946 0.021866584 7.361148458 0.530760376 1.204422978 0.415530715 1.163503483 0.555323667 4.777712592 1.844184811 8.596644394
Searching on "VECM" on rseek.org brought up: "VECM" on the Rdocumentation site, which clearly states: "The predict method contains a newdata argument allowing to compute rolling forecasts." If that is not what you want, you'll need to explain why not, I think. If it is, please do such searching on your own in future. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Tue, Feb 14, 2017 at 4:18 AM, Preetam Pal <lordpreetam at gmail.com> wrote:> Hi, > > I have attached the historical dataset (titled data) containing numerical > variables GDP, HPA, FX and Y - I am interested to predict Y given some > future values of GDP, HPA and FX. > > - Some variables are non-statioanry as per adf.test() > - I wanted to implement a VECM framework for modeling cointegration, so > I have used *result = VECM(data, lag = 3, r = 1)* , and I get the output > below showing that cointegration relationship does exist between these 4 > variables: > - My question is: How do I get predictions of Y given > externally-generated future values of the other variables (for say, > upcoming 10 time points), using this result programmatically? > > Regards, > Preetam > ############# > Model VECM > ############# > Full sample size: 25 End sample size: 22 > Number of variables: 4 Number of estimated slope parameters 40 > AIC 23.84198 BIC 70.75681 SSR 156.5155 > Cointegrating vector (estimated by ML): > GDP HPA FX Y > r1 1 2.171994 -6.823215 -0.07767563 > > > ECT Intercept GDP -1 > Equation GDP 0.0612(0.0436) 0.0141(0.0687) -0.4268(0.2494) > Equation HPA -0.6368(0.2381)* 0.1858(0.3749) 3.1656(1.3609)* > Equation FX 0.1307(0.0874) -0.0039(0.1377) 0.1739(0.4997) > Equation Y -0.0852(0.4261) 0.3219(0.6711) -5.0248(2.4359). > HPA -1 FX -1 Y -1 > Equation GDP -0.0910(0.0790) 0.1988(0.2261) 0.0413(0.0299) > Equation HPA 0.4891(0.4311) -2.2140(1.2337). -0.3206(0.1631). > Equation FX -0.2108(0.1583) -0.2536(0.4530) -0.0303(0.0599) > Equation Y -0.3686(0.7716) 0.5234(2.2083) -0.9638(0.2920)** > GDP -2 HPA -2 FX -2 > Equation GDP -0.2892(0.2452) -0.0622(0.0563) 0.0598(0.1352) > Equation HPA -0.7084(1.3379) 0.1877(0.3069) -0.2231(0.7377) > Equation FX -0.1773(0.4913) -0.0170(0.1127) -0.2486(0.2709) > Equation Y -3.8521(2.3948) -0.4559(0.5494) 1.1239(1.3205) > Y -2 > Equation GDP 0.0411(0.0279) > Equation HPA -0.2447(0.1521) > Equation FX -0.0102(0.0559) > Equation Y -0.1696(0.2723) > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
Hey Bert, The predict function in the link you mentioned does not seem to use independently generated future values of the variables cpiUSA and cpiCAN in calculating the future values of the variable of interest, i.e. dolCAN. As I mentioned in the mail, I have the future cpiUSA and cpiCAN values externally given to me (instead of generated by VECM), which I need to use.Let me know if this explains what I am trying to get here. Thanks. Regards, Preetam [[alternative HTML version deleted]]