Hi all,
This is my first attempt at using secr so apologies if my explanation is unclear.
I am using secr to try to estimate density of skink populations and my issue is regarding how to add daily temperature to my models as a session-specific time varying covariate.
I have 16 trapping grids (of 25 traps, at 2m spacing) spread between two cities that have been monitored daily for 7-10 day periods three times over the course of my study (Nov 17, Jan 18 and Nov 18). I'm treating populations as closed within each period and am only using captures of one species.
To analyse, my approach has been to model each trapping period separately including all sites together as 'sessions' using:
Nov17 <-
read.capthist("~/secr/Nov17.txt", "~/secr/trapfile.txt",
detector = "multi")
Jan18 <-
read.capthist("~/secr/Jan18.txt",
"~/secr/trapfile.txt",
detector = "multi")
Nov18 <-
read.capthist("~/secr/Nov18.txt",
"~/secr/trapfile.txt",
detector = "multi")
fit_Nov17<-secr.fit(Nov17,
start = list(D=1000, g0 = 0.01, sigma = 1), model = D ~session, buffer = 10,
detectfn = 'HN', trace = FALSE) ### not sure if all these arguments are
required
fit_Jan18<-secr.fit(Jan18, start =
list(D=1000, g0 = 0.01, sigma = 1), model = D ~session, buffer = 10, detectfn =
'HN', trace = FALSE)
fit_Nov18<-secr.fit(Nov18, start =
list(D=1000, g0 = 0.01, sigma = 1), model = D ~session, buffer = 10, detectfn =
'HN', trace = FALSE)
fit_Nov17<-summary(fit_Nov17)
fit_Jan18<-summary(fit_Jan18)
fit_Nov18<-summary(fit_Nov18)
I'm keen to use a model selection approach to see how daily temperature and behavioural responses to capture affect model fit. However, my current difficulty is how to include temperature as a covariate that varies by occasion. I understand this can be done using timecov() ....
## something like...
fit_Nov17<-secr.fit(Nov17, start = list(D=1000, g0 = 0.01, sigma = 1), model = list(D~session, g0~tcov), buffer = 10, detectfn = 'HN', trace = FALSE, timecov = c(21.2, 19.3, 20.0, 21.1, 20.9, 19.4, 20.7))
.... however, as the trapping grids ('sessions') are spread across two cities (and therefore were not in use simultaneously) I'd like the temperatures to be specific to the session as well as varying with time. Is this possible or would it be best to model the trapping periods of each city separately (this would greatly reduce my already small sample size)?
Any advice or assistance would be greatly appreciated. Please let me know if more detail is needed to understand the problem.
Many thanks
Chris
> sapply(ovenCH, ncol) 2005 2006 2007 2008 2009 9 10 10 10 10
# list of fake time covariates; session names not needed > dummycov <- list('2005' = c(13 + runif(9)*3, NA), # padded to length 10 + '2006' = 13+runif(10), + '2007' = 12+runif(10), + '2008' = 12+runif(10)*2, + '2009' = 11+runif(10)*3)
# review
sapply(dummycov, round,1) 2005 2006 2007 2008 2009 [1,] 14.2 13.3 13.0 13.2 12.5 [2,] 13.9 13.4 12.2 13.4 13.0 [3,] 14.4 13.0 12.9 12.7 13.8 [4,] 14.1 13.1 12.7 12.7 12.2 [5,] 15.9 13.8 12.9 12.9 11.7 [6,] 13.2 13.3 12.6 13.1 13.1 [7,] 15.6 13.9 12.5 12.9 12.3 [8,] 15.4 13.2 12.6 14.0 14.0 [9,] 16.0 13.2 12.2 12.9 11.5 [10,] NA 13.5 12.1 12.4 13.3
# fit a model
> secr.fit(ovenCH, timecov = dummycov, model = g0~tcov) Checking data Preparing detection design matrices Preparing density design matrix Finding initial parameter values... Initial values D = 1.37032, g0 = 0.02977, sigma = 62.87329 Maximizing likelihood... Eval Loglik D g0 g0.tcov sigma 1 -936.694 0.3150 -3.4842 0.0000 4.1411
etc.
Murray