On Tue, Oct 14, 2025 at 8:12 AM Sven Schreiber
<sven.schreiber(a)fu-berlin.de> wrote:
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.
The "ar" command requires at least one regressor, even if it's just a
constant.
Allin