[R] mvrnorm problem

(Ted Harding) Ted.Harding at nessie.mcc.ac.uk
Mon Feb 2 23:17:13 CET 2004


On 02-Feb-04 Stuart V Jordan wrote:
> I am trying to simulate draws from a multivariate normal using mvrnorm,
> and
> am getting the following error message:
>  
>     Error in mu + eS$vectors %*% diag(sqrt(pmax(ev, 0)), p) %*% t(X) : 
>             non-conformable arrays
[...]

Hmmm ... using the same B and V as giben by Stuart Jordan, I get:

> mvrnorm(1,B,V)
 [1]  -179.8332342     0.9632282     2.5687489    -2.2337125    47.2717626
 [6] -3745.3844310     0.9632282     0.2839965    -0.1500585     0.5804460
[11]     5.1919420    -4.7381677    -0.2382119
> mvrnorm(2,B,V)
Error in mu + eS$vectors %*% diag(sqrt(pmax(ev, 0)), p) %*% t(X) : 
        non-conformable arrays

?????

Ted.

PS By the way, [near] singularity seems to have nothing to do
   with it here:
   If I brutally make V non-singular:

     diag(V) <- diag(V)+10000000

   it goes the same way.


--------------------------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding at nessie.mcc.ac.uk>
Fax-to-email: +44 (0)870 167 1972
Date: 02-Feb-04                                       Time: 22:17:13
------------------------------ XFMail ------------------------------




More information about the R-help mailing list