Skip to content
Back to formatted view

Raw Message

Message-ID: <E53F6601-DE22-4186-84E2-5E2429F26AAD@gmail.com>
Date: 2013-03-06T10:57:08Z
From: jim holtman
Subject: Error message
In-Reply-To: <CAHLnndZvyCzr8Xe2vkzJzJzAC8SSkVzqrorBF01HrNhtS-koLw@mail.gmail.com>

most likely either 'lower' or 'upper' is NA.  put

options(error = recover)

in your script to stop on the error and examine the value.  you need to learn "debugging 101" to help yourself out.

Sent from my iPad

On Mar 5, 2013, at 16:00, li li <hannah.hlx at gmail.com> wrote:

> Dear all,
> I got an error message when running the following code.
> Can anyone give any suggestions on fixing  this type of error?
> Thank you very much in advance.
>    Hanna
> 
> 
> 
>> integrand <- function(x, rho, a, b, z){
> +              x1 <- x[1]
> +              x2 <- x[2]
> +              Sigma <- matrix(c(1, rho, rho, 1), 2,2)
> +              mu <- rep(0,2)
> +              f <- pmnorm(c((z-a*x1)/b, (z-a*x2)/b), mu,
> Sigma)*dmnorm(c(0,0), mu, diag(2))
> +              f
> +                                        }
>> 
>> adaptIntegrate(integrand, lower=rep(-Inf, 2), upper=c(2,2),
> + rho=0.1, a=0.6, b=0.3, z=3,  maxEval=10000)
> Error in if (any(lower > upper)) stop("lower>upper integration limits") :
>  missing value where TRUE/FALSE needed
> 
>    [[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.