# How Do I can Generate a CDF Plot from Below PDF code and also it Histogram Plot?

I have tried many times to plot a CDF from the following PDF code , But I failed to get that however I have used the command CumulantGeneratingfunction[, ] but it coudn't work , any Help ?and also the same with Histogram plot ?

 f[z_?NumericQ, \[Mu]_?NumericQ] :=
NIntegrate[Sqrt[6]/Sqrt[2*Pi]Exp[-(z - \[Mu])^2/(Pi)
]* Erf[(z - \[Mu])/(\[Sigma] Sqrt[2*Pi])]* Erfi[(z - \[Mu])/(\[Sigma] Sqrt[2*Pi])], {\[Sigma], 1, \[Infinity]}]
pdfF[\[Mu]_?NumericQ] := PDF[ProbabilityDistribution[f[x, \[Mu]], {x, - \[Infinity], \[Infinity]}]]
With[{n = 5},
Show[
Plot[
Labeled[pdfF[#1][z], Row[{"\[Mu] = ", Rationalize[#1]}], Above], {z, -5, 5},
PlotRange -> All,
PlotStyle -> #2] &
@@@
Rest[{#, Hue[#]} & /@ Subdivide[0., 1., n]],
ImageSize -> Large]]
With[{n = 5}, NIntegrate[pdfF[#][z], {z, -5, 5}] & /@ (Range[n]/n)]

• First, the integral of f is not 1, so it is not a properly defined PDF function (e.g. NIntegrate[f[z, 3], {z, -∞, ∞}] returns 1.01826); you need to introduce a normalization factor. Furthermore, your use of PDF[ProbabilityDistribution[f[x, μ], {x, -∞, ∞}]] is redundant: ProbabilityDistribution will generate a distribution assuming that its first argument is a well-defined PDF, normalized to 1. When you apply PDF to that, you just get f[x, μ] back (evaluate pdfF[2]), so using PDF[ProbabilityDistribution[f[...], ...]] is completely equivalent to using your own f. – MarcoB Dec 6 '19 at 15:58
• I have a normalization to 0.98 is that accepted PDF ? – zeraoulia rafik Dec 6 '19 at 16:02
• Close, but not quite. A probability density function's integral over the entire space should be guaranteed to be exactly equal to 1. – MarcoB Dec 6 '19 at 16:04
• I have adjusted it now I have got 0.99 – zeraoulia rafik Dec 6 '19 at 16:24
• @MarcoB , Pleas could u give me an answer below how i can plot CDF , I have normalized it to 1 , But am stiil unable to plot generating CDF from That PDF – zeraoulia rafik Dec 7 '19 at 20:46