On Mon, 23 Sep 2019, Sven Schreiber wrote:

Am 23.09.2019 um 14:17 schrieb Sven Schreiber:

Yes, I give up ;-)

P.S.: I still think the name 'msample' is suboptimal. The meaning of the
initial m is not clear to me. If it refers to "matrix", I'd say it
should also work on a series. So perhaps "subsample", or "pick", or
whatever.

Yes, the 'm' is supposed to suggest "matrix" -- but actually I think that's right.

We already have "smpl n --random" for datasets, and allowing a single series argument to <function whose name is under discussion> would be a little strange. You couldn't get a series back, it would have to be a vector -- unless you set n equal to the number of observations, thereby just scrambling the series rather than subsampling, which seems an unlikely project.

If for some reason you want to draw a subsample from a particular series in isolation from the dataset as a whole, it seems OK to me that you should "cast" it to a vector -- as in, for a series x,

matrix subx = msample({x}, n)

And in the unlikely event that you want to put into the dataset a scrambled version of an entire series, you could do

series scrambled_x = msample({x}, $nobs)

("casting" the vector result back to a series).

Admittedly there's no rule saying that a function taking a series argument can't return a vector but this would be unusual. Most such functions return either a transformed series or a scalar statistic (with the exception of values()).

Allin



_______________________________________________
Gretl-users mailing list -- gretl-users@gretlml.univpm.it
To unsubscribe send an email to gretl-users-le...@gretlml.univpm.it
Website: 
https://gretlml.univpm.it/postorius/lists/gretl-users.gretlml.univpm.it/

Reply via email to