Closed andrewraim closed 3 years ago
The other function that would be affected by this issue is vzicmp
. Here is a workaround version of that:
vzicmp_alt = function(lambda, nu, p)
{
ee = ecmp(lambda, nu)
vv = vcmp_alt(lambda, nu)
(1-p) * (p*ee^2 + vv)
}
This is corrected in the vignette
branch and should be included in the next release.
An issue was reported with the newly-exposed
vcmp
function in version v0.7.1 of COMPoissonReg.The
vcmp
results for the two given cases are -985.2381 and 912.5801, which are way off the empirical variances (and obviously a negative variance result isn't right). The underlying issue appears to be in the use of thegrad.fwd
function. It is not producing accurate second derivatives in these cases.Here is a workaround that uses the
numDeriv
package, until we can fix the underlying problem invcmp
.Here is a quick test of
vcmp_alt
on the inputs above.