[Gretl-devel] Adding observations within a function

Allin Cottrell cottrell at wfu.edu
Tue Jul 28 13:43:03 EDT 2015


At the Berlin gretl conference Marcin asked me if it would be possible 
to enable use of "dataset addobs" within functions.

I can see the point in this: if you're writing a package that's 
intended to do forecasting, it would be very useful to be able to add 
observations, even if just temporarily. This is now in not-CVS [ 
http://ricardo.ecn.wfu.edu/pub/gretl/gretl-updates.tgz ] and 
snapshots (on ricardo.ecn.wfu.edu).

You can use "dataset addobs" in a function only if the end of the 
sample range, on entry, is the end of the dataset (i.e. $t2 cannot be 
restricted, though $t1 could be). And when the function exits the 
extra observations disappear. So if you want to return an out of 
sample forecast you'd have to do that in the form of a matrix.

This is experimental: I'd be interested to hear how it works, from 
people who actually do forecasting!

Allin




More information about the Gretl-devel mailing list