DSPRelated.com
Forums
Online · Live + on demand
February 9-11, 2027
Price goes up Jan 1: register now to lock in today's rate
Register Now →

Proof for Expected Value Problem

Started by maco ●April 18, 2011
dvsarwate <dvsarwate@yahoo.com> writes:

> On Apr 20, 11:44&nbsp;am, Tim Wescott <t...@seemywebsite.com> wrote:
[snip]
> For the specific case > brought up by the OP, the probability density function of > theta is > > exp(-1/(2*sigma^2)) > + cos(theta)/(2*sigma*sqrt{2 pi}*[1 + erf{cos(theta)/ > (sigma*sqrt{2})}]*exp(-sin^2(theta)/(2*sigma^2) > > for theta between -pi and +pi, and the OP needs to compute > E[cos(theta)] via LOTUS from this pdf. Numerical evaluation > of the integral is likely to be easier than trying to evaluate it > analytically, though giving it to Mathematica or Maple is > probably worthwhile. I am sure that someone has computed an > analytical expression already or a good approximation thereof.
I was unable to make sense of your expression since the parentheses don't match, and simply closing them didn't seem to work out numerically. (I might have done something wrong.) Anyway, I had my own expression which differed somewhat from yours. Fortunately, the messiest term in the expression collapsed to zero upon definite integration due to symmetries and I was able to find the following closed form solution. (I used Mathematica, but it needed a lot of help from me to get this.): Let q = 1/(2*sigma) then the expected value of the original poster's expression is: sqrt(pi/2) * q * exp(-q^2) * (I_0(q^2)+I_1(q^2)) where I_n is the Modified Bessel function of the first kind. see: http://mathworld.wolfram.com/ModifiedBesselFunctionoftheFirstKind.html The original poster's approximation function is: 1 / sqrt(1+2*sigma^2) This function shares some similarities with the actual solution: 1. The series expansion at sigma=0 looks like 1-sigma^2, while the solution looks like 1-sigma^2/2. So they agree on the function value and the first derivative. 2. The series expansion at sigma=infinity looks like 1/sqrt(2)*1/sigma, while the solution looks like sqrt(pi/8)*1/sigma. So as sigma goes to infinity, they both go like 1/sigma, with the coefficient of the approximation being about 0.707 and the coefficient of the solution being about 0.627. So it works out that the minimum error is -0.0345375 at sigma = 0.384517 and the maximum error is 0.0307944 at sigma = 1.61243. Not too bad for absolute error.
> >> I'm also not sure that it's wise to pull trigonometry back into the >> problem once you've gotten rid of it, unless the aim is just to better >> visualize the problem to help you along to a solution. > > Different strokes for different folks.... Best of luck trying to > simplify your > >>expression in the rectilinear variables >>along with a bunch of operations against constants. >>Unfortunately there's a radical and more than one >>fraction involved
As you did, I brought trigonometry back into the problem to eliminate the radical. Scott -- Scott Hemphill hemphill@alumni.caltech.edu "This isn't flying. This is falling, with style." -- Buzz Lightyear
On Apr 22, 4:07&#4294967295;pm, Scott Hemphill <hemph...@hemphills.net> wrote:

> > > exp(-1/(2*sigma^2)) > > + cos(theta)/(2*sigma*sqrt{2 pi}*[1 + erf{cos(theta)/ > > (sigma*sqrt{2})}]*exp(-sin^2(theta)/(2*sigma^2)
> > I was unable to make sense of your expression since the parentheses > don't match, and simply closing them didn't seem to work out > numerically.
I think it was supposed to be exp{-1/(2*sigma^2)}/(2*pi) + cos(theta)/(2*sigma*sqrt{2 pi})*[1 + erf{cos(theta)/ (sigma*sqrt{2})}]*exp{-sin^2(theta)/(2*sigma^2)} but I don't guarantee parsing of this one either. Thanks for your careful reading of this stuff. --Dilip Sarwate
dvsarwate <dvsarwate@yahoo.com> writes:

> On Apr 22, 4:07&nbsp;pm, Scott Hemphill <hemph...@hemphills.net> wrote: > >> >> > exp(-1/(2*sigma^2)) >> > + cos(theta)/(2*sigma*sqrt{2 pi}*[1 + erf{cos(theta)/ >> > (sigma*sqrt{2})}]*exp(-sin^2(theta)/(2*sigma^2) > >> >> I was unable to make sense of your expression since the parentheses >> don't match, and simply closing them didn't seem to work out >> numerically. > > I think it was supposed to be > > exp{-1/(2*sigma^2)}/(2*pi) > + cos(theta)/(2*sigma*sqrt{2 pi})*[1 + erf{cos(theta)/ > (sigma*sqrt{2})}]*exp{-sin^2(theta)/(2*sigma^2)} > > but I don't guarantee parsing of this one either. Thanks > for your careful reading of this stuff.
Yes, that works. So you multiply by cos(theta) and integrate theta between -Pi and Pi. The great thing is that the term with erf(...) drops out during the integration, giving you the same result I posted earlier. Scott -- Scott Hemphill hemphill@alumni.caltech.edu "This isn't flying. This is falling, with style." -- Buzz Lightyear
>dvsarwate <dvsarwate@yahoo.com> writes: > >> On Apr 22, 4:07&nbsp;pm, Scott Hemphill <hemph...@hemphills.net> wrote: >> >>> >>> > exp(-1/(2*sigma^2)) >>> > + cos(theta)/(2*sigma*sqrt{2 pi}*[1 + erf{cos(theta)/ >>> > (sigma*sqrt{2})}]*exp(-sin^2(theta)/(2*sigma^2) >> >>> >>> I was unable to make sense of your expression since the parentheses >>> don't match, and simply closing them didn't seem to work out >>> numerically. >> >> I think it was supposed to be >> >> exp{-1/(2*sigma^2)}/(2*pi) >> + cos(theta)/(2*sigma*sqrt{2 pi})*[1 + erf{cos(theta)/ >> (sigma*sqrt{2})}]*exp{-sin^2(theta)/(2*sigma^2)} >> >> but I don't guarantee parsing of this one either. Thanks >> for your careful reading of this stuff. > >Yes, that works. So you multiply by cos(theta) and integrate theta >between -Pi and Pi. The great thing is that the term with erf(...) >drops out during the integration, giving you the same result I posted >earlier. > >Scott >-- >Scott Hemphill hemphill@alumni.caltech.edu >"This isn't flying. This is falling, with style." -- Buzz Lightyear >
Thank you guys for your answers, I appreciate very much your effort. I also tried to find the theoretical expected value by using the p.d.f. suggested by Dilip (multiplying by cos(theta) and integrating between -pi and pi), arriving at Scott's expression: sqrt(pi/2) * q * exp(-q^2) * (I_0(q^2)+I_1(q^2)), with q = 1/(2*sigma) As commented by Scott, it seems that the approximation I found empirically fits quite well the "real" expected value. However, I am a bit dissappointed for not having found a simpler explanation. I expected that, under some theoretical assumption, the real expected value would boil down to the approximated expression. Best regards, maco