I have the following MMA code. Note that the function I declared at the very beginning is the PDF of square of a Nakagami Distributed random variable. With $m=1$ and $P=1$, $f(h)$ becomes Exponential Distribution with rate parameter 1, i.e., ExponentialDistribution[1]
2 Answers
$\begingroup$
$\endgroup$
A PDF is not a distribution. To convert a PDF to its associated distribution use ProbabilityDistribution
Clear[λ, pb, Ps, μ]
f[h_] := 1/Gamma[m]*(m/P)^m*h^(m - 1)*Exp[-(m*h)/P];
m = 1; P = 1;
α = 4; δ = 2/α;
int = Assuming[{A > 0, r > 0, λ > 0},
Integrate[(1 - Exp[-x*h*r^(-1/δ)])*pb*λ*π, {r, A,
Infinity}, GenerateConditions -> False]]
(* -pb π r λ - (pb π^(3/2) λ Erfc[r Sqrt[h μ]])/(
2 Sqrt[h μ]) *)
LI = Assuming[{A > 0, r > 0, λ > 0, x > 0},
Exp[-Expectation[int,
h \[Distributed] ProbabilityDistribution[f[h], {h, 0, Infinity}]]] //
FullSimplify]
(* E^(pb π λ (r + ArcCot[r Sqrt[μ]]/Sqrt[μ])) *)
Note that this is the same result obtained with h\[Distributed]ExponentialDistribution[1]
LI === Assuming[{A > 0, r > 0, λ > 0, x > 0},
Exp[-Expectation[int, h \[Distributed] ExponentialDistribution[1]]] //
FullSimplify]
(* True *)
x = s*Ps; A = r;
M = LI;
s = μ*r^α/Ps; B = M;
λ = 4; pb = 1/2; Ps = 19.9526; μ = 1.2589;
AverageProbSuccess[B_, λ_] :=
NIntegrate[B*2*π*λ*r*Exp[-π*λ*r^2], {r, 0, Infinity}]
AverageProbSuccess[B, λ]
(* 0.8346 *)
$\begingroup$
$\endgroup$
This is an extended comment. f[h]
as defined while clearly a probability density function is not of the type of function that Expectation
expects. Consider the difference between the two functions f
and g
below:
f[h_] := 1/Gamma[m]*(m/P)^m*h^(m - 1)*Exp[-(m*h)/P]
(* Head *)
Head[f]
(* Symbol *)
(* PDF *)
f[h]
(* (E^(-((h m)/P)) h^(-1 + m) (m/P)^m)/Gamma[m] *)
(* Mean *)
Integrate[h f[h], {h, 0, ∞}]
(* ConditionalExpression[P, (Re[m] != 0 || m ∉ Reals) && 1 + Re[m] > 0 && Re[m/P] > 0] *)
And now g
g := ProbabilityDistribution[1/Gamma[m]*(m/P)^m*h^(m - 1)*Exp[-(m*h)/P],
{h, 0, ∞},
Assumptions -> {m > 1, P > 0}]
(* Head *)
Head[g]
(* ProbabilityDistribution *)
(* PDF *)
PDF[g, h]
(* Piecewise[{{(h^(-1 + m)*(m/P)^m)/(E^((h*m)/P)*Gamma[m]), h > 0}}, 0] *)
(* Mean *)
Expectation[h, h \[Distributed] g]
(* P *)
Expectation
expects a probability distribution butf[h]
is not a probability distribution in the eyes ofExpectation
. Type 'Head[f]` and the result will beSymbol
rather thanTransformedDistribution
or some other type that is requred. $\endgroup$