MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Integrate on StudentTDistribution

  • To: mathgroup at smc.vnet.net
  • Subject: [mg103316] Re: [mg103303] Integrate on StudentTDistribution
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Tue, 15 Sep 2009 04:24:33 -0400 (EDT)
  • Reply-to: hanlonr at cox.net

$Version

7.0 for Mac OS X x86 (64-bit) (February 19, 2009)

Break the integral into two segments

expr[nN_, min_, max_] = Assuming[
  nN > 0 && Element[x, Reals] && max > min,
  Simplify[
   Integrate[PDF[StudentTDistribution[nN], x],
     {x, -Infinity, max}] -
    Integrate[PDF[StudentTDistribution[nN], x],
     {x, -Infinity, min}]]]

(Gamma[(nN + 1)/2]*(max*Hypergeometric2F1[1/2, (nN + 1)/2, 3/2, 
             -(max^2/nN)] - min*Hypergeometric2F1[1/2, (nN + 1)/2, 3/2, 
             -(min^2/nN)]))/(Sqrt[Pi]*Sqrt[nN]*Gamma[nN/2])

Comparing the results to the CDF

Table[With[{
     nN = 5*RandomReal[{0, 1}],
     min = RandomReal[{-20, 10}],
     max = RandomReal[{10, 40}]},
    expr[nN, min, max] - (
      CDF[StudentTDistribution[nN], max] -
       CDF[StudentTDistribution[nN], min])],
   {200}] // Chop // Union

{0}


Bob Hanlon

---- Alexey <lehin.p at gmail.com> wrote: 

=============
Hello, I am confused again with different behavior of
Integrate[PDF[StudentTDistribution[nN], x], {x, min, max}]
in Mathematica 7.01 and 5.2.
In the version 5.2:

In[2]:= Assuming[nN > 0 && Element[x, Reals] && max > min,
 Integrate[(nN/(nN + x^2))^((1 + nN)/2)/(
  Sqrt[nN] Beta[nN/2, 1/2]), {x, min, max}]]

Out[2]= (max Hypergeometric2F1[1/2, (1 + nN)/2, 3/2, -(max^2/nN)] -
 min Hypergeometric2F1[1/2, (1 + nN)/2, 3/2, -(min^2/nN)])/(Sqrt[nN]
  Beta[nN/2, 1/2])

In the version 7.01:

In[1]:= Assuming[nN > 0 && Element[x, Reals] && max > min,
 Integrate[PDF[StudentTDistribution[nN], x], {x, min, max}]]

Out[1]= (1/Beta[nN/2, 1/2])nN^(nN/2)
  If[min > 0 && max > 0, (1/
  nN)(max min)^-nN (-min^nN Hypergeometric2F1[nN/2, (1 + nN)/2, (
       2 + nN)/2, -(nN/max^2)] +
     max^nN Hypergeometric2F1[nN/2, (1 + nN)/2, (2 + nN)/
       2, -(nN/min^2)]),
  Integrate[(nN + x^2)^(-(1/2) - nN/2), {x, min, max},
   Assumptions ->
    x \[Element] Reals && min <= 0 && max > min && nN > 0]]

Are the requirements min > 0 && max > 0 really necessary?



  • Prev by Date: Re: Import "HeldExpression" element of MX file
  • Next by Date: Re: Re: condense axis
  • Previous by thread: Integrate on StudentTDistribution
  • Next by thread: Two Axis DateListPlot