Skip to content

MCgof unable to handle cases when sites were not sampled on first occasion #8

@fbled

Description

@fbled

Hello,

I have been trying to use MCgof on a model fitted in a situation where some sites where not sampled on the first occasion, and this seems to cause some issues with mismatch dimensions in detectpar0().

In MCgof, call goes down MCgof > MCgof.secr > simfxiAC > detectpar0

In detectpar0(), I have tracked the issue down to the following section :

  arglist <- c(list(x = object$design0$PIA, drop = FALSE), 
    indlist)
  selected <- do.call("[", arglist)
  out <- as.data.frame(realparval0[selected, , drop = FALSE])
  dd <- lapply(dim(selected), function(x) 1:x)
  names(dd) <- c("session", "animal", "occasion", "trap", 
    "class")
  id <- do.call(expand.grid, dd)[, sapply(indlist, is.logical), 
    drop = F]
  cbind(out, id)

If a site i was not in use during the first session, object$design0$PIA[1,1,1,i,] is set to 0, and it causes this site to get dropped in out, leading to a mismatch between out and id. This is how far I was able to track the issue down.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions