[R] Copula package - normalCopula() param order

Dominique Katshunga dominique.katshunga at uct.ac.za
Tue Jun 23 14:07:11 CEST 2015


Dear all,
In an attempt to generate a sample of observations from a four dimensional copula from the package Copula, I got the following warning message and all the observations are NA's:
Warning messages:
1: In rmvnorm(n, sigma = getSigma(copula)) :
  sigma is numerically not positive definite
2: In sqrt(ev$values) : NaNs produced

I used the following lines (I want all the variables to be negatively correlated):

Ncop=normalCopula(c(-0.95,-0.95,-0.95,-0.95,-0.95,-0.95),dim=4,dispstr="un")
mv_4dim=mvdc(Ncop,c("norm","norm","norm","norm"),list(list(mean=0,sd=2),list(mean=2.1,sd=1.5),list(mean=5,sd=2),list(mean=4.5,sd=0.5)))
sample_4dim=rMvdc(1000,mv_4dim)

What am doing wrong ?

Dominique Katshunga
==============
Lecturer in Statistical Sciences Department
University of Cape Town
Tel. 021 6504669
Fax. 021 6504773
email: dominique.katshunga at uct.ac.za<mailto:dominique.katshunga at uct.ac.za>

________________________________
UNIVERSITY OF CAPE TOWN

This e-mail is subject to the UCT ICT policies and e-mai...{{dropped:12}}



More information about the R-help mailing list