http://www.mathworks.com/matlabcentral/newsreader/view_thread/289482
MATLAB Central Newsreader  Bootstrapping multivariate data
Feed for thread: Bootstrapping multivariate data
enus
©19942015 by MathWorks, Inc.
webmaster@mathworks.com
MATLAB Central Newsreader
http://blogs.law.harvard.edu/tech/rss
60
MathWorks
http://www.mathworks.com/images/membrane_icon.gif

Tue, 17 Aug 2010 05:59:05 +0000
Bootstrapping multivariate data
http://www.mathworks.com/matlabcentral/newsreader/view_thread/289482#772001
CT
Hi all,<br>
<br>
I am searching for a Matlab function that can do the nonparametric bootstrapping of multivariate data. For instance, I have a matrix of sample data (MxN) where M is the dimension of the random vector (multivariate data), and N is the number of observation. I want to generate (resample) bootstrap data from this initial multivariate data. Does anyone knows this function?<br>
<br>
Thank you very much for your help.<br>
<br>
Best regards, <br>
CT DO

Tue, 17 Aug 2010 06:33:42 +0000
Re: Bootstrapping multivariate data
http://www.mathworks.com/matlabcentral/newsreader/view_thread/289482#772004
Rogelio
"CT " <congthanh.do@hotmail.fr> wrote in message <i4d8f9$n3a$1@fred.mathworks.com>...<br>
> Hi all,<br>
> <br>
> I am searching for a Matlab function that can do the nonparametric bootstrapping of multivariate data. For instance, I have a matrix of sample data (MxN) where M is the dimension of the random vector (multivariate data), and N is the number of observation. I want to generate (resample) bootstrap data from this initial multivariate data. Does anyone knows this function?<br>
> <br>
> Thank you very much for your help.<br>
> <br>
> Best regards, <br>
> CT DO <br>
<br>
matlab does not not have a prebuilt function for multivariate data.However, in the file exhcnage you can find a code, the function is called 'bstrag'

Tue, 17 Aug 2010 12:34:34 +0000
Re: Bootstrapping multivariate data
http://www.mathworks.com/matlabcentral/newsreader/view_thread/289482#772093
Peter Perkins
On 8/17/2010 1:59 AM, CT wrote:<br>
> I am searching for a Matlab function that can do the nonparametric<br>
> bootstrapping of multivariate data. For instance, I have a matrix of<br>
> sample data (MxN) where M is the dimension of the random vector<br>
> (multivariate data), and N is the number of observation. I want to<br>
> generate (resample) bootstrap data from this initial multivariate data.<br>
> Does anyone knows this function?<br>
<br>
If you have access to the Statistics Toolbox, the BOOTSTRP function does <br>
what you are asking. it is here:<br>
<br>
<<a href="http://www.mathworks.com/access/helpdesk/help/toolbox/stat">http://www.mathworks.com/access/helpdesk/help/toolbox/stat</a> /bootstrp.html>

Tue, 17 Aug 2010 14:18:05 +0000
Re: Bootstrapping multivariate data
http://www.mathworks.com/matlabcentral/newsreader/view_thread/289482#772124
Simon Preston
Peter Perkins <Peter.Perkins@MathRemoveThisWorks.com> wrote in message <i4dvkq$8ns$2@fred.mathworks.com>...<br>
> On 8/17/2010 1:59 AM, CT wrote:<br>
> > I am searching for a Matlab function that can do the nonparametric<br>
> > bootstrapping of multivariate data. For instance, I have a matrix of<br>
> > sample data (MxN) where M is the dimension of the random vector<br>
> > (multivariate data), and N is the number of observation. I want to<br>
> > generate (resample) bootstrap data from this initial multivariate data.<br>
> > Does anyone knows this function?<br>
> <br>
> If you have access to the Statistics Toolbox, the BOOTSTRP function does <br>
> what you are asking. it is here:<br>
> <br>
> <<a href="http://www.mathworks.com/access/helpdesk/help/toolbox/stat">http://www.mathworks.com/access/helpdesk/help/toolbox/stat</a> /bootstrp.html><br>
<br>
Isn't this just:<br>
<br>
X(:,ceil(rand(1,N)*N))<br>
<br>
where X is the sample matrix?

Tue, 17 Aug 2010 16:31:11 +0000
Re: Bootstrapping multivariate data
http://www.mathworks.com/matlabcentral/newsreader/view_thread/289482#772162
CT
Thank you all for your replies. I'll try to perform your suggestions and will let you know about the results.<br>
<br>
CT DO<br>
<br>
<br>
"Simon Preston" <preston.simon+mathsworks@gmail.com> wrote in message <i4e5mt$c2f$1@fred.mathworks.com>...<br>
> Peter Perkins <Peter.Perkins@MathRemoveThisWorks.com> wrote in message <i4dvkq$8ns$2@fred.mathworks.com>...<br>
> > On 8/17/2010 1:59 AM, CT wrote:<br>
> > > I am searching for a Matlab function that can do the nonparametric<br>
> > > bootstrapping of multivariate data. For instance, I have a matrix of<br>
> > > sample data (MxN) where M is the dimension of the random vector<br>
> > > (multivariate data), and N is the number of observation. I want to<br>
> > > generate (resample) bootstrap data from this initial multivariate data.<br>
> > > Does anyone knows this function?<br>
> > <br>
> > If you have access to the Statistics Toolbox, the BOOTSTRP function does <br>
> > what you are asking. it is here:<br>
> > <br>
> > <<a href="http://www.mathworks.com/access/helpdesk/help/toolbox/stat">http://www.mathworks.com/access/helpdesk/help/toolbox/stat</a> /bootstrp.html><br>
> <br>
> Isn't this just:<br>
> <br>
> X(:,ceil(rand(1,N)*N))<br>
> <br>
> where X is the sample matrix?

Tue, 17 Aug 2010 17:58:47 +0000
Re: Bootstrapping multivariate data
http://www.mathworks.com/matlabcentral/newsreader/view_thread/289482#772191
Peter Perkins
On 8/17/2010 10:18 AM, Simon Preston wrote:<br>
>> <<a href="http://www.mathworks.com/access/helpdesk/help/toolbox/stat">http://www.mathworks.com/access/helpdesk/help/toolbox/stat</a><br>
>> /bootstrp.html><br>
<br>
Sorry, for some reason that link was missing an "s"<br>
<<a href="http://www.mathworks.com/access/helpdesk/help/toolbox/stats/bootstrp.html">http://www.mathworks.com/access/helpdesk/help/toolbox/stats/bootstrp.html</a>><br>
<br>
> Isn't this just:<br>
><br>
> X(:,ceil(rand(1,N)*N))<br>
><br>
> where X is the sample matrix?<br>
<br>
That's the basis of it, yes. But:<br>
<br>
1) It's kind of tedious to write the same loop over and over, regardless <br>
of how simple that loop is,<br>
1) There is a good deal of flexibility in the arguments you can pass to <br>
BOOTSTRP, so a single matrix isn't the only case it handles for you, and<br>
2) (in recent MATLAB releases) There is support for parallelizing the <br>
computations using PARFOR (if your installation supports that)<br>
<br>
Just as an aside, since 2008b you might find it easier to use RANDI to <br>
generate random integers.

Tue, 17 Aug 2010 19:31:04 +0000
Re: Bootstrapping multivariate data
http://www.mathworks.com/matlabcentral/newsreader/view_thread/289482#772224
Rogelio
Peter Perkins <Peter.Perkins@MathRemoveThisWorks.com> wrote in message <i4eikn$ndn$1@fred.mathworks.com>...<br>
> On 8/17/2010 10:18 AM, Simon Preston wrote:<br>
> >> <<a href="http://www.mathworks.com/access/helpdesk/help/toolbox/stat">http://www.mathworks.com/access/helpdesk/help/toolbox/stat</a><br>
> >> /bootstrp.html><br>
> <br>
> Sorry, for some reason that link was missing an "s"<br>
> <<a href="http://www.mathworks.com/access/helpdesk/help/toolbox/stats/bootstrp.html">http://www.mathworks.com/access/helpdesk/help/toolbox/stats/bootstrp.html</a>><br>
> <br>
> > Isn't this just:<br>
> ><br>
> > X(:,ceil(rand(1,N)*N))<br>
> ><br>
> > where X is the sample matrix?<br>
> <br>
> That's the basis of it, yes. But:<br>
> <br>
> 1) It's kind of tedious to write the same loop over and over, regardless <br>
> of how simple that loop is,<br>
> 1) There is a good deal of flexibility in the arguments you can pass to <br>
> BOOTSTRP, so a single matrix isn't the only case it handles for you, and<br>
> 2) (in recent MATLAB releases) There is support for parallelizing the <br>
> computations using PARFOR (if your installation supports that)<br>
> <br>
> Just as an aside, since 2008b you might find it easier to use RANDI to <br>
> generate random integers.<br>
<br>
Just one thing to point out, you said that M is the dimention of the data. I thought that you ment different groups or different experiments where the data was collected, after all thats why your data is not of dimenation N*M x 1, for instance. If the columns of the matrix represent different groups, for some or another reason, you cannot pool the series. As far as know 'bootstrp' does not distinguishes among different groups. If this last statement is incorrect, can someone send me the link to read about it. <br>
Thanks

Wed, 18 Aug 2010 06:17:24 +0000
Re: Bootstrapping multivariate data
http://www.mathworks.com/matlabcentral/newsreader/view_thread/289482#772331
CT
I mean that I have N observations of the random vectors x, the vector x has M elements, these are the seed data. So each variable here is a vector (of M elements). Their probability density distribution (pdf) might be multivariate distribution, e.g. Gaussian mixture model (GMM). Since the bootstrap here is nonparametric, the N observations will be used instead of a concrete pdf.<br>
<br>
I have tried to used BOOTSTRP to perform the bootstrapping, but it is not easy, even unfeasible (tell me if I am wrong), since the manual of BOOTSTRP in Matlab is not clear in this case (I think).<br>
<br>
If the generated data is only X(:,ceil(rand(1,N)*N)), I don't see anything new that the bootstrap can bring. As I see, this is only a disorder of the initial data, we cannot expect anything different from the new data, I'm wrong?<br>
<br>
"Rogelio " <rogelioa@math.uio.no> wrote in message <i4eo1o$c8b$1@fred.mathworks.com>...<br>
> Peter Perkins <Peter.Perkins@MathRemoveThisWorks.com> wrote in message <i4eikn$ndn$1@fred.mathworks.com>...<br>
> > On 8/17/2010 10:18 AM, Simon Preston wrote:<br>
> > >> <<a href="http://www.mathworks.com/access/helpdesk/help/toolbox/stat">http://www.mathworks.com/access/helpdesk/help/toolbox/stat</a><br>
> > >> /bootstrp.html><br>
> > <br>
> > Sorry, for some reason that link was missing an "s"<br>
> > <<a href="http://www.mathworks.com/access/helpdesk/help/toolbox/stats/bootstrp.html">http://www.mathworks.com/access/helpdesk/help/toolbox/stats/bootstrp.html</a>><br>
> > <br>
> > > Isn't this just:<br>
> > ><br>
> > > X(:,ceil(rand(1,N)*N))<br>
> > ><br>
> > > where X is the sample matrix?<br>
> > <br>
> > That's the basis of it, yes. But:<br>
> > <br>
> > 1) It's kind of tedious to write the same loop over and over, regardless <br>
> > of how simple that loop is,<br>
> > 1) There is a good deal of flexibility in the arguments you can pass to <br>
> > BOOTSTRP, so a single matrix isn't the only case it handles for you, and<br>
> > 2) (in recent MATLAB releases) There is support for parallelizing the <br>
> > computations using PARFOR (if your installation supports that)<br>
> > <br>
> > Just as an aside, since 2008b you might find it easier to use RANDI to <br>
> > generate random integers.<br>
> <br>
> Just one thing to point out, you said that M is the dimention of the data. I thought that you ment different groups or different experiments where the data was collected, after all thats why your data is not of dimenation N*M x 1, for instance. If the columns of the matrix represent different groups, for some or another reason, you cannot pool the series. As far as know 'bootstrp' does not distinguishes among different groups. If this last statement is incorrect, can someone send me the link to read about it. <br>
> Thanks

Wed, 18 Aug 2010 06:55:23 +0000
Re: Bootstrapping multivariate data
http://www.mathworks.com/matlabcentral/newsreader/view_thread/289482#772336
Rogelio
If you are saying or have a feeling that your data might come from a multivariate distribution, then as far as I know 'bootstrp' will pool your data together, assuming they come from the same pdf which might be an erronous assumption. <br>
> I have tried to used BOOTSTRP to perform the bootstrapping, but it is not easy, even unfeasible (tell me if I am wrong), since the manual of BOOTSTRP in Matlab is not clear in this case (I think)<<br>
Why? can you tell us what is the mistake or post the code<br>
>As I see, this is only a disorder of the initial data, we cannot expect anything different from the new data, I'm wrong?<<br>
What the bootstrapring does, roughly speaking, is to resample with replacement. We create pseudo random variables out from your original data. The empirical pdf will converge to the pdf, this is asymptotically. <br>
<br>
<br>
"CT " <congthanh.do@hotmail.fr> wrote in message <i4fttk$qpk$1@fred.mathworks.com>...<br>
> I mean that I have N observations of the random vectors x, the vector x has M elements, these are the seed data. So each variable here is a vector (of M elements). Their probability density distribution (pdf) might be multivariate distribution, e.g. Gaussian mixture model (GMM). Since the bootstrap here is nonparametric, the N observations will be used instead of a concrete pdf.<br>
> <br>
> I have tried to used BOOTSTRP to perform the bootstrapping, but it is not easy, even unfeasible (tell me if I am wrong), since the manual of BOOTSTRP in Matlab is not clear in this case (I think).<br>
> <br>
> If the generated data is only X(:,ceil(rand(1,N)*N)), I don't see anything new that the bootstrap can bring. As I see, this is only a disorder of the initial data, we cannot expect anything different from the new data, I'm wrong?<br>
> <br>
> "Rogelio " <rogelioa@math.uio.no> wrote in message <i4eo1o$c8b$1@fred.mathworks.com>...<br>
> > Peter Perkins <Peter.Perkins@MathRemoveThisWorks.com> wrote in message <i4eikn$ndn$1@fred.mathworks.com>...<br>
> > > On 8/17/2010 10:18 AM, Simon Preston wrote:<br>
> > > >> <<a href="http://www.mathworks.com/access/helpdesk/help/toolbox/stat">http://www.mathworks.com/access/helpdesk/help/toolbox/stat</a><br>
> > > >> /bootstrp.html><br>
> > > <br>
> > > Sorry, for some reason that link was missing an "s"<br>
> > > <<a href="http://www.mathworks.com/access/helpdesk/help/toolbox/stats/bootstrp.html">http://www.mathworks.com/access/helpdesk/help/toolbox/stats/bootstrp.html</a>><br>
> > > <br>
> > > > Isn't this just:<br>
> > > ><br>
> > > > X(:,ceil(rand(1,N)*N))<br>
> > > ><br>
> > > > where X is the sample matrix?<br>
> > > <br>
> > > That's the basis of it, yes. But:<br>
> > > <br>
> > > 1) It's kind of tedious to write the same loop over and over, regardless <br>
> > > of how simple that loop is,<br>
> > > 1) There is a good deal of flexibility in the arguments you can pass to <br>
> > > BOOTSTRP, so a single matrix isn't the only case it handles for you, and<br>
> > > 2) (in recent MATLAB releases) There is support for parallelizing the <br>
> > > computations using PARFOR (if your installation supports that)<br>
> > > <br>
> > > Just as an aside, since 2008b you might find it easier to use RANDI to <br>
> > > generate random integers.<br>
> > <br>
> > Just one thing to point out, you said that M is the dimention of the data. I thought that you ment different groups or different experiments where the data was collected, after all thats why your data is not of dimenation N*M x 1, for instance. If the columns of the matrix represent different groups, for some or another reason, you cannot pool the series. As far as know 'bootstrp' does not distinguishes among different groups. If this last statement is incorrect, can someone send me the link to read about it. <br>
> > Thanks

Wed, 18 Aug 2010 07:08:05 +0000
Re: Bootstrapping multivariate data
http://www.mathworks.com/matlabcentral/newsreader/view_thread/289482#772337
Rogelio
By the way ...... what is the statistc that you are bootstraping? it will be nice if you post the code.<br>
<br>
"Rogelio " <rogelioa@math.uio.no> wrote in message <i4g04r$fa8$1@fred.mathworks.com>...<br>
> If you are saying or have a feeling that your data might come from a multivariate distribution, then as far as I know 'bootstrp' will pool your data together, assuming they come from the same pdf which might be an erronous assumption. <br>
> > I have tried to used BOOTSTRP to perform the bootstrapping, but it is not easy, even unfeasible (tell me if I am wrong), since the manual of BOOTSTRP in Matlab is not clear in this case (I think)<<br>
> Why? can you tell us what is the mistake or post the code<br>
> >As I see, this is only a disorder of the initial data, we cannot expect anything different from the new data, I'm wrong?<<br>
> What the bootstrapring does, roughly speaking, is to resample with replacement. We create pseudo random variables out from your original data. The empirical pdf will converge to the pdf, this is asymptotically. <br>
> <br>
> <br>
> "CT " <congthanh.do@hotmail.fr> wrote in message <i4fttk$qpk$1@fred.mathworks.com>...<br>
> > I mean that I have N observations of the random vectors x, the vector x has M elements, these are the seed data. So each variable here is a vector (of M elements). Their probability density distribution (pdf) might be multivariate distribution, e.g. Gaussian mixture model (GMM). Since the bootstrap here is nonparametric, the N observations will be used instead of a concrete pdf.<br>
> > <br>
> > I have tried to used BOOTSTRP to perform the bootstrapping, but it is not easy, even unfeasible (tell me if I am wrong), since the manual of BOOTSTRP in Matlab is not clear in this case (I think).<br>
> > <br>
> > If the generated data is only X(:,ceil(rand(1,N)*N)), I don't see anything new that the bootstrap can bring. As I see, this is only a disorder of the initial data, we cannot expect anything different from the new data, I'm wrong?<br>
> > <br>
> > "Rogelio " <rogelioa@math.uio.no> wrote in message <i4eo1o$c8b$1@fred.mathworks.com>...<br>
> > > Peter Perkins <Peter.Perkins@MathRemoveThisWorks.com> wrote in message <i4eikn$ndn$1@fred.mathworks.com>...<br>
> > > > On 8/17/2010 10:18 AM, Simon Preston wrote:<br>
> > > > >> <<a href="http://www.mathworks.com/access/helpdesk/help/toolbox/stat">http://www.mathworks.com/access/helpdesk/help/toolbox/stat</a><br>
> > > > >> /bootstrp.html><br>
> > > > <br>
> > > > Sorry, for some reason that link was missing an "s"<br>
> > > > <<a href="http://www.mathworks.com/access/helpdesk/help/toolbox/stats/bootstrp.html">http://www.mathworks.com/access/helpdesk/help/toolbox/stats/bootstrp.html</a>><br>
> > > > <br>
> > > > > Isn't this just:<br>
> > > > ><br>
> > > > > X(:,ceil(rand(1,N)*N))<br>
> > > > ><br>
> > > > > where X is the sample matrix?<br>
> > > > <br>
> > > > That's the basis of it, yes. But:<br>
> > > > <br>
> > > > 1) It's kind of tedious to write the same loop over and over, regardless <br>
> > > > of how simple that loop is,<br>
> > > > 1) There is a good deal of flexibility in the arguments you can pass to <br>
> > > > BOOTSTRP, so a single matrix isn't the only case it handles for you, and<br>
> > > > 2) (in recent MATLAB releases) There is support for parallelizing the <br>
> > > > computations using PARFOR (if your installation supports that)<br>
> > > > <br>
> > > > Just as an aside, since 2008b you might find it easier to use RANDI to <br>
> > > > generate random integers.<br>
> > > <br>
> > > Just one thing to point out, you said that M is the dimention of the data. I thought that you ment different groups or different experiments where the data was collected, after all thats why your data is not of dimenation N*M x 1, for instance. If the columns of the matrix represent different groups, for some or another reason, you cannot pool the series. As far as know 'bootstrp' does not distinguishes among different groups. If this last statement is incorrect, can someone send me the link to read about it. <br>
> > > Thanks

Wed, 18 Aug 2010 12:22:25 +0000
Re: Bootstrapping multivariate data
http://www.mathworks.com/matlabcentral/newsreader/view_thread/289482#772399
Peter Perkins
On 8/18/2010 2:55 AM, Rogelio wrote:<br>
> If you are saying or have a feeling that your data might come from a<br>
> multivariate distribution, then as far as I know 'bootstrp' will pool<br>
> your data together, assuming they come from the same pdf which might be<br>
> an erronous assumption.<br>
<br>
Rogelio, your definition of "multivariate" seems to mean "grouped" or <br>
"stratified" or "from a mixture distribution". The usual way to define <br>
"multivariate" is simply that there are multiple variables. You are <br>
correct that BOOTSTRP does not resample with stratification, but it's <br>
not clear that that is what the OP was asking about.

Wed, 18 Aug 2010 15:55:28 +0000
Re: Bootstrapping multivariate data
http://www.mathworks.com/matlabcentral/newsreader/view_thread/289482#772490
CT
For instance, I have a matrix X(M,N) = X(3,500) of initial data. There are thus N = 500 observations of random vector trivariate random vector x following the multivariate normal distribution. These data can be generated by the code:<br>
mu = [1 1 2]; Sigma = [2 1 1; 1 2 1; 1 1 2];<br>
X = mvnrnd(mu, Sigma, 500);<br>
I don't know if I can use 'bootstrp' to generate the data of the same nature, i.e. they follow (asymptotically) the multivariate normal distribution that I have used to generate X:<br>
[bootstat, bootsamp] = bootstrp(10, [], X); (I don't care about the stats of the data at the moment, I want to have the resampled data only).<br>
<br>
However, 'bootstrp' returns the matrix bootsamp of dimension 500x10, so 'bootstrp' has done only for one dimensional variable? And I don't know if 'bootstrp' can return the stats for multivariate distribution or not? (here are the mean vector and covariance matrix)<br>
<br>
"Rogelio " <rogelioa@math.uio.no> wrote in message <i4g0sl$a6k$1@fred.mathworks.com>...<br>
> By the way ...... what is the statistc that you are bootstraping? it will be nice if you post the code.<br>
> <br>
> "Rogelio " <rogelioa@math.uio.no> wrote in message <i4g04r$fa8$1@fred.mathworks.com>...<br>
> > If you are saying or have a feeling that your data might come from a multivariate distribution, then as far as I know 'bootstrp' will pool your data together, assuming they come from the same pdf which might be an erronous assumption. <br>
> > > I have tried to used BOOTSTRP to perform the bootstrapping, but it is not easy, even unfeasible (tell me if I am wrong), since the manual of BOOTSTRP in Matlab is not clear in this case (I think)<<br>
> > Why? can you tell us what is the mistake or post the code<br>
> > >As I see, this is only a disorder of the initial data, we cannot expect anything different from the new data, I'm wrong?<<br>
> > What the bootstrapring does, roughly speaking, is to resample with replacement. We create pseudo random variables out from your original data. The empirical pdf will converge to the pdf, this is asymptotically. <br>
> > <br>
> > <br>
> > "CT " <congthanh.do@hotmail.fr> wrote in message <i4fttk$qpk$1@fred.mathworks.com>...<br>
> > > I mean that I have N observations of the random vectors x, the vector x has M elements, these are the seed data. So each variable here is a vector (of M elements). Their probability density distribution (pdf) might be multivariate distribution, e.g. Gaussian mixture model (GMM). Since the bootstrap here is nonparametric, the N observations will be used instead of a concrete pdf.<br>
> > > <br>
> > > I have tried to used BOOTSTRP to perform the bootstrapping, but it is not easy, even unfeasible (tell me if I am wrong), since the manual of BOOTSTRP in Matlab is not clear in this case (I think).<br>
> > > <br>
> > > If the generated data is only X(:,ceil(rand(1,N)*N)), I don't see anything new that the bootstrap can bring. As I see, this is only a disorder of the initial data, we cannot expect anything different from the new data, I'm wrong?<br>
> > > <br>
> > > "Rogelio " <rogelioa@math.uio.no> wrote in message <i4eo1o$c8b$1@fred.mathworks.com>...<br>
> > > > Peter Perkins <Peter.Perkins@MathRemoveThisWorks.com> wrote in message <i4eikn$ndn$1@fred.mathworks.com>...<br>
> > > > > On 8/17/2010 10:18 AM, Simon Preston wrote:<br>
> > > > > >> <<a href="http://www.mathworks.com/access/helpdesk/help/toolbox/stat">http://www.mathworks.com/access/helpdesk/help/toolbox/stat</a><br>
> > > > > >> /bootstrp.html><br>
> > > > > <br>
> > > > > Sorry, for some reason that link was missing an "s"<br>
> > > > > <<a href="http://www.mathworks.com/access/helpdesk/help/toolbox/stats/bootstrp.html">http://www.mathworks.com/access/helpdesk/help/toolbox/stats/bootstrp.html</a>><br>
> > > > > <br>
> > > > > > Isn't this just:<br>
> > > > > ><br>
> > > > > > X(:,ceil(rand(1,N)*N))<br>
> > > > > ><br>
> > > > > > where X is the sample matrix?<br>
> > > > > <br>
> > > > > That's the basis of it, yes. But:<br>
> > > > > <br>
> > > > > 1) It's kind of tedious to write the same loop over and over, regardless <br>
> > > > > of how simple that loop is,<br>
> > > > > 1) There is a good deal of flexibility in the arguments you can pass to <br>
> > > > > BOOTSTRP, so a single matrix isn't the only case it handles for you, and<br>
> > > > > 2) (in recent MATLAB releases) There is support for parallelizing the <br>
> > > > > computations using PARFOR (if your installation supports that)<br>
> > > > > <br>
> > > > > Just as an aside, since 2008b you might find it easier to use RANDI to <br>
> > > > > generate random integers.<br>
> > > > <br>
> > > > Just one thing to point out, you said that M is the dimention of the data. I thought that you ment different groups or different experiments where the data was collected, after all thats why your data is not of dimenation N*M x 1, for instance. If the columns of the matrix represent different groups, for some or another reason, you cannot pool the series. As far as know 'bootstrp' does not distinguishes among different groups. If this last statement is incorrect, can someone send me the link to read about it. <br>
> > > > Thanks

Wed, 18 Aug 2010 16:56:17 +0000
Re: Bootstrapping multivariate data
http://www.mathworks.com/matlabcentral/newsreader/view_thread/289482#772509
Richard Willey
Here's some very basic code that might illustrate what's' going on<br>
<br>
%% Generate your original data set<br>
<br>
mu = [1 1 2]; Sigma = [2 1 1; 1 2 1; 1 1 2];<br>
<br>
X = mvnrnd(mu, Sigma, 500);<br>
<br>
<br>
<br>
%% Sampling with replacement to create a new data set<br>
<br>
<br>
<br>
% Generate an index<br>
<br>
boot_index = randsample(1:length(X),length(X), 'true')'<br>
<br>
<br>
<br>
% Use the index to create a new dataset<br>
<br>
Boot_dataset = X(bootindex,:)<br>
<br>
<br>
<br>
A bootstrap is simply repeating this same operation nboot times and then <br>
calculating something interesting using this set of new data sets.<br>
<br>
<br>
<br>
Jumping back to the whole "multivariate" discussion.<br>
<br>
<br>
<br>
Each time you're drawing from X, you're extracting an entire row.<br>
<br>
All of the elements of this row are related in that they are a single output <br>
from your original multivariate normal distribution.<br>
<br>
<br>
<br>
All of this assumes that you need to perform a nonparametric bootstrap.<br>
<br>
<br>
<br>
If you have prior knowledge that your population is described by a <br>
multivariate normal distribution with<br>
<br>
<br>
<br>
mu = [1 1 2]<br>
<br>
<br>
<br>
and<br>
<br>
<br>
<br>
Sigma = [2 1 1; 1 2 1; 1 1 2];<br>
<br>
<br>
<br>
then its often entirely appropriate to use parametric bootstrap and <br>
generate your new dataset using mvnrnd.

Thu, 19 Aug 2010 16:13:58 +0000
Re: Bootstrapping multivariate data
http://www.mathworks.com/matlabcentral/newsreader/view_thread/289482#772851
CT
Just a correction, the covariance matrix that I have used is only an example to illustrate the generation of multivariate data. A matrix like that might have no sense.<br>
Thank you for the discussions.