R_SECR Within and Between Session Modelling

questions concerning anlysis/theory using program DENSITY and R package secr. Focus on spatially-explicit analysis.

R_SECR Within and Between Session Modelling

Postby bgerber » Fri Jul 01, 2011 6:55 pm

I am having difficulty in coming up with the syntax for constraining parameters (D,g0, sigma....) between sessions. I would gratefully appreciate it if someone could provide a few examples on what the syntax needs to be. My sessions are simply named, 1,2,3,4,5,6. How would I run secr.fit to constrain g0 and sigma for all sessions, but density varies for each session?

Thank You
Sincerely, Brian
bgerber
 
Posts: 24
Joined: Wed Dec 12, 2007 1:01 pm

Re: R_SECR Within and Between Session Modelling

Postby bgerber » Sat Jul 02, 2011 9:13 am

Sorry, let me clarify my question more exactly. I am interested in the syntax for constraining some but not all sessions for a given parameter.

For example, how do I change the model specification where Sessions 1-3 have D constrained to be equal and then Sessions 4-6 have their D constrained to be equal.

model <- secr.fit (capthist, model=list(D~1,g0~1,sigma~1), detectfn=0, CL=FALSE)

Sincerely, Brian
bgerber
 
Posts: 24
Joined: Wed Dec 12, 2007 1:01 pm

Re: R_SECR Within and Between Session Modelling

Postby howeer » Mon Jul 04, 2011 2:40 pm

I think you need to create a session covariate (see sessioncov argument of secr.fit) and assign the same value to all sessions for which you'd like to constrain density to be equal. Using letters rather than numbers for the different levels of this covariate may help R recognize it as a factor and not a continuous covariate.

For example, create the following dataframe, named sesscovs, in R:
sess sesscov1
1 a
2 a
3 a
4 b
5 b
6 b

then specify that D depends on that covariate, e.g.

model <- secr.fit(capthist, model=list(D~sesscov1, g0~1, sigma~1), detectfn=0, CL=FALSE, sessioncov = sesscovs)

This should give you 1 estimate of each of g0 and sigma, and 2 estimates of density, one for each level of sesscov1.

Good luck,
Eric
howeer
 
Posts: 39
Joined: Wed Jun 21, 2006 10:49 am

Re: R_SECR Within and Between Session Modelling

Postby murray.efford » Tue Jul 05, 2011 11:07 am

Brian

To see Eric's suggestion working, try this with the 5-session (year) ovenbird example dataset (using some defaults):

secr.fit(ovenCH, buffer = 300, model = D~ab, sessioncov = data.frame(ab = c('a','a','b','b','b')))

One density is estimated for the first two years and another for the last three. You could also use ab = factor(c(1,1,2,2,2)).

Murray
murray.efford
 
Posts: 686
Joined: Mon Sep 29, 2008 7:11 pm
Location: Dunedin, New Zealand


Return to analysis help

Who is online

Users browsing this forum: No registered users and 7 guests