http://www.mathworks.com/matlabcentral/newsreader/view_thread/308510
MATLAB Central Newsreader  How to generate correlated data based on the given real data
Feed for thread: How to generate correlated data based on the given real 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

Mon, 30 May 2011 22:38:02 +0000
How to generate correlated data based on the given real data
http://www.mathworks.com/matlabcentral/newsreader/view_thread/308510#838578
fatih
Hi,<br>
I have a data distribution which the size is 1 * 15000 . However, this data does not follow any kind of distribution such as gaussian. Besides this I have a correlation matrix. I want to generate correlated data based on that matrix although I have only single data distribution. If anyone can help me, It will be great.<br>
Regards,

Mon, 30 May 2011 23:31:12 +0000
Re: How to generate correlated data based on the given real data
http://www.mathworks.com/matlabcentral/newsreader/view_thread/308510#838589
TideMan
On May 31, 10:38 am, "fatih " <fatihaba...@yahoo.com> wrote:<br>
> Hi,<br>
> I have a data distribution which the size is 1 * 15000 . However, this data does not follow any kind of distribution such as gaussian. Besides this I have a correlation matrix. I want to generate correlated data based on that matrix although I have only single data distribution. If anyone can help me, It will be great.<br>
> Regards,<br>
<br>
Well, to generate random numbers fitting the distribution of your<br>
data, you need to use an empirical CDF and bootstrapping. Search this<br>
forum for empirical CDF and you'll find lots of references.<br>
<br>
As for correlation, you can use your generated random numbers in a<br>
Markov chain, but I don't understand how you've gotten a correlation<br>
matrix from only one variable. Maybe you can explain this?

Mon, 30 May 2011 23:49:05 +0000
Re: How to generate correlated data based on the given real data
http://www.mathworks.com/matlabcentral/newsreader/view_thread/308510#838590
Roger Stafford
"fatih " <fatihabanoz@yahoo.com> wrote in message <is168a$fk1$1@newscl01ah.mathworks.com>...<br>
> Hi,<br>
> I have a data distribution which the size is 1 * 15000 . However, this data does not follow any kind of distribution such as gaussian. Besides this I have a correlation matrix. I want to generate correlated data based on that matrix although I have only single data distribution. If anyone can help me, It will be great.<br>
> Regards, <br>
        <br>
The notion of a single dimensional distribution possessing some kind of correlation doesn't make sense to me unless you have in mind autocorrelation  that is, a correlation between successive values of a single random variable. Even in that case the natural representation of such autocorrelation would be a vector, not a matrix.<br>
<br>
The idea behind ordinary correlation is that two or more coincident random variables are not entirely independent of one another. Correlation is a particular measure of this degree of dependence. It loses its significance if there is only one random variable under consideration.<br>
<br>
Perhaps you can explain in greater detail what it is you are asking?<br>
<br>
Roger Stafford

Tue, 31 May 2011 00:36:32 +0000
Re: How to generate correlated data based on the given real data
http://www.mathworks.com/matlabcentral/newsreader/view_thread/308510#838594
ImageAnalyst
I have one link handy  I think Roger originally gave it here and I<br>
bookmarked it:<br>
<br>
<a href="http://en.wikipedia.org/wiki/Inverse_transform_sampling">http://en.wikipedia.org/wiki/Inverse_transform_sampling</a>

Tue, 31 May 2011 08:20:19 +0000
Re: How to generate correlated data based on the given real data
http://www.mathworks.com/matlabcentral/newsreader/view_thread/308510#838643
fatih
"Roger Stafford" wrote in message <is1adh$p47$1@newscl01ah.mathworks.com>...<br>
> "fatih " <fatihabanoz@yahoo.com> wrote in message <is168a$fk1$1@newscl01ah.mathworks.com>...<br>
> > Hi,<br>
> > I have a data distribution which the size is 1 * 15000 . However, this data does not follow any kind of distribution such as gaussian. Besides this I have a correlation matrix. I want to generate correlated data based on that matrix although I have only single data distribution. If anyone can help me, It will be great.<br>
> > Regards, <br>
>         <br>
> The notion of a single dimensional distribution possessing some kind of correlation doesn't make sense to me unless you have in mind autocorrelation  that is, a correlation between successive values of a single random variable. Even in that case the natural representation of such autocorrelation would be a vector, not a matrix.<br>
> <br>
> The idea behind ordinary correlation is that two or more coincident random variables are not entirely independent of one another. Correlation is a particular measure of this degree of dependence. It loses its significance if there is only one random variable under consideration.<br>
> <br>
> Perhaps you can explain in greater detail what it is you are asking?<br>
> <br>
> Roger Stafford<br>
<br>
Hi,<br>
First of all, thank you very much for your help. My problem is that I need to do the load modeling in a power system. In that power system, there are around 40 loads. Furthermore, the loads should be modeled based on a correlation matrix. The correlation matrix is already given due to the standards. However, I have only one single load data which the size is 1*15000. Depending on only that load data and given correlation matrix, I want to generate other load data(s) in the system. I hope this is more clear. Thank you in advance.<br>
Regards,

Tue, 31 May 2011 16:58:16 +0000
Re: How to generate correlated data based on the given real data
http://www.mathworks.com/matlabcentral/newsreader/view_thread/308510#838732
Tom Lane
> First of all, thank you very much for your help. My problem is that I need <br>
> to do the load modeling in a power system. In that power system, there are <br>
> around 40 loads. Furthermore, the loads should be modeled based on a <br>
> correlation matrix. The correlation matrix is already given due to the <br>
> standards. However, I have only one single load data which the size is <br>
> 1*15000. Depending on only that load data and given correlation matrix, I <br>
> want to generate other load data(s) in the system. I hope this is more <br>
> clear. Thank you in advance.<br>
<br>
You may want to look at the copularnd function. The general idea behind a <br>
copula is to separate the marginal distribution of each variable from the <br>
dependence (correlation) structure.<br>
<br>
When you generate a matrix U from copularnd, each column is a sample from a <br>
uniform distribution, but the columns are correlated. Then you can transform <br>
each column to the distribution that you prefer. (Other posters have given <br>
ideas about how to do that.)<br>
<br>
I assume you want each separate column to have roughly the same distribution <br>
as your original 15000 values. If that's not the case, I'd need more <br>
information about how you want to define the column distributions.<br>
<br>
This may get you going in the right direction. You should be aware, though, <br>
that the correlation matrix you provide will not be the same as the <br>
correlation of U, nor the same as the correlation after transforming each <br>
column. You'll have to decide if that's a problem for you.<br>
<br>
 Tom