Goodnes of fit (GOF) for Integrated Distance Model (IDS)

19 views
Skip to first unread message

Juan Gallego Zamorano

unread,
Feb 3, 2026, 12:27:42 PM (2 days ago) Feb 3
to unmarked
Hi all,

I'm fitting an integrated distance model with distance point counts and normal point counts without distance information using the IDS() function. Now I would like to assess the GOF of the model. However, when I tried to adapt the function and use parboot(), I get the below error. Anyone could help to adapt properly the function to be used with parboot()?
Error: assignment of an object of class “list” is not valid for @‘y’ in an object of class “unmarkedFrameDS”; is(value, "matrix") is not TRUE

My code is:
modIDS <- IDS(
  lambdaformula = fPC1,
  # detformulaPC = ~1,
  dataDS = umfDS,
  dataPC = umfPC,
  availformula = ~1,
  durationDS = umfDS@siteCovs$dur_min,
  durationPC = umfPC@obsCovs$dur_min,
  maxDistPC = 0.5,
  keyfun = "exp",
  unitsOut = "kmsq"
)

fitstatsIDS <- function(modIDS) {
  observedDS <- getY(fm@data)
  expectedDS <- fitted(modIDS)$ds
  residsDS <- residuals(modIDS)$ds
  sseDS <- sum(residsDS^2, na.rm = TRUE)
  chisqDS <- sum((observedDS - expectedDS)^2 / expectedDS, na.rm = TRUE)
  freeTukeDS <- sum((sqrt(observedDS) - sqrt(expectedDS))^2, na.rm = TRUE)

  observedPC <- getY(fm@dataPC)
  expectedPC <- fitted(modIDS)$pc
  residsPC <- residuals(modIDS)$pc
  ssePC <- sum(residsPC^2, na.rm = TRUE)
  chisqPC <- sum((observedPC - expectedPC)^2 / expectedPC, na.rm = TRUE)
  freeTukePC <- sum((sqrt(observedPC) - sqrt(expectedPC))^2, na.rm = TRUE)

  out <- c(
    SSE_DS = sseDS,
    Chisq_DS = chisqDS,
    freemanTukey_DS = freeTukeDS,
    SSE_PC = ssePC,
    Chisq_PC = chisqPC,
    freemanTukey_PC = freeTukePC
  )
  return(out)
}

(pbDS <- parboot(modIDS, fitstatsIDS, nsim = 10))

Best regards,

Juan

Ken Kellner

unread,
Feb 3, 2026, 12:34:19 PM (2 days ago) Feb 3
to unmarked
Hi Juan,

Unfortunately parboot does not currently work with IDS models.

There used to be partial support (in an older version from a couple years ago) but I was not confident it was working correctly so I removed it. At some point I will spend the time to get it working again, but I don't have a timeline on that.

Ken

Juan Gallego Zamorano

unread,
Feb 3, 2026, 2:05:25 PM (2 days ago) Feb 3
to unma...@googlegroups.com
Hi Ken,

Thanks for your response! Totally understandable…do you have suggestions for making any GOF for such models?

Best,

Juan

Juan Gallego-Zamorano




--
*** Three hierarchical modeling email lists ***
(1) unmarked (this list): for questions specific to the R package unmarked
(2) SCR: for design and Bayesian or non-bayesian analysis of spatial capture-recapture
(3) HMecology: for everything else, especially material covered in the books by Royle & Dorazio (2008), Kéry & Schaub (2012), Kéry & Royle (2016, 2021) and Schaub & Kéry (2022)
---
You received this message because you are subscribed to the Google Groups "unmarked" group.
To unsubscribe from this group and stop receiving emails from it, send an email to unmarked+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/unmarked/dbd6cafc-16f0-4dea-ab10-d714cb11cb34n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages