I have a program which is based on a prompt where the user provides a number of inputs. I'm now extending it and having some problems with one part. The program is for forecasting purposes, and what I would like to have is the user provide a list of variables and a sample for which these variables are to be conditioned on. In EViews terms, this means that the user supplies a string with variables and one with a sample which are then to be added to the "exclude" option of a model object. However, my problem is I'm not getting the string versus variable thing right. Here is some example code:
Code: Select all
' User-supplied start and end:
%smpl = "2006q1 2006q1"
'User-supplied variable to exlude:
%variable = "x y"
' Create workfile, series and
' VAR and model objects
create wf q 1960q1 2010q4
series x = nrnd
series y = nrnd
series z = nrnd
smpl 1960q1 2005q4
var var.ls 1 2 x y z
var.makemodel(model)
smpl 2006q1 2010q4
' String containing variable
' to condition on with the
' provided sample
string exclude = @wcross(%variable, "(" + %smpl + ")")
model.exclude {exclude}
Code: Select all
model.exclude "x(2006q1 2006q1)" "y(2006q1 2006q1)"Code: Select all
model.exclude x("2006q1 2006q1") y("2006q1 2006q1")