0

This is my goodness of fit test:

(fm <- distsamp(~1 ~ndvi_avg, keyfun="hazard", umf))

# Function returning three fit-statistics.

fitstats <- function(fm) {
  
  observed <- getY(fm@data)
  
  expected <- fitted(fm)
  
  resids <- residuals(fm)
  
  sse <- sum(resids^2)
  
  chisq <- sum((observed - expected)^2 / expected)
  
  freeTuke <- sum((sqrt(observed) - sqrt(expected))^2)
  
  out <- c(SSE=sse, Chisq=chisq, freemanTukey=freeTuke)
  
  return(out)
  
}

(pb <- parboot(fm, fitstats, nsim=100, report=1))

I can do up to nsim=99, and then I try nsim=100 which results in the following:

> (pb <- parboot(fm, fitstats, nsim=100, report=1))
t0 = 103.385 540.1714 70.38591 
Running in parallel on 3 cores. Bootstrapped statistics not reported.

I wonder if this is a bug in the unmarked package?

elielink
  • 1,174
  • 1
  • 10
  • 22
Emily
  • 3
  • 2

1 Answers1

0

Try parallel = FALSE inside parboot().

Documentation: https://www.rdocumentation.org/packages/unmarked/versions/1.1.0/topics/parboot

VitaminB16
  • 1,174
  • 1
  • 3
  • 17