Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #5764
| From | choco munch <choceam@gmail.com> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | A Problem seemingly with NIntegrate |
| Date | 2011-10-21 10:35 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <j7rhub$hgr$1@smc.vnet.net> (permalink) |
Hi,
Here is my problem. I have two PDFs (Probability Density Functions).
One is a sum of 2 IID Nakagami-m and the other is a zero mean
Guassian. I am constructing a new RV which is the product of these
two, so I have in effect:
Z = (X1 + X2)*N = X12*N
X1, X2 are distributed IID Nakagami and N is a zero mean Normal RV.
Now I know how to compute the PDF of Z by using PDF_Z[z_] :=
NIntegrate[1/x PDF_X12[x]* PDF_N[z/x], {x, 0, Infinity}]
Unforutantely, when i do this
NIntegrate[PDF_Z[z], {z, -Infinty, Infinty}] I do not get 1.
there is something going on with NIntegrate here, but I don't know
what. Here is the code:
==========================================================================
(*K[m] is just a constant *)
K[m_] := (4 Sqrt[Pi] Gamma[2 m] m^(2 m))/(Gamma[m]^2 Gamma[2 m + 1/2]
2^(4 m - 1) \[CapitalOmega]^(2 m));
(*f1 is the sum of two Nakagami's*)
f1[r_] := K[m] r^(4 m - 1) Hypergeometric1F1[2 m, 2 m + 1/2, (m r^2)/
(2 \[CapitalOmega])] Exp[-m r^2/\[CapitalOmega]]
(*f2 is the standard normal *)
f2[r_] := 1/(Sqrt[2 Pi] \[Sigma]) Exp[-r^2/(2 \[Sigma]^2)];
(*f3 is the product of X1+X2 and N*)
f3[z_] := NIntegrate[1/x f1[x] f2[z/x], {x, 0, Infinity}]
(*here is the problem*)
NIntegrate[f3[x], {x, -10, 10}]
(*this will not give 1, why? I have checked both f1 and f2, they are
valid PDFs*)
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
A Problem seemingly with NIntegrate choco munch <choceam@gmail.com> - 2011-10-21 10:35 +0000
csiph-web