2
$\begingroup$

Can I use Mathematica to solve the normal PDF function for $x$?

So considering $μ$ and $σ$ as constants, instead of $f(x) = \frac{1}{\sigma\sqrt{2\pi} } \; e^{ -\frac{(x-\mu)^2}{2\sigma^2} }$, have something like $g(y)= ...$

I expect for values of $x<μ$ and $x>μ$ things would be different.

$\endgroup$
2
  • 2
    $\begingroup$ Do you mean finding the inverse function for the PDF? Then it's Solve[{PDF[NormalDistribution[mu, sigma], x] == y, sigma > 0}, x, Reals] If not, please clarify your question. $\endgroup$
    – aooiiii
    Jan 14, 2020 at 19:47
  • $\begingroup$ Thank you. Yes, this is what I wanted. $\endgroup$
    – Gouz
    Jan 14, 2020 at 20:21

1 Answer 1

4
$\begingroup$
Assuming[σ > 0 && 0 < p < 1/(σ*Sqrt[2π]),
  Solve[PDF[NormalDistribution[μ, σ], x] == p, x, Reals] // FullSimplify]

(*    {{x -> μ - σ*Sqrt[-Log[2π] - 2*Log[p*σ]]},
       {x -> μ + σ*Sqrt[-Log[2π] - 2*Log[p*σ]]}}    *)
$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.