I found that the rkdevine function, from the package kdevine, is returning constant zero-valued simulations when it shouldn’t be the case. The function is meant to simulate from a a kdevine object, which is vine-copula based density estimator
Example of the problem:
#1. Set the data
x <- c(0.5150864, 0.1661704, 0.5138176, 0.5044893, 0.4984769, 0.8359263, 0.4838860, 0.4799104, 0.4800063, 0.5012104)
y <- c(0.02299000, 0.03423000, 0.00649000, 0.01970000, 0.02184000, 0.01053000, 0.02399000, 0.02067000, 0.10918000, 0.04334681)
z <- c(0.13505051, 0.06968379, 0.06484263, 0.08655820, 0.07044886, 0.08455797, 0.06206888, 0.07187104, 0.93282970, 0.07841944)
#2. Create the copula density estimation
k.den <- kdevine(x = cbind(x, y, z), xmin = c(0.01, 0, 0.04), xmax = c(0.99, 2, 2), method = "TLL2nn")
#3. Generate simulations
rkdevine(1, k.den)
The output rkdevine(1, k.den) is c(0, 0, 0), which is obviously mistaken.
It tried looking at the function rkdevine but cannot find the mistake. Earlier versions of the package and/or R used to work.
Aguazz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
3