Page 1 of 1

Data Type for Sample Inputs in autoarma

Posted: Sun Oct 22, 2023 2:52 pm
by MarMal
Hello,

I would like to ask a question regarding the variable type needed for sample inputs in autoarma.

My question is as follows. I am working on a forecast series which requires the ARIMA'ing of a number of indicator series. These indicator series are updated on a monthly basis. Currently, I use the following specification (which works):

series_name.autoarma(smpl="1924M01 2023M09", forclen="2023M11") series_name_f c ' Just an example

However, as there are quite a few series involved, it would be a bit of a hassle for me to modify the endpoint in the autoarma sample and the forecast length manually each time there is a data update, and it may also lead to mistakes in case there have been updates I am not aware of (I cannot run this in a loop because they have different starting dates / data release dates).

As a result, I would appreciate it if anybody could tell me if there is a way to input the autoarma sample (the smpl= portion) with the likes of @ifirst and @ilast, and to input 'forclen' as a scalar (as it is the same across all series). This would mean that the autoarma automatically updates as the data itself updates. When I tried @ifirst, however, I got the following error:

"Invalid specification for forecast length or endpoint in
"series_name.AUTOARMA(SMPL=@IFIRST(series_name)
@ILAST(series_name), FORCLEN="2023M11") series_name_F C"
on line xxx."

Ditto when I tried to input 'forclen' as a pre-defined scalar.

Thank you in advance for the help! And one other small clarification, please - should there accidentally be any NAs in-between the first and last dates with data in a series, would @ilast stop at the first NA or look for the last point with data, regardless of how many NAs come before that? Thank you!

Re: Data Type for Sample Inputs in autoarma

Posted: Mon Oct 23, 2023 9:32 am
by EViews Gareth
Store the sample end points into string variables, and then use the string variables in the autoarma command.

Code: Select all

%first = @ilast(series_name) %last = @ilast(series_name) %smpl = %first + " " + %last series_name.autoarma(smpl=%smpl)

Re: Data Type for Sample Inputs in autoarma

Posted: Mon Oct 23, 2023 4:03 pm
by MarMal
Dear Gareth,

Thank you very much for the quick response. I believe @ifirst and @ilast generate scalars and not strings, but guided by your suggestion I ended up using the following, and it works:

smpl relevant_sample
%forclen = @right(@pagesmpl,7) ' As relevant_sample is in 'YYYY[M]MM' format
smpl @all

%first = series_name.@first
%last = series_name.@last
%smpl = %first + " " + %last
series_name.autoarma(smpl=%smpl, forclen=%forclen) series_name_f c

Now I can actually run this within a loop. I also verified manually that @last picks up the date with the latest datapoint in the series regardless of whether there are any NAs in-between. Thank you very much!