Am 16.09.2019 um 23:23 schrieb Artur Tarassow:
it seems that we don't have a resample _without_ replacement function
so far -- at least I could not find any. I've got inspired by the
following example from John D. Cook:
https://stackoverflow.com/a/311716
I translated it to hansl and wrote 2 versions. The first one simply
draws n integers from a vector taking values from 1 to N which could
be used for selecting some rows of a matrix in another step. The
second function does the first one's job but returns n randomly drawn
rows from an input matrix X.
I haven't looked very carefully what the functions do, but somehow I
have the feeling that a combination of the functions randgen(u...),
selifr() and uniq() -or perhaps just resample() and uniq()- might do the
job. Of course whether it's quicker would be a matter of testing.
Perhaps it also wouldn't be so difficult to extend the native
resample(). (However, it already has an optional argument...)
Also, maybe one of the functions could be another candidate for
extra.gfn?
Yes, could be. Sorry Artur, I know you made a bunch of suggestions for
extra lately. I also have a pending list. Could you perhaps consolidate
your suggestions of recent weeks/months?
cheers
sven