Dear unmarked users and creators,
I am seeking some clarification on the use of function gdistsamp. My main question: Can gdistsamp handle data for multiple seasons and multiple visits per season?
The help documentation for gdistsamp clearly says "
this model isn't for multi-year data". But responses to questions about the use of gdistsamp on this forum have left me with questions. Andy and Richard definitely
have suggested that modeling multiple seasons with one visit per season is possible, but that directly estimating trend estimates is
not possible. In my case I have distance data from sites sampled twice in one year and twice in the next year (four visits total).
IF what I want to do is possible, what do I set numPrimary to when creating the unmarkedFrameGDS object?
I have read the help documentation or unmarkedFrameGDS (which is actually the help documentation for unmarkedMultFrame, I guess because the former is a superclass of the latter) and I find it somewhat inadequate to answer my question. The documentation seems to apply specifically to unmarkedMultFrame. For example, it says:
For a study with M sites, T years, and a maximum of J observations per site-year, the data are shaped as follows. y is an M by TJ matrix, with each row corresponding to a site. siteCovs is a data frame with M rows.
However for an unmarkedFrameGDS object each, y should be an M by TJB matrix, where B is the number of distance bins.
From what I can judge, numPrimary should be the number of years (seasons), in my case 2. However, no matter what I set numPrimary to, when I run summary(umf) it says Number of secondary survey periods: 1. I looked at the unmarkedMultFrame method definition for summary, which has this:
cat("Number of primary survey periods:", object@numPrimary, "\n")
cat("Number of secondary survey periods:", obsNum(object)/object@numPrimary, "\n")
and looking at the unmarkedFrame definition for obsNum I find this:
function (object) nrow(object@obsToY)
That's where I get lost, because I can't figure out how the obsToY slot is used to calculate the number of secondary survey periods for an unmarkedFrameGDS object.
I also get into some trouble when I try to add yearlySiteCovs. The documentation for unmarkedMultFrame says the following:
yearlySiteCovs is a data frame with MT rows which are in site-major, year-minor order. ... The number of years must be specified in numPrimary.
That clearly doesn't work when using unmarkedFrameGDS(), which contains the following:
if (ncol(yearlySiteCovs[[i]]) != numPrimary | nrow(yearlySiteCovs[[i]]) != nrow(y))
stop("At least one matrix in yearlySiteCovs has incorrect number of dimensions.")
If I give it a data frame with MT rows, then the second part of the condition fails, so I assumed that documentation applied to unmarkedMultFrame but not unmarkedFrameGDS. For unmarkedFrameGDS I need to provide a list of M by T data frames.
I take it that means that I can use covariates at the year/season level, but not covariates collected at the visit level (e.g. observer, date, time of day, weather) to model detection probability, correct?
If anybody has successfully used gdistsamp to model multi-year multi-visit data, I would really like to know how its going.
Thanks for your help,
Chris Merkord
Postdoctoral Research Associate
University of South Dakota