1. int{[1-F1(x)]*[1-F2(x,0)]*dx}
2. the limits of the integration are zero and infinity.
3. F1 is a cumulative distribution function of normal
random variable.
4. F2 is a cumulative distribution function of bivariate
normal variable.
5. F1 and F2 are both independent of each other.
Can some one give me a lead in solving this problem?
"Omkar Palsule-Desai" <omkardpd@iimahd.ernet.in> wrote in message
<fn4nav$l9d$1@fred.mathworks.com>...
>
> Hi,
>
> I am trying to solve an integration of the form:
>
> 1. int{[1-F1(x)]*[1-F2(x,0)]*dx}
> 2. the limits of the integration are zero and infinity.
> 3. F1 is a cumulative distribution function of normal
> random variable.
> 4. F2 is a cumulative distribution function of bivariate
> normal variable.
> 5. F1 and F2 are both independent of each other.
>
> Can some one give me a lead in solving this problem?
The simplest solution is to reduce the domain
to a finite one. Identify a rectangular box,
outside of which the product is essentially zero
below some reasonable tolerance.
Do not make this box too large, else you will
get garbage for the result! If you are sloppy and
make the box too large, the quadrature will fail,
producing spuriously low results.
I agree with your suggestion of reducing domain. But I
feel the main issue is due to the functions. The functions
are of the normal and bivariate normal form. I have not
been able to integrate normal density function with "int"
command in matlab. I am not sure about how to handle the
function to be integrated.
Thank you
Omkar
"John D'Errico" <woodchips@rochester.rr.com> wrote in
message <fn4orm$b5p$1@fred.mathworks.com>...
> "Omkar Palsule-Desai" <omkardpd@iimahd.ernet.in> wrote
in message
> <fn4nav$l9d$1@fred.mathworks.com>...
> >
> > Hi,
> >
> > I am trying to solve an integration of the form:
> >
> > 1. int{[1-F1(x)]*[1-F2(x,0)]*dx}
> > 2. the limits of the integration are zero and infinity.
> > 3. F1 is a cumulative distribution function of normal
> > random variable.
> > 4. F2 is a cumulative distribution function of
bivariate
> > normal variable.
> > 5. F1 and F2 are both independent of each other.
> >
> > Can some one give me a lead in solving this problem?
>
> The simplest solution is to reduce the domain
> to a finite one. Identify a rectangular box,
> outside of which the product is essentially zero
> below some reasonable tolerance.
>
> Do not make this box too large, else you will
> get garbage for the result! If you are sloppy and
> make the box too large, the quadrature will fail,
> producing spuriously low results.
>
> Then use an adaptive tool like dblquad.
>
> John
"Omkar Palsule-Desai" <omkardpd@iimahd.ernet.in> wrote in message
<fn4pgb$jg2$1@fred.mathworks.com>...
> I agree with your suggestion of reducing domain. But I
> feel the main issue is due to the functions. The functions
> are of the normal and bivariate normal form. I have not
> been able to integrate normal density function with "int"
> command in matlab. I am not sure about how to handle the
> function to be integrated.
> Omkar
---------
Omkar, I am a little puzzled here. The fact that F1 and F2 refer to
independent distributions has nothing to do with your evaluation of this given
integral, unless you had in mind expressing that integral as a multiple
integral involving products of the respective normal density functions, and I
see no advantage in doing that. After all, once one knows the mean(s) and
(co)variances of these distributions, their cumulative distribution functions
are completely determined as functions of x, and therefore the product (1-F1
(x)*[1-F2(x,0)) is determined.
Matlab's Statistics Toolbox contains the functions 'normcdf' and 'mvncdf'
from which you can form this integrand function in your integral. The
problem then is one of a single integration, and you should be able to make
use of one of matlab's numerical quadrature functions for this purpose.
However, as John advises, you need to change to a finite approximating upper
limit of integration rather than infinity to make it work properly. The limit
should be selected large enough to ensure upper limit integration accuracy
but not so large as to confuse the quadrature functions, they being somewhat
temperamental beasts.
"Omkar Palsule-Desai" <omkardpd@iimahd.ernet.in> wrote in message
<fn4pgb$jg2$1@fred.mathworks.com>...
> I agree with your suggestion of reducing domain. But I
> feel the main issue is due to the functions. The functions
> are of the normal and bivariate normal form. I have not
> been able to integrate normal density function with "int"
> command in matlab. I am not sure about how to handle the
> function to be integrated.
You seem to think there is a magic solution
to this. There is no closed form solution to the
integrations that you have. There is no magic
pill to take, no magical matlab incantation to
utter. Insisting that there must be an answer
because it is a simple problem to state will
not always produce an easy answer.
I got your point. The fact that F1 and F2 are independent
has nothing to do with solving the integral involving both
functions in product form as an integrant.
I thought normcdf and mvncdf are the functions for
numerical analyses of functions in normal form. But what I
have to do is find the cdf form for each one of these
distributions, i.e. F1 and F2, using a function, say "int"
with "x" as syms. Then integrate the function in product
form of F1 and F2 within limits. When I tried obtaining
product form of F1 and F2, I get many error messages, such
as mpower. So I thought obtaining the functions F1 and F2
themselves is an issue in matlab.
Would you clarify if I am incorrect? Thank you
Omkar
"Roger Stafford"
<ellieandrogerxyzzy@mindspring.com.invalid> wrote in
message <fn58i6$q0n$1@fred.mathworks.com>...
> "Omkar Palsule-Desai" <omkardpd@iimahd.ernet.in> wrote
in message
> <fn4pgb$jg2$1@fred.mathworks.com>...
> > I agree with your suggestion of reducing domain. But I
> > feel the main issue is due to the functions. The
functions
> > are of the normal and bivariate normal form. I have
not
> > been able to integrate normal density function
with "int"
> > command in matlab. I am not sure about how to handle
the
> > function to be integrated.
> > Omkar
> ---------
> Omkar, I am a little puzzled here. The fact that F1
and F2 refer to
> independent distributions has nothing to do with your
evaluation of this given
> integral, unless you had in mind expressing that
integral as a multiple
> integral involving products of the respective normal
density functions, and I
> see no advantage in doing that. After all, once one
knows the mean(s) and
> (co)variances of these distributions, their cumulative
distribution functions
> are completely determined as functions of x, and
therefore the product (1-F1
> (x)*[1-F2(x,0)) is determined.
>
> Matlab's Statistics Toolbox contains the
functions 'normcdf' and 'mvncdf'
> from which you can form this integrand function in your
integral. The
> problem then is one of a single integration, and you
should be able to make
> use of one of matlab's numerical quadrature functions
for this purpose.
> However, as John advises, you need to change to a finite
approximating upper
> limit of integration rather than infinity to make it
work properly. The limit
> should be selected large enough to ensure upper limit
integration accuracy
> but not so large as to confuse the quadrature functions,
they being somewhat
> temperamental beasts.
>
> Roger Stafford
>
"Omkar Palsule-Desai" <omkardpd@iimahd.ernet.in> wrote in message
<fn5edn$rd4$1@fred.mathworks.com>...
>
> Hi Roger,
>
> I got your point. The fact that F1 and F2 are independent
> has nothing to do with solving the integral involving both
> functions in product form as an integrant.
>
> I thought normcdf and mvncdf are the functions for
> numerical analyses of functions in normal form. But what I
> have to do is find the cdf form for each one of these
> distributions, i.e. F1 and F2, using a function, say "int"
> with "x" as syms. Then integrate the function in product
> form of F1 and F2 within limits. When I tried obtaining
> product form of F1 and F2, I get many error messages, such
> as mpower. So I thought obtaining the functions F1 and F2
> themselves is an issue in matlab.
>
> Would you clarify if I am incorrect? Thank you
>
> Omkar
It is not necessary to use 'int' for generating F1 and F2 if you possess
MathWorks' Statistics Toolbox, since 'normcdf' and 'mvncdf' have already
done that job for you. (The 'cdf' in their names stand for cumulative
distribution functions.) If you lack that toolbox, 'int' will give a specific
solution for a single cumulative normal distribution in terms of the 'erf' error
function, but I'm not sure what it is able to produce for a cumulative bivariate
normal distribution. My own version of the Symbolic Math Toolbox is quite
primitive and is probably not up to that latter task. Possibly you have a
version that could do so?
However you manage to create F1 and F2 and therefore your desired
integrand, it is most unlikely that 'int' would be able to carry on from there
and solve the resulting integral, so you will undoubtedly have to do the
integration numerically, not symbolically. MathWorks has some numerical
quadrature routines, such as 'quad' and others, which are suitable for this
task. You need to construct an anonymous function, calling in turn on
'normcdf' and 'mvncdf', which such quadrature routines can call on for
evaluating the desired integrand in computing the final integral.
Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central. Read the complete Disclaimer prior to use.