# Re: [R] r: integration question

From: Spencer Graves <spencer.graves_at_pdf.com>
Date: Tue 21 Jun 2005 - 00:53:47 EST

If I read your question correctly, you want to integrate the indicated expression over x = 0 to Inf. If I substitute z = x/sqrt(b), your integral becomes one constant plus another times the expected value of (y-z/sqrt(b))^2, where z follows Student's t with v degrees of freedom. Expand the quadratic form to get y^2 + (Ez^2)/b and find something that gives the variance of Student's t.

I don't have time now to work out the details, but this should work if I've understood your question correctly.

spencer graves

Clark Allan wrote:
> hi all
>
> at the outset i must APOLOGIZE for sending the following mail. it is not
> R related but since there are many stats and maths buffs that use the
> list i decided to send the following question.
>
> integrate ((1+((y-bx)^2)/(av))*(1+(x^2)/(bv)))^(-0.5*(v+1))
>
> over the interval 0 to inf
>
>
> a>0, b>0 and v>4
> y treated as a constant over the real line.
>
> i could integrate the function using "integrate". do so for a large
> number of y values and plot the function BUT i would prefer an exact
> solution if possible.
>
> any help will be appreciated.
> i've attached a word file with the formula
>
>
> \
> allan
>
>
> ------------------------------------------------------------------------
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help