sympy.stats.StudentT() in Python
Last Updated :
08 Jun, 2020
With the help of sympy.stats.StudentT()
method, we can get the continuous random variable which represents the student’s t distribution.
Syntax : sympy.stats.StudentT(name, nu)
Where, nu is real number and nu > 0.
Return : Return the continuous random variable.
Example #1 :
In this example we can see that by using sympy.stats.StudentT()
method, we are able to get the continuous random variable representing Student’s T distribution by using this method.
from sympy.stats import StudentT, density
from sympy import Symbol, pprint
z = Symbol( "z" )
nu = Symbol( "nu" , positive = True )
X = StudentT( "x" , nu)
gfg = density(X)(z)
pprint(gfg)
|
Output :
nu 1
– — – –
2 2
/ 2\
| z |
|1 + –|
\ nu/
—————–
____ / nu\
\/ nu *B|1/2, –|
\ 2 /
Example #2 :
from sympy.stats import StudentT, density
from sympy import Symbol, pprint
z = 0.46
nu = 2
X = StudentT( "x" , nu)
gfg = density(X)(z)
pprint(gfg)
|
Output :
___
0.214993401181957*\/ 2
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...