[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: Sampling with replacement or bootstrapping in Mata
Michael Manti <firstname.lastname@example.org> asked
> What's the canonical way to sample with replacement from a vector in Mata?
> I'm trying to implement a bootstrap procedure. I've looked at jumble(), but
> that samples without replacement, and I'd prefer to avoid calling out to
> Stata proper if I can. I assume that scaling the results from uniform() in
> some fashion and using them as subscripts is the way to go, but I can't
> quite work out what the code should be.
I do not have a satisfactory answer except to say there is no
sample-with-replacement function in Mata right now. The
process is not simple or I would dash off a routine and include
in this email, or I would tell Michael how to write his own. Instead,
I have just made a note that we need to add this function.
* For searches and help try: