Hello altogether,
here is a excerpt of my code (from a state space model), which is inside a loop:
smpl 9/22/2014+!forecasthorizon+!h-1 9/22/2014+!forecasthorizon+!h-1
' sets the forecast horizon
{%modelname}{!forecasthorizon}.forecast(m=n,n=!forecasthorizon) @state * @signal {%modelname}{!forecasthorizon}_lcdsprognose_d @signalse {%modelname}{!forecasthorizon}_lcdsprognosese_d
' generates the forecasts
scalar dummyeins = @elem({%modelname}{!forecasthorizon}_lcdsprognose_d,"9/22/2014+!forecasthorizon+!h-1")
scalar dummyzwei = @elem({%modelname}{!forecasthorizon}_lcdsprognosese_d,"9/22/2014+!forecasthorizon+!h-1")
matrix prognose(!h,1) = dummyeins
matrix prognosese(!h,1) = dummyzwei
series {%modelname}{!forecasthorizon}_lcdsprognose
series {%modelname}{!forecasthorizon}_lcdsprognosese
mtos(prognose,{%modelname}{!forecasthorizon}_lcdsprognose)
mtos(prognosese,{%modelname}{!forecasthorizon}_lcdsprognosese
This code should generate a forecast window from a recursive estimation scheme. The forecasting values for the signals and signal se's should be stored in the matrices prognose and prognosese, where !h goes forward one step in the forecast window.
My problem:
i get (not surprisingly!) the message, that "9/22/2014+!forecasthorizon+!h-1" in the program rows "scalar dummyeins" and "scalar dummyzwei" is a illegal date. How can i extract the desired element of the signal series and subsequently transform it into a scalar?
Thank you very much!
Kind regards, Yohan
how to store a single value from a series into a matrix?
Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13318
- Joined: Tue Sep 16, 2008 5:38 pm
Re: how to store a single value from a series into a matrix?
Code: Select all
%date = @datestr(@dateval(9/22/2014)+!forecasthorizon+!h-1, "YYYY/MM/DD")
scalar dummyeins = @elem({%modelname}{!forecasthorizon}_lcdsprognose_d,%date)
Follow us on Twitter @IHSEViews
Who is online
Users browsing this forum: No registered users and 32 guests