gdistsamp for multi-year multi-visit data?

776 views
Skip to first unread message

Chris Merkord

unread,
Jul 25, 2013, 10:13:04 PM7/25/13
to unma...@googlegroups.com
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

Richard Chandler

unread,
Jul 28, 2013, 8:06:07 AM7/28/13
to Unmarked package
Hi Chris,

gdistsamp can't handle multiple visits and multiple seasons of data. You could use it for single visit, multi-year data, in which case lambda would be the expected super-population size, and phi would be the proportion available during each season. i.e. E(N_t) = M*phi_t. 

I need to improve the documentation.

Richard


--
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.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Chris Merkord

unread,
Aug 2, 2013, 2:48:09 PM8/2/13
to unma...@googlegroups.com
Thanks for the clarifications.

Some questions:

1. In the case of a multi-year, single-visit-per-year scenario, would you just need to add a Year covariate to phi?
2. If so, would you just need to multiply phi by lambda to get the state variable density/abundance during each year?  I guess that would necessitate using the delta function to calculate standard errors.
3. Do you see any reason not to treat my 2 visits per year / 2 years sample design AS IF it were four different years?  I.e. allow phi=availability to change between all my study periods?  This almost seems more realistic than assuming constant density within a year.

Any of you who have done a multi-year analysis with gdistsamp I would love to hear how it has worked out.  Any other tips in such a situation?

Many thanks for the help.

Chris Merkord

Richard Chandler

unread,
Aug 6, 2013, 2:12:49 PM8/6/13
to Unmarked package
Hi Chris, 

See my replies below


On Fri, Aug 2, 2013 at 2:48 PM, Chris Merkord <ch...@merkord.com> wrote:
Thanks for the clarifications.

Some questions:

1. In the case of a multi-year, single-visit-per-year scenario, would you just need to add a Year covariate to phi?

You could model phi as year-specific, yes. phi in this case would be the proportion of the superpopulation available for sampling in year t.
 
2. If so, would you just need to multiply phi by lambda to get the state variable density/abundance during each year?  I guess that would necessitate using the delta function to calculate standard errors.

Correct. You could also get standard errors using the bootstrap.
 
3. Do you see any reason not to treat my 2 visits per year / 2 years sample design AS IF it were four different years?  I.e. allow phi=availability to change between all my study periods?  This almost seems more realistic than assuming constant density within a year.

Seems reasonable if you are estimating 8 unique phis, however, this might not adequately account for temporal correlation in abundance. Hard to say. The interpretation of phi is always going to be very context-dependent. 
 

--
Message has been deleted

bwil...@gmail.com

unread,
Jan 21, 2021, 3:51:07 PM1/21/21
to unmarked
Richard, 

Is gdistsamp still unable to handle multiple visits and multiple seasons of data? Sorry to use an old thread, but I through this would be simpler than starting a new one on the same topic.

Thanks for all your help and work!

Sincerely,
Ben Wilson

Richard Chandler

unread,
Jan 21, 2021, 5:07:26 PM1/21/21
to unma...@googlegroups.com
Hi Ben,

The gdistsamp​ function hasn't changed substantially since the last post in this thread, so I don't think it will do what you want. The changelog is here:


However, Ken recently added distsampOpen​ which might be better suited to your data. I haven't played around with it, but it should allow you to specify different transition rates between abundance within vs among years. 

Richard 

From: unma...@googlegroups.com <unma...@googlegroups.com> on behalf of bwil...@gmail.com <bwil...@gmail.com>
Sent: Thursday, January 21, 2021 3:51 PM
To: unmarked <unma...@googlegroups.com>
Subject: Re: [unmarked] gdistsamp for multi-year multi-visit data?
 
[EXTERNAL SENDER - PROCEED CAUTIOUSLY]

Ken Kellner

unread,
Jan 21, 2021, 6:30:20 PM1/21/21
to unmarked
To expand on what Richard said, gdistsamp handles multiple visits to a site/transect within a single season (to allow estimation of availability). distsampOpen handles multiple seasons of data from a site/transect (to allow estimation of transition rates). Right now there is no explicit way in unmarked to handle multiple seasons of data for a site/transect, when you also have multiple visits within each season (i.e., you can't estimate both availability and transition parameters in the same model).
Ken

Ben Wilson

unread,
Jan 21, 2021, 6:36:20 PM1/21/21
to unma...@googlegroups.com
Thank you both for the update and information. It is very helpful.

You received this message because you are subscribed to a topic in the Google Groups "unmarked" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/unmarked/VWJfixK6Z2k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to unmarked+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/unmarked/a81f8c34-c68e-408c-89d0-3c346aeead92n%40googlegroups.com.

Richard Chandler

unread,
Jan 21, 2021, 7:38:36 PM1/21/21
to unma...@googlegroups.com
Ken is right that you can't estimate availability and transition parameters in the same model in unmarked. However, if you don't care about availability per se, and you just want to model temporal dynamics at each site, you could treat each survey occasion as a primary period and then fit the distsampOpen​ model, which is an extension of the Dail-Madsen (Biometrics, 2011) model.  You would need to introduce a 'yearlySiteCov' to describe the time interval between surveys. This could be a continuous variable (eg, the number of days between surveys) or a factor, perhaps with two levels: 'within-year' and 'among-year. If abundance doesn't change much within seasons, you will get estimates of apparent survival that are close to one and recruitment estimates close to zero. Or you could use one of the other parameterizations for the temporal dynamics, but the idea is the same (N should change less within seasons than among seasons). An alternative would be to use the primaryPeriod​ argument when you create the unmarkedFrame​DSO object. This lets you account for the time interval between surveys using the method described in the Biometrics paper. 

Richard

From: unma...@googlegroups.com <unma...@googlegroups.com> on behalf of Ben Wilson <bwil...@gmail.com>
Sent: Thursday, January 21, 2021 6:36 PM
To: unma...@googlegroups.com <unma...@googlegroups.com>

bwil...@gmail.com

unread,
Jan 22, 2021, 11:35:19 AM1/22/21
to unmarked
Thanks this is helpful.

One more question. Would it be appropriate to use an offset(log(number of visits)) in the gdistsamp model to account for the multiple visits in multi-visit multi-year data? This approach was used in Dinkins et al. 2016 "We adjusted ‘gdistsamp’ parameter estimates for survey effort (difference in the number of visits per point count location) by incorporating the number of visits per point count location as an offset, which is similar to the procedure used in Program DISTANCE". The link to the paper is below.


Thanks again for the help, my advisor and I just want to make sure that we are using the program correctly.

Ben Wilson 

Reply all
Reply to author
Forward
0 new messages