Skip to content

qmvnorm function

4 messages · Li Li, Rui Barradas

#
Hello,

li li-13 wrote
The problem seems to be in the value of 'var'.
[1] 0.7600695
[1] -0.123829
0.05.

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.
#
Hello,
It works in my system: (your first example)

var <- matrix(c(1,0.05,0.05,1), nrow=2, ncol=2, byrow=T)
var
     [,1] [,2]
[1,] 1.00 0.05
[2,] 0.05 1.00
qmvnorm(0.05, tail="upper", sigma=var)$quantile
[1] 0.7934487

It also worked with the other two examples. System? Package version?

My system is
_                            
platform       i386-pc-mingw32              
version.string R version 2.14.1 (2011-12-22)

And the package mvtnorm version is 0.9-9991, the current CRAN is 0.9-9992

Anyway, I've tried it with the 'interval' parameter. Note the difference in
iterations to convergence

#var <- matrix(c(1,0.05,0.05,1), nrow=2, ncol=2, byrow=T)
#var
qmvnorm(0.05, tail="upper", sigma=var)
$quantile
[1] 0.7934487

$f.quantile
[1] -2.719625e-07
attr(,"error")
[1] 1e-15
attr(,"msg")
[1] "Normal Completion"

$iter
[1] 12

$estim.prec
[1] 6.103516e-05

 
qmvnorm(0.05, interval=c(0, 5), tail="upper", sigma=var)
$quantile
[1] 0.793449

$f.quantile
[1] -3.152414e-07
attr(,"error")
[1] 1e-15
attr(,"msg")
[1] "Normal Completion"

$iter
[1] 9

$estim.prec
[1] 6.103516e-05

Your problem seems to be with, at least, 'uniroot'. Give it a help and it
might work.

Rui Barradas



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