Thread Subject: random matrix generation

Subject: random matrix generation

From: arun

Date: 7 Nov, 2009 22:18:40

Message: 1 of 12

hi,

how can i generate a m*n matrix with the m-rows
1) dependent on each other
2) independent of each other

also, is it possible to create the same random matrix with just 1's
and 0's under the same 2 criterias?

thank you,
best, arun.

Subject: random matrix generation

From: ImageAnalyst

Date: 7 Nov, 2009 23:49:38

Message: 2 of 12

On Nov 7, 5:18 pm, arun <aragorn1...@gmail.com> wrote:
> hi,
>
> how can i generate a m*n matrix with the m-rows
> 1) dependent on each other
> 2) independent of each other
>
> also, is it possible to create the same random matrix with just 1's
> and 0's under the same 2 criterias?
>
> thank you,
> best, arun.

--------------------------------------------------------------------
1) depends on what you mean by dependent.
2) randomArray = rand(100, 50);

binaryRandomArray = randomArray > 0.5;

Subject: random matrix generation

From: arun

Date: 8 Nov, 2009 14:42:34

Message: 3 of 12

On Nov 8, 12:49 am, ImageAnalyst <imageanal...@mailinator.com> wrote:
> On Nov 7, 5:18 pm, arun <aragorn1...@gmail.com> wrote:
>
> > hi,
>
> > how can i generate a m*nmatrixwith the m-rows
> > 1) dependent on each other
> > 2) independent of each other
>
> > also, is it possible to create the samerandommatrixwith just 1's
> > and 0's under the same 2 criterias?
>
> > thank you,
> > best, arun.
>
> --------------------------------------------------------------------
> 1) depends on what you mean by dependent.
> 2)  randomArray = rand(100, 50);
>
> binaryRandomArray = randomArray > 0.5;

what i mean by independent is that, if I take any 2 rows and compute a
measure of dependence (say, corr), and then permute one of the rows
and compute *corr* a 1000 times and obtain its distribution, then they
should be that of a uniform distribution's pdf (equally likely). Or,
equivalently, the cdf of p-values obtained directly from corr should
be that of a uniform distribution's pdf.

if its not, they are dependent in some way.
best, arun.

Subject: random matrix generation

From: arun

Date: 8 Nov, 2009 14:43:49

Message: 4 of 12

On Nov 8, 3:42 pm, arun <aragorn1...@gmail.com> wrote:
> On Nov 8, 12:49 am, ImageAnalyst <imageanal...@mailinator.com> wrote:
>
>
>
> > On Nov 7, 5:18 pm, arun <aragorn1...@gmail.com> wrote:
>
> > > hi,
>
> > > how can i generate a m*nmatrixwith the m-rows
> > > 1) dependent on each other
> > > 2) independent of each other
>
> > > also, is it possible to create the samerandommatrixwith just 1's
> > > and 0's under the same 2 criterias?
>
> > > thank you,
> > > best, arun.
>
> > --------------------------------------------------------------------
> > 1) depends on what you mean by dependent.
> > 2)  randomArray = rand(100, 50);
>
> > binaryRandomArray = randomArray > 0.5;
>
> what i mean by independent is that, if I take any 2 rows and compute a
> measure of dependence (say, corr), and then permute one of the rows
> and compute *corr* a 1000 times and obtain its distribution, then they
> should be that of a uniform distribution's pdf (equally likely). Or,
> equivalently, the cdf of p-values obtained directly from corr should
> be that of a uniform distribution's pdf.
>
> if its not, they are dependent in some way.
> best, arun.

**** Or, equivalently, the cdf of p-values obtained directly from corr
should
be that of a uniform distribution's pdf.

This line should be:
Or,
equivalently, the cdf of p-values obtained directly from corr should
be that of a uniform distribution's *CDF*.

Subject: random matrix generation

From: arun

Date: 8 Nov, 2009 14:43:56

Message: 5 of 12

On Nov 8, 3:42 pm, arun <aragorn1...@gmail.com> wrote:
> On Nov 8, 12:49 am, ImageAnalyst <imageanal...@mailinator.com> wrote:
>
>
>
> > On Nov 7, 5:18 pm, arun <aragorn1...@gmail.com> wrote:
>
> > > hi,
>
> > > how can i generate a m*nmatrixwith the m-rows
> > > 1) dependent on each other
> > > 2) independent of each other
>
> > > also, is it possible to create the samerandommatrixwith just 1's
> > > and 0's under the same 2 criterias?
>
> > > thank you,
> > > best, arun.
>
> > --------------------------------------------------------------------
> > 1) depends on what you mean by dependent.
> > 2)  randomArray = rand(100, 50);
>
> > binaryRandomArray = randomArray > 0.5;
>
> what i mean by independent is that, if I take any 2 rows and compute a
> measure of dependence (say, corr), and then permute one of the rows
> and compute *corr* a 1000 times and obtain its distribution, then they
> should be that of a uniform distribution's pdf (equally likely). Or,
> equivalently, the cdf of p-values obtained directly from corr should
> be that of a uniform distribution's pdf.
>
> if its not, they are dependent in some way.
> best, arun.

**** Or, equivalently, the cdf of p-values obtained directly from corr
should
be that of a uniform distribution's pdf.

This line should be:
Or,
equivalently, the cdf of p-values obtained directly from corr should
be that of a uniform distribution's *CDF*.

Subject: random matrix generation

From: arun

Date: 8 Nov, 2009 14:45:47

Message: 6 of 12

On Nov 8, 3:43 pm, arun <aragorn1...@gmail.com> wrote:
> On Nov 8, 3:42 pm, arun <aragorn1...@gmail.com> wrote:
>
>
>
> > On Nov 8, 12:49 am, ImageAnalyst <imageanal...@mailinator.com> wrote:
>
> > > On Nov 7, 5:18 pm, arun <aragorn1...@gmail.com> wrote:
>
> > > > hi,
>
> > > > how can i generate a m*nmatrixwith the m-rows
> > > > 1) dependent on each other
> > > > 2) independent of each other
>
> > > > also, is it possible to create the samerandommatrixwith just 1's
> > > > and 0's under the same 2 criterias?
>
> > > > thank you,
> > > > best, arun.
>
> > > --------------------------------------------------------------------
> > > 1) depends on what you mean by dependent.
> > > 2)  randomArray = rand(100, 50);
>
> > > binaryRandomArray = randomArray > 0.5;
>
> > what i mean by independent is that, if I take any 2 rows and compute a
> > measure of dependence (say, corr), and then permute one of the rows
> > and compute *corr* a 1000 times and obtain its distribution, then they
> > should be that of a uniform distribution's pdf (equally likely). Or,
> > equivalently, the cdf of p-values obtained directly from corr should
> > be that of a uniform distribution's pdf.
>
> > if its not, they are dependent in some way.
> > best, arun.
>
> **** Or, equivalently, the cdf of p-values obtained directly from corr
> should
> be that of a uniform distribution's pdf.
>
> This line should be:
> Or,
> equivalently, the cdf of p-values obtained directly from corr should
> be that of a uniform distribution's *CDF*.

The problem when I generate using X = rand(50,100); is that, the
columns also become independent. But I don't (necessarily) want this.

thank you.

Subject: random matrix generation

From: dpb

Date: 8 Nov, 2009 15:36:24

Message: 7 of 12

arun wrote:
> hi,
>
> how can i generate a m*n matrix with the m-rows
> 1) dependent on each other
> 2) independent of each other
>
> also, is it possible to create the same random matrix with just 1's
> and 0's under the same 2 criterias?

Well, you have to define what dependent means, specifically, in order to
have a generating function even theoretically. Realizing it may be
something else, but you have to start w/ something.

Also, as written, 1) and 2) are contradictory if somehow this is to be a
single matrix satisfying both.

You need a far more precise problem definition to get anywhere methinks.

--

Subject: random matrix generation

From: arun

Date: 8 Nov, 2009 15:52:48

Message: 8 of 12

On Nov 8, 4:36 pm, dpb <n...@non.net> wrote:
> arun wrote:
> > hi,
>
> > how can i generate a m*n matrix with the m-rows
> > 1) dependent on each other
> > 2) independent of each other
>
> > also, is it possible to create the same random matrix with just 1's
> > and 0's under the same 2 criterias?
>
> Well, you have to define what dependent means, specifically, in order to
> have a generating function even theoretically.  Realizing it may be
> something else, but you have to start w/ something.
>
> Also, as written, 1) and 2) are contradictory if somehow this is to be a
> single matrix satisfying both.
>
> You need a far more precise problem definition to get anywhere methinks.
>
> --

Hi dpb,
I have to create 2 separate matrices (not every other row being
dependent and independent of each other), one satisfying the first
criteria and the other the second.
Regarding the problem definition, did you read my reply to
imageAnalyst? I have given the requirement there.

Subject: random matrix generation

From: arun

Date: 8 Nov, 2009 15:53:08

Message: 9 of 12

On Nov 8, 4:36 pm, dpb <n...@non.net> wrote:
> arun wrote:
> > hi,
>
> > how can i generate a m*n matrix with the m-rows
> > 1) dependent on each other
> > 2) independent of each other
>
> > also, is it possible to create the same random matrix with just 1's
> > and 0's under the same 2 criterias?
>
> Well, you have to define what dependent means, specifically, in order to
> have a generating function even theoretically.  Realizing it may be
> something else, but you have to start w/ something.
>
> Also, as written, 1) and 2) are contradictory if somehow this is to be a
> single matrix satisfying both.
>
> You need a far more precise problem definition to get anywhere methinks.
>
> --

Hi dpb,
I have to create 2 separate matrices (not every other row being
dependent and independent of each other), one satisfying the first
criteria and the other the second.
Regarding the problem definition, did you read my reply to
imageAnalyst? I have given the requirement there.

Subject: random matrix generation

From: dpb

Date: 8 Nov, 2009 16:13:33

Message: 10 of 12

arun wrote:
...

> Regarding the problem definition, did you read my reply to
> imageAnalyst? I have given the requirement there.

How is one to derive a generating function from that "requirement", pray
tell?

I can make a second row of a random matrix be dependent upon the first by

x=rand(1,10);
x=[x;x];

Is that ok?

It meets the definition stated.

--

Subject: random matrix generation

From: Bruno Luong

Date: 9 Nov, 2009 07:31:03

Message: 11 of 12

arun <aragorn168b@gmail.com> wrote in message <8a05888a-f76b-4565-992d-802d92ce953e@v30g2000yqm.googlegroups.com>...
> On Nov 8, 12:49?am, ImageAnalyst <imageanal...@mailinator.com> wrote:
> > On Nov 7, 5:18?pm, arun <aragorn1...@gmail.com> wrote:
> >
> > > hi,
> >
> > > how can i generate a m*nmatrixwith the m-rows
> > > 1) dependent on each other
> > > 2) independent of each other
> >
> > > also, is it possible to create the samerandommatrixwith just 1's
> > > and 0's under the same 2 criterias?
> >
> > > thank you,
> > > best, arun.
> >
> > --------------------------------------------------------------------
> > 1) depends on what you mean by dependent.
> > 2) ?randomArray = rand(100, 50);
> >
> > binaryRandomArray = randomArray > 0.5;
>
> what i mean by independent is that, if I take any 2 rows and compute a
> measure of dependence (say, corr), and then permute one of the rows
> and compute *corr* a 1000 times and obtain its distribution, then they
> should be that of a uniform distribution's pdf (equally likely). Or,
> equivalently, the cdf of p-values obtained directly from corr should
> be that of a uniform distribution's pdf.
>
> if its not, they are dependent in some way.
> best, arun.

1. Dependent
epsilon = 0.1
A = ones(100,50)+epsilon*randn(100,50)

2. Independent
A = randn(100,50)

Bruno

Subject: random matrix generation

From: ImageAnalyst

Date: 9 Nov, 2009 11:27:03

Message: 12 of 12

I think dpb and Bruno give excellent examples. For one more, you
could get vertical correlation betrween rows by doing a convolution in
the vertical direction with a rectangular window (i.e. just average
some number of rows in a given column). I believe that according to
the central limit theorem, this will tend toward giving a probability
density function that is a Gaussian. Again, this will satisfy your
vague, overly broad definition.

You can generate random numbers according to any given pdf if you know
the pdf that you want. You sort of generate the cdf and invert the
equation - standard stuff out of many textbooks. But the key word is
"given." If you don't give anything then you need to take what we
give you.

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
word list jamal basri 21 Nov, 2009 16:41:16
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com