Re: Normally Distributed Random Matrix

• To: mathgroup at smc.vnet.net
• Subject: [mg77551] Re: Normally Distributed Random Matrix
• From: dimitris <dimmechan at yahoo.com>
• Date: Wed, 13 Jun 2007 07:18:00 -0400 (EDT)
• References: <f4lb7t\$g0e\$1@smc.vnet.net>

```Did you load the package surely?

Quit[];

<< Statistics`NormalDistribution`

<<Statistics`NormalDistribution`

n=50;
Timing[Short[A=RandomArray[NormalDistribution[],{n,n}]]]

{0. Second,{{1.11234,-0.704729,-0.0489978,\[LeftSkeleton]45\
[RightSkeleton],-\
0.241191,-1.76808},\[LeftSkeleton]48\[RightSkeleton],{\
[LeftSkeleton]1\
\[RightSkeleton]}}}

n=100;
Timing[Short[A=RandomArray[NormalDistribution[],{n,n}]]]

{0.016 Second,{{-0.233466,0.635134,0.666035,\[LeftSkeleton]95\
[RightSkeleton],\
-1.23073,-0.520466},\[LeftSkeleton]98\[RightSkeleton],{\
[LeftSkeleton]1\
\[RightSkeleton]}}}

n0;
Timing[Short[A=RandomArray[NormalDistribution[],{n,n}]]]

{0.015 Second,{{-0.252855,-0.0413172,-0.499978,\[LeftSkeleton]195\
\[RightSkeleton],0.75179,-1.44249},\[LeftSkeleton]198\[RightSkeleton],
{\
\[LeftSkeleton]1\[RightSkeleton]}}}

n=300;
Timing[Short[A=RandomArray[NormalDistribution[],{n,n}]]]

{0.047 Second,{{1.96402,0.284784,-0.0500743,\[LeftSkeleton]295\
[RightSkeleton]\
,0.663255,-0.335565},\[LeftSkeleton]298\[RightSkeleton],{\
[LeftSkeleton]1\
\[RightSkeleton]}}}

n=400;
Timing[Short[A=RandomArray[NormalDistribution[],{n,n}]]]

{0.093 Second,{{0.831221,-0.288922,-1.17907,\[LeftSkeleton]395\
[RightSkeleton]\
,0.168632,-0.463928},\[LeftSkeleton]398\[RightSkeleton],{\
[LeftSkeleton]1\
\[RightSkeleton]}}}

n=500;
Timing[Short[A=RandomArray[NormalDistribution[],{n,n}]]]

{0.125 Second,{{-1.70821,0.0497788,-0.370148,\[LeftSkeleton]495\
\[RightSkeleton],0.36669,-0.0338988},\[LeftSkeleton]498\
[RightSkeleton],{\
\[LeftSkeleton]1\[RightSkeleton]}}}

n=600;
Timing[Short[A=RandomArray[NormalDistribution[],{n,n}]]]

{0.188 Second,{{-0.284403,0.111908,0.527232,\[LeftSkeleton]595\
[RightSkeleton]\
,0.230411,-0.510837},\[LeftSkeleton]598\[RightSkeleton],{\
[LeftSkeleton]1\
\[RightSkeleton]}}}

n=700;
Timing[Short[A=RandomArray[NormalDistribution[],{n,n}]]]

{0.219 Second,{{-0.0816805,1.1005,-0.412437,\[LeftSkeleton]695\
[RightSkeleton]\
,0.196279,-2.04845},\[LeftSkeleton]698\[RightSkeleton],{\
[LeftSkeleton]1\
\[RightSkeleton]}}}

n=800;
Timing[Short[A=RandomArray[NormalDistribution[],{n,n}]]]

{0.344 Second,{{-2.17867,0.842315,-0.135916,\[LeftSkeleton]795\
[RightSkeleton]\
,1.88163,-1.35301},\[LeftSkeleton]798\[RightSkeleton],{\
[LeftSkeleton]1\
\[RightSkeleton]}}}

n=900;
Timing[Short[A=RandomArray[NormalDistribution[],{n,n}]]]

{0.406 Second,{{1.58544,0.072123,-2.66405,\[LeftSkeleton]895\
[RightSkeleton],\
1.49211,-0.0905375},\[LeftSkeleton]898\[RightSkeleton],{\
[LeftSkeleton]1\
\[RightSkeleton]}}}

n=1000;
Timing[Short[A=RandomArray[NormalDistribution[],{n,n}]]]

Dimitris

{0.453 Second,{{-0.287427,-0.139428,0.221081,\[LeftSkeleton]995\
\[RightSkeleton],0.447551,-0.758528},\[LeftSkeleton]998\
[RightSkeleton],{\
\[LeftSkeleton]1\[RightSkeleton]}}}
/  amitsoni.1984 at gmail.com       :
> Hi,
>
> I want to create a normally distributed random matrix in Mathematica.
> I'm using the following code in Mathematica 5.2:
>
> ------------- code -----------------------------
> << Statistics`NormalDistribution`
> n = 500;
> A = RandomArray[NormalDistribution[], {n, n}]
> ------------------------------------------------
>
> But it is not working even though it worked when I did it earlier on
> Linux. When I enter A it just gives:
>
> ------------------------------------------------
> A
> RandomArray[NormalDistribution[], {500, 500}]
> ------------------------------------------------
>
> Can anyone help me with this?
>
> Thank you,
> Amit

```

• Prev by Date: Re: v6: still no multiple undo?
• Next by Date: Re: licensing issues with V6.0 Financial Data
• Previous by thread: Re: Normally Distributed Random Matrix
• Next by thread: Re: Normally Distributed Random Matrix