Am 25.09.2025 um 18:28 schrieb Sven Schreiber:
<hansl>
# test an aux dataset inside a function
function void internalar (matrix x, int p, series anyoldseries)
# the series argument is only added to trigger inheriting
# the dataset of the caller
x = vec(x)
T = rows(x)
# we know we are working in a panel context
smpl 1 1 --unit
setobs 1 1 --time-series
print $nobs
errorif(T>$nobs, "incoming vector too long")
# smpl 1 T # redundant
series s = x
print
ols s s(-1)
arma p 0; s
# ar p ; s # yields data error
end function
open grunfeld
internalar(mnormal($pd), 2, invest)
</hansl>
but notice that "ar" yields a mysterious data error which might be
independent of the current issue, don't know.
I'm doing a ping on this concerning not the original topic, but the
error with the "ar" line (if you uncomment the last line of the function
in the script above). I just checked on the latest snapshot, where it
persists. Given that the arma command works, I'm not conscious of doing
anything wrong there, but maybe it has to do with initial values or so.
thanks
sven