I have a very simple trial that tries to get the value with a specific probability of not being exceeded, F, based on a Gaussian PDF
pdf = PDF[NormalDistribution[0, 1], r]
cdf[x_] := NIntegrate[pdf, {r, -Infinity, x}]
Solve[0.95 == cdf[x], x]
I get:
During evaluation of In[549]:= NIntegrate::inumr: The integrand pdf has evaluated to non-numerical values for all sampling points in the region with boundaries {{-\[Infinity],0. +x}}.
During evaluation of In[549]:= NIntegrate::inumr: The integrand pdf has evaluated to non-numerical values for all sampling points in the region with boundaries {{-\[Infinity],0. +x}}.
During evaluation of In[549]:= NIntegrate::inumr: The integrand pdf has evaluated to non-numerical values for all sampling points in the region with boundaries {{-\[Infinity],0. +x}}.
During evaluation of In[549]:= General::stop: Further output of NIntegrate::inumr will be suppressed during this calculation.
During evaluation of In[549]:= Solve::inex: Solve was unable to solve the system with inexact coefficients or the system obtained by direct rationalization of inexact numbers present in the system. Since many of the methods used by Solve require exact input, providing Solve with an exact version of the system may help.
Out[549]= Solve[0.95 == NIntegrate[pdf, {r, -Infinity, x}], x]
whereas if I use:
Solve[0.95 == CDF[NormalDistribution[0, 1], x], x]
During evaluation of In[550]:= Solve::ifun: Inverse functions are being used by Solve, so some solutions may not be found; use Reduce for complete solution information.
Out[550]= {{x -> 1.64485}}
How to get a value out of Solve[0.95 == cdf[x], x]
?
ClearAll[ cdf ] ; cdf[ x_?NumericQ ] := NIntegrate[ pdf, {r, -Infinity, x} ]
and then solve. $\endgroup${{x ->cdf-1[0.95]}}
$\endgroup$Clear["Global
*"]` and now it works... $\endgroup$