Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2002

[Date Index] [Thread Index] [Author Index]

Search the Archive

help on bootstrap sample

  • To: mathgroup at
  • Subject: [mg37338] help on bootstrap sample
  • From: Søren Merser <merser at>
  • Date: Thu, 24 Oct 2002 02:55:27 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

Hi Mathematica freeks
I've made two small rutines for sampling (bootstrap statistics)
They are working , but at least 'SampleNoReplace' is rather slow
I was wondering if any of you know of a faster way to do this
Regards soren

SampelReplace[data_List:{0, 1}, n_:1] := 
  Module[{}, data[[Table[Random[Integer, {1, Length@data} ], {n}]]]]

SampelNoReplace[data_List, n_] := Module[{idx, len, res, d, hi, i},
    d = data;
    res = {};
    len = hi = Length@d;
    For[i = 1, i <= n && i <= len, i++,
      idx = Random[Integer, {1, hi--} ];
      AppendTo[res, d[[idx]]];
      d = Drop[d, {idx}];

  • Prev by Date: Re: Formatting and Printing
  • Next by Date: Problem with user defined functions
  • Previous by thread: Re: Overlay ListDensityPlot and Value
  • Next by thread: Re: help on bootstrap sample