ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 16 Mar 2015 14:43:45 +0100How to solve normal distribution equation in Sagehttps://ask.sagemath.org/question/26203/how-to-solve-normal-distribution-equation-in-sage/I'm practicing statistics and I'm wondered how one can solve the following problem from Sage:
Find a numerical value of $x$ such that $\frac{1}{\sqrt{2\pi}}\int_{-\infty}^x e^{-t^2/2}dt=0.987654321$. I was thinking to different solutions:
1) Is there an inverse of normal distribution cumulative function?
2) Can we write it as $f'(x)=e^{-x^2/2},f(0)=1/2,f(x_0)=0.987654321$ and use some numerical method to solve the differential equation?
but I don't know are those functions implemented in Sage.Mon, 16 Mar 2015 14:35:02 +0100https://ask.sagemath.org/question/26203/how-to-solve-normal-distribution-equation-in-sage/Answer by calc314 for <p>I'm practicing statistics and I'm wondered how one can solve the following problem from Sage:</p>
<p>Find a numerical value of $x$ such that $\frac{1}{\sqrt{2\pi}}\int_{-\infty}^x e^{-t^2/2}dt=0.987654321$. I was thinking to different solutions: </p>
<p>1) Is there an inverse of normal distribution cumulative function?</p>
<p>2) Can we write it as $f'(x)=e^{-x^2/2},f(0)=1/2,f(x_0)=0.987654321$ and use some numerical method to solve the differential equation?</p>
<p>but I don't know are those functions implemented in Sage.</p>
https://ask.sagemath.org/question/26203/how-to-solve-normal-distribution-equation-in-sage/?answer=26204#post-id-26204I use the stats package in scipy for this. For example:
import scipy.stats as st
st.norm.ppf(0.6,0,1)
Gives the value $x_0$ so that $P(x\le x_0) = 0.6$ for a normal distribution with mean 0 and variance 1.
See the [documentation](http://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.norm.html).Mon, 16 Mar 2015 14:43:45 +0100https://ask.sagemath.org/question/26203/how-to-solve-normal-distribution-equation-in-sage/?answer=26204#post-id-26204