[R] qmvnorm function

Rui Barradas rui1174 at sapo.pt
Wed Mar 14 23:37:30 CET 2012


li li-13 wrote
> Dear all,
>    I need to use the "qmvnorm" function in mtvnorm package.
> Here is the error message I got
>> qmvnorm(0.05, tail="upper", sigma=var)$quantile
> Error in uniroot(pfct, interval = interval) :
>   f() values at end points not of opposite sign
> There is no problem for 50th quantile.
>> qmvnorm(0.5, tail="upper", sigma=var)$quantile
> [1] -0.5325527
> Can anyone give some hint regarding this?
>  Thanks.
> 	[[alternative HTML version deleted]]
> ______________________________________________
> R-help@ 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.

The problem seems to be in the value of 'var'.

> qmvnorm(0.05, tail="upper", sigma=diag(2))$quantile 
[1] 0.7600695
> qmvnorm(0.05, tail="upper", sigma=diag(5))$quantile 
[1] -0.123829

>From these results, there is nothing intrisically wrong with the quantile

In the error message, 'uniroot' is not in an interval with a guaranteed
solution, maybe
the parameter 'interval' of 'qmvnorm' will put it in the right track.

Hope this helps,

Rui Barradas

View this message in context: http://r.789695.n4.nabble.com/qmvnorm-function-tp4473262p4473364.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list