From: ati on
Hi,
I'd like to evaluate double improper intagral, like:
>>F=@(t,x)exp(-x.*t)./t.^3;

>>dblquad(F,1,inf,0,inf));
results: Warning: Infinite or Not-a-Number function value encountered. ans= NaN

and
>> int(int(F,t,1,inf),x,0,inf);
results: ??? Undefined function or variable 't'.

Help is much appreciated.
From: Roger Stafford on
"ati " <nati02(a)t-online.hu> wrote in message <holgpt$3fk$1(a)fred.mathworks.com>...
> Hi,
> I'd like to evaluate double improper intagral, like:
> >>F=@(t,x)exp(-x.*t)./t.^3;
>
> >>dblquad(F,1,inf,0,inf));
> results: Warning: Infinite or Not-a-Number function value encountered. ans= NaN
>
> and
> >> int(int(F,t,1,inf),x,0,inf);
> results: ??? Undefined function or variable 't'.
>
> Help is much appreciated.

You can try a change of variables that makes both limits finite to see if that helps. For example, try u = 1/t and y = 1/(x+1). That brings both u and y into the finite range from 0 to 1, which would avoid that first warning you received.

Unfortunately the transformed integrand becomes

u/y^2*exp((y-1)/(u*y))

and you might receive a different warning if 'dblquad' evaluates this for values of u and y that are too close to zero. If that happens, you could fudge the two limits up just a very small amount away from zero to avoid such computational difficulties. The integrand values would actually be exceedingly small for such values of u and y in spite of the division by y^2.

As for attempting to find a symbolic integral with 'int', my (admittedly rather ancient) integral table lists only a power series for that particular integral, so I suspect that you would receive a matlab message to the effect that there was "no explicit solution found".

Roger Stafford
From: Walter Roberson on
ati wrote:
> Hi,
> I'd like to evaluate double improper intagral, like:
>>> F=@(t,x)exp(-x.*t)./t.^3;
>
>>> dblquad(F,1,inf,0,inf));
> results: Warning: Infinite or Not-a-Number function value encountered.
> ans= NaN
>
> and
>>> int(int(F,t,1,inf),x,0,inf);
> results: ??? Undefined function or variable 't'.

If you reverse the order of integration, then a symbolic package (Maple)
quickly gives an answer of 1/3 for the double integration. On the other
hand, the inner integration is then expressed in terms of a limit, so I
do not have an intuitive understanding of what that really means or
whether the simple final answer is really correct. I am attempting some
numeric verification.... yes, Maple's int() function with the numeric
option confirms the 1/3.
From: Roger Stafford on
Walter Roberson <roberson(a)hushmail.com> wrote in message <hom0fg$7oc$1(a)canopus.cc.umanitoba.ca>...
> If you reverse the order of integration, then a symbolic package (Maple)
> quickly gives an answer of 1/3 for the double integration. On the other
> hand, the inner integration is then expressed in terms of a limit, so I
> do not have an intuitive understanding of what that really means or
> whether the simple final answer is really correct. I am attempting some
> numeric verification.... yes, Maple's int() function with the numeric
> option confirms the 1/3.

Yes, you're right, Walter. The answer is indeed 1/3. In fact it can easily be done by hand that way. I just didn't think to try reversing the order.

Roger Stafford
From: ati on
"ati " <nati02(a)t-online.hu> wrote in message <holgpt$3fk$1(a)fred.mathworks.com>...
> Hi,
> I'd like to evaluate double improper intagral, like:
> >>F=@(t,x)exp(-x.*t)./t.^3;
>
> >>dblquad(F,1,inf,0,inf));
> results: Warning: Infinite or Not-a-Number function value encountered. ans= NaN
>
> and
> >> int(int(F,t,1,inf),x,0,inf);
> results: ??? Undefined function or variable 't'.
>
> Help is much appreciated.

Thanx for your replies.
Actually, I am coding the NORTA method for gamma random variables with linear correlations. In the initialization step a double intagral must be evaluated (several times) with the standard bivariate normal distribution as the integrator to find implied correlations. The posted example was only to clearify my problem. Now I use a reasonable finite domain, and so far seems to work well.