rbchan/unmarked

simulate method for unmarkedFitGDS fails when there are NAs in siteCovs

Closed this issue · 0 comments

When running this simulate method in parboot the design matrices are generated without cleaning up NAs. This can result in missing values for the lambda vector:

lambda <- exp(Xlam %*% lamPars + Xlam.offset)

Eventually these NAs reach the size argument of rmultinom which errors instead of returning another NA (unlike most random number functions in R?)

y.it <- as.integer(rmultinom(1, N, prob=cp.it))

Probably need to put a check in here and skip running rmultinom when lambda = NA and directly set the value of y to NA.