# How to draw a certain PDF

Here Dist is the PDF. I need to draw it. Can someone suggest me a way to do it?

A = 0.5;
α = 4;
μ = 1.0000;
k = 0;
τ = 1;
δ = 1/2;
m = 1;

s[rd_] := (μ rd^α)/Pm;

LocalMeanPowerInLinear = 1;
LocalMeanPowerIndB = Log10[LocalMeanPowerInLinear]*10;
β = LocalMeanPowerIndB*Log[10]/10;

StdSindB = 8;
σ = StdSindB*Log[10]/10;

G[t_] :=
Exp[-1/2*Exp[-Sqrt[2]*σ*t – β]*m*x^2]*(Exp[Sqrt[2]*σ*t + β])^(-m);

T =
{3.4362, 2.5327, 1.7567, 1.0366, 0.3429,
-0.3429, -1.0366, -1.7567, -2.5327, -3.4362};
W =
{0.0000, 0.0013, 0.0339, 0.2401, 0.6109,
0.6109, 0.2401, 0.0339, 0.0013, 0.0000};

f[x_] =
(1 – A)*FullSimplify[(1 + k)*Exp[-k]*x/τ*Exp[-(1 + k)*x^2/(2*τ)]*
BesselJ[0, Sqrt[2*k*(1+k)/τ]*x]] +
A*x^(2*m – 1)/(2^(m – 1)*Sqrt[π]*Gamma[m])*W.(G /@ T);

Dist = TransformedDistribution[x^2/2,
x \[Distributed] ProbabilityDistribution[f[x], {x, 0, Infinity}]]

=================

=================

1

=================

EDIT : Made A variable per OP’s comment.

Clear[A, f, Dist]

α = 4;
μ = 1;
k = 0;
τ = 1;
δ = 1/2;
m = 1;
s[rd_] := (μ rd^α)/Pm;
LocalMeanPowerInLinear = 1;
LocalMeanPowerIndB = Log10[LocalMeanPowerInLinear]*10;
β = LocalMeanPowerIndB*Log[10]/10;
StdSindB = 8;
σ = StdSindB*Log[10]/10;
G[t_] := Exp[-1/2*Exp[-Sqrt[2]*σ*t – β]*m*
x^2]*(Exp[Sqrt[2]*σ*t + β])^(-m);
T = {3.4362, 2.5327, 1.7567, 1.0366,
0.3429, -0.3429, -1.0366, -1.7567, -2.5327, -3.4362};
W = {0.0000, 0.0013, 0.0339, 0.2401, 0.6109, 0.6109, 0.2401, 0.0339, 0.0013,
0.0000};

f[x_, A_: 1/2] := (1 – A)*
FullSimplify[(1 + k)*Exp[-k]*x/\[Tau]*
Exp[-(1 + k)*x^2/(2*\[Tau])]*
BesselJ[0, Sqrt[2*k*(1 + k)/\[Tau]]*x]] +
A*x^(2*m – 1)/(2^(m – 1)*Sqrt[\[Pi]]*Gamma[m])*W.(G /@ T);

Dist[A_: 1/2] :=
TransformedDistribution[x^2/2,
x \[Distributed]
ProbabilityDistribution[f[x, A], {x, 0, Infinity}]];

Dist is a distribution not a PDF. To Plot the PDF of the distribution for various values of A use

Plot[Evaluate@
Table[
Tooltip[PDF[Dist[A], x], A],
{A, {1/4, 1/2, 1}}],
{x, 0, 5},
PlotRange -> {0, 1},
PlotLegends -> (StringForm[“A = “”, #] & /@ {1/4, 1/2, 1})]

Or

LogPlot[Evaluate@
Table[
Tooltip[PDF[Dist[A], x], A],
{A, {1/4, 1/2, 1}}],
{x, 0, 100},
PlotRange -> {10^-5, 1},
PlotLegends -> (StringForm[“A = “”, #] & /@ {1/4, 1/2, 1})]

Thank you very much. It works very fine. How about if I want to draw the PDF f[x_] (the second last line of my code)? I tried : ‘Plot[Evaluate@ProbabilityDistribution[f[x], {x, 0, Infinity}], PlotRange -> {0, 1}]’ , but it does not work!
– Srestha Narayanan
Jun 8 at 11:09

and if I want to draw the PDFs for a range of values of AA (first parameter in my code) and put them together, how I should do it?
– Srestha Narayanan
Jun 8 at 11:13

@SresthaNarayanan – you have the wrong syntax for plotting the PDF of f. Plot[Evaluate@PDF[ProbabilityDistribution[f[x], {x, 0, Infinity}], x], {x, 0, 6}]
– Bob Hanlon
Jun 8 at 14:27

Thanks for your reply. What does it mean: f[x_, A_: 1/2]. I know that f[x_, A_] is a function of two arguments, namely, x and A. Is it somewhat default value of A? Also, please suggest me to plot f[x] for different values of A. I tried but could not make it.
– Srestha Narayanan
Jun 9 at 3:22

@SresthaNarayanan – read the documentation for Optional. For question about plotting f open a new question and post the code that you tried.
– Bob Hanlon
Jun 9 at 3:34