MORE: Statistics`ContinousDistributions` (integrating over a UniformDistribution)

• To: mathgroup at smc.vnet.net
• Subject: [mg9252] MORE: Statistics`ContinousDistributions` (integrating over a UniformDistribution)
• From: "decker, mark a" <ormad at orntsrv103.micro.lucent.com>
• Date: Fri, 24 Oct 1997 01:01:06 -0400
• Sender: owner-wri-mathgroup at wolfram.com

```More on this....

I have just found out that putting the limits {x, 0, Pi} doesn't work
either!!!

When I try to calculate the MeanDist[] of the function  Sin[x]

MeanDist[Sin[x]],   I get a similar result whether or not I set the
limits to {x, 0, Pi}.

This puzzles me greatly since in the interval {0,Pi}  the integrand
should merely be "Sin[x] (1/Pi)".  Why can't Mathematica deal with it?

------------- for review -----------

><<Statistics`ContinuousDistributions`
>
>p[x_] := PDF[UniformDistribution[0,Pi],x]
>
>MeanDist[f_] := Integrate[ f p[x], {x, 0, Pi}]

MeanDist[ Sin[x] ]     Doesn't give 2/Pi   like I'd expect.  (and I
don't even like forcing the limits to {0,Pi}... much better to have
{-infinity,infinity}

>===============================================================
>
><<Statistics`ContinuousDistributions`
>
>p[x_] := PDF[UniformDistribution[0,Pi],x]
>
>MeanDist[f_] := Integrate[ f p[x], {x, -Infinity, Infinity}]
>
>(* which gives *)
>
>Integrate::idiv: Integral of (x(Sign[x] - Sign[-Pi+x]))/(2 Pi) does not
>converge on {-Infinity, Infinity}.
>Integrate::idiv: Integral of x (Sign[x] - Sign[-Pi+x]) does not converge on
>{-Infinity, Infinity}.
>
>Integrate[ x (Sign[x] - Sign[-Pi + x])/(2 Pi), {x, -Infinity, Infinity}]
>
>===============================================================
>
>** again I'm not looking for the answer, I realize for this problem I could
>just put in the limits {x, 0, Pi} and everything is fine.... but would like
>to keep the function MeanDist[] general.

```

• Prev by Date: NonlinearFit of complex function
• Next by Date: Newbie question: big matrix calculations
• Previous by thread: NonlinearFit of complex function
• Next by thread: RE:MORE: Statistics`ContinousDistributions` (integrating over a UniformDistribution)