MathGroup Archive 2007

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

Search the Archive

Re: Can anyone help me Thanks

  • To: mathgroup at smc.vnet.net
  • Subject: [mg75818] Re: Can anyone help me Thanks
  • From: CKWong.P at gmail.com
  • Date: Fri, 11 May 2007 05:28:35 -0400 (EDT)
  • References: <f1s05f$9q5$1@smc.vnet.net>

On 5=A4=EB9=A4=E9, =A4U=A4=C84=AE=C918=A4=C0, =A8=CE=AC=C2chialing <chia200=
40... at yahoo.com.hk> wrote:
> My question is as follow,
>   'S1,s1,S2,s2 is constant, fn is a function with variable A1, A2
> << Statistics`MultinormalDistribution`;
> rr = {{1, 0.75}, {0.75, 1}};
> ndist2 = MultinormalDistribution[{0, 0}, rr];
> pf2[A1_, A2_] : = {PDF[ndist2,{(Log[A1/S1]-(s1^2/2))/s1,((Log[A2/S2]-(s=
2^2/2))/s2}]}[[1]];
> z = NIntegrate[1/(A1 A2)*(fn[A1, A2]pf2[A1, A2]), {A1, 0, Infinity}, {A=
2, 0, Infinity}, MinRecursion -> 5, MaxRecursion -> 10];
>
> I want to extend the 36 dimensional MultinormalDistribution, could you he=
lp me?
> i.e.
> << Statistics`MultinormalDistribution`;
> 36r = {{1, 0.75,........................}, {0.75, 1,..............}....=
.=2E...................};
> ndist36 = MultinormalDistribution[{0, 0,...................}, 36r];
> pf36[A1_, A2_,A3_...............] : = {PDF[ndist36,{(Log[A1/S1]-(s1^2/2=
))/s1,((Log[A2/S2]-(s2^2/2))/s2},..........]}[[1]];
> z = NIntegrate[1/(A1 A2 .........)*(fn[A1, A2,...........]pf36[A1, A2,.=
.=2E......]), {A1, 0, Infinity}, {A2, 0, Infinity},................ MinRecu=
rsion -> 5, MaxRecursion -> 10];
>
>   Thank you again.
>   Sincerely,
>
>   Alice

My reply yesterday seemed to be lost.  So here it goes again.

Your variables A1, A2,.. etc are renamed A[1],A[2],....
And likewise for S1,s1,...

Also 36r = sigma,  and you can add the MinRecursion things yourself.

n = 36;
ndist = MultinormalDistribution[Table[0, {n}], sigma];

pf[A_List] :=
  PDF[ndist, Table[ (Log[A[[i]]/S[[i]]] - s[[i]]^2/2)/s[[i]], {i,
Length[A]}]]

AL = Array[A, n];
z = Fold[NIntegrate[#1/#2 , {#2, 0, Infinity}] &, fn[AL] pf[AL], AL]




  • Prev by Date: Re: Making sense of Directive[ ]
  • Next by Date: Re: infinite loop depending on previous function call
  • Previous by thread: Re: Can anyone help me Thanks
  • Next by thread: Reading coordinates from a 2D Plot