MathGroup Archive 2002

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

Search the Archive

More weird integration issues...

  • To: mathgroup at smc.vnet.net
  • Subject: [mg35789] More weird integration issues...
  • From: mnewstein at juno.com (Maurice Newstein)
  • Date: Wed, 31 Jul 2002 01:33:27 -0400 (EDT)
  • Organization: http://groups.google.com/
  • Sender: owner-wri-mathgroup at wolfram.com

This works:

polyCoeff = CoefficientList[(-m + x)^5*(a + b*x + 
   c*x^2 + d*x^3 + e*x^4 + f*x^5),{x}];
Sum[polyCoeff[[k]]Integrate[Exp[-const (x-m)^2]
x^(k-1),{x,-Infinity,Infinity},Assumptions->const>0],{k,1,11}]

Maurice

On Saturday, July 27, 2002, at 07:43 PM, Binesh Bannerjee wrote:  Hi.
I'm trying to compute the 5th moment of a tweak to the normal pdf. 
Here's what I have: F[a_, b_, c_, d_, e_, f_, X_] := (a + b X + c X^2
+ d X^3 + e X^4 + f X^5)* > Exp[-(((X - m)/sd)^2)/2]/(Sqrt[2Pi]sd).
The strange thing, and I'd appreciate someone shedding some light on
this,  is that this:Integrate[F[p\_0, p\_1, p\_2, p\_3, p\_4, p\_5, >
X]*\((\((X - m)\)/sd)\)^5, {X, -Infinity, Infinity},  Assumptions ->
{sd > 0}]) (I cut and pasted that it looks like it works) Anyway, THAT
gives me an answer really quickly... (within 5 minutes on > my box)
JUST changing it from p0..5 to a,b,c,d,e,f like so: Integrate[F[a, b,
c, d, e, f, X]*((X - m)/sd)^5, {X, -Infinity, > Infinity},Assumptions
-> {sd > 0}] Causes mathematica to go into an infinite loop (seemingly
after 6 hours). This ... sucks. How am I to know if a certain equation
is solvable, if  only I choose the right variables??
Binesh Bannerjee 


On Monday, July 29, 2002, at 09:16 PST Andrzej Kozlowski wrote:  There
does sem to be a bug here, but it is not quite what you think. It's
the first answer that you get that is probably wrong. On the other
hand, in the second case it is very unlikely that Mathematica enters
an infinite loop, rather it is still trying to arrive at the answer
and there is no guarantee that it will reach one after, say a week or
a month. As for first case, the reason why the answer is probably
this. Evaluate the formula: formula=Integrate[F[Subscript[p, 0],
Subscript[p, 1], Subscript[p, 2], Subscript[p, 3], Subscript[p, 4],
Subscript[p, 5], X]*((X - m)/sd)^5, {X, -Infinity, Infinity}] Now set
Evaluate[Table[Subscript[p, i], {i, 1, 5}]] = Table[Random[], {5}] and
also sd = Random[]; m = Random[]; Now evaluate again
Integrate[F[Subscript[p, 0], Subscript[p, 1], Subscript[p, 2],
Subscript[p, 3], Subscript[p, 4], Subscript[p, 5], X]*((X - m)/sd)^5,
{X, -Infinity, Infinity}] and formula You will almost certainly get
different answers, while they clearly ought to be the same. It seems
that it is nto the fact that the names you are suing are different
that leads to different results in both of your integrals but the fact
that the names of the parameters in the first case are not symbols.
"Officially" there is no reason why they should be, but in practice
using non-symbols in formulas makes them more complicated and is more
likely to result in errors. The really bad news as far as your problem
is concerned is that it is the 6 hour fruitless computation that
appears to be the correct one ... Andrzej Kozlowski Toyama
International University JAPAN http://platon.c.u-tokyo.ac.jp/andrzej/


  • Prev by Date: RE: Re: Re: Question about Replace
  • Next by Date: Re: Work with Contexts
  • Previous by thread: Re: More weird integration issues...
  • Next by thread: solving for variables in terms of other variables