You sure you are using the right user distance function? In the vignette, fn2 is used for landscape resistance models.

On Sep 11, 2018, at 10:28 AM, John <john....@maine.edu> wrote:
Clayton,
You sure you are using the right user distance function? In the vignette, fn2 is used for landscape resistance models.
--
You received this message because you are subscribed to the Google Groups "secr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to secrgroup+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Interesting stuff here.I'm curious (and will read up about) the rationale behind fixing sigma, and whether there is a link function for the noneuc model? My understanding of the cost distance functions in R, which i assume are being used here (?) is that there is a d_cost = d*cost calculation, and having a cost surface the goes negative can cause problems depending on the link function.Will be keeping an eye on this thread - lots to still learn about these models!Chris
On Thu, Sep 13, 2018, 23:08 Clayton Lamb <ctl...@ualberta.ca> wrote:
Just an update: John and I had a productive discussion in a side thread and I think we found the issue to my problem, which was 0’s in my variance covariance matrix and SE’s for the noneuc parameter.The issue was related to fixing sigma at 1, which was perhaps too small for grizzly bears.. So I set it to an average sigma value for the species of 6000 and the models began to fit much better.The working model looks like this:csecr.hii <- secr.fit(capthist = grizzCH.d, mask = GBmask.d,detectfn = "HHN",
details = list(userdist = fn3), model = list(D ~ 1, noneuc ~ hii, lambda0~bk + Trap_Type),
start=csecr.null, fixed = list(sigma = 6000))The final piece is interpreting what the results from the model mean. The noneuc.hii parameter (human influence index) had a negative beta value (see plot). John and I discussed that this should mean that sigma is actually larger under high human influence, i.e., a large noneuc makes things effectively closer together, shrinks the space, therefore this means in reality that sigma is larger and the animals are moving more/farther in areas of high human influence?Hopefully this 1) can help someone else with these models, and 2) can stimulate discussion on how to interpret…Cheers,Clayton
On Sep 11, 2018, at 10:28 AM, John <john....@maine.edu> wrote:
Clayton,
You sure you are using the right user distance function? In the vignette, fn2 is used for landscape resistance models.
--
You received this message because you are subscribed to the Google Groups "secr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to secrgroup+unsubscribe@googlegroups.com.
--
Clayton Lamb, PhD Candidate
South Rockies Grizzly Bear Project
S.Boutin and S.Nielsen Labs
Biological Sciences, University of Alberta
e: ctl...@ualberta.ca
p: 778-215-0334
t: @ClaytonTLamb
w: www.lamb-eco-research.ca
--
You received this message because you are subscribed to the Google Groups "secr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to secrgroup+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<Screen Shot 2018-09-13 at 8.38.20 PM.png>
Hi John,
Thanks. Indeed, all the applications we use and the way our fitting function is set up is to drop the intercept, although recently we have considered exploring ways of/reasons to include the intercept – like those Murray has implemented (by we, I mean the Royle et al scr-connectivity paper and the Sutherland et al non-euc paper).
So, if I understand you correctly, fitting the ~X-1 model means you don’t have to assume a sigma value like Clay did? Seems like a better solution.
Regarding the cost function, and given it is the same formulation as I am familiar with (thanks for saving me the reading J), here is some behavior I found when standardizing covariate cost surfaces (this is just an fyi I found interesting, and potentially probalematic):
Basically, if d_cost = f(d_euc * cost), consider the example where the resistance parameter is positive, i.e., cost function should evaluate to > 1 and d_cost should be greater than d_euc. Good to think of just a single move from one pixel to a neighbor here, but it scales to the path. This script shows that constraint isn’t respected when the covariate is negative to positive as is the case with scaling.
I might be wrong here, so happy to be corrected!
a2 <- 0.5 #positive cost
cov <- seq(0,3,length=20) #some values of (c1-c2)/2 covariate values
covS <- scale(cov) #scaled
#evaluate the toy cost function
cost1 <- exp(a2 * cov)
cost2 <- exp(a2 * covS)
#plot it
par(mfrow=c(1,2))
plot(cost1 ~ cov,ylim=c(0,5)); abline(h=1)
plot(cost2 ~ cov,ylim=c(0,5)); abline(h=1)

From: John Clare <john....@maine.edu>
Sent: Friday, September 14, 2018 10:08 AM
To: Chris Sutherland <chris...@gmail.com>
Cc: Clayton Lamb <ctl...@ualberta.ca>; secr <secr...@googlegroups.com>
Subject: Re: Connectivity models: Continuously varying σ using gdistance
Murray can certainly answer more thoroughly or correct me, but I think the parameters associated with noneuc are fit using a log-link (with an intercept by default). The userdistance function and calls to noneuc seem to do a lot of things, but in the context of landscape resistance, if a1 = 1/(2 * sigma^2), log(cost) = a2 + a3 (z(x)+z(x'))/2 with one covariate. A call to noneuc~1 (without fixing sigma) introduces what looks like nonidentifiability of sigma and noneuc, or nonidentifiability of a1 and a2 above. Things either move farther, or spaces are closer together—many possible combinations are (equally) likely. Fitting a model with noneuc ~ covariate retains an intercept for noneuc, so same issue. So it seems like either one must be fixed (distance or a2 is known, and sigma is uncertain, or sigma is 'known' but a2 is uncertain) or the intercept must be specified as nonexistent within the model call (e.g., noneuc~covariate-1), in which case log(cost) = a2 (z(x)+z(x'))/2. This is how it's described in the 2013 paper. noneuc~covariate-1 probably would have been a much quicker solution!
On Sep 14, 2018, at 12:19 AM, Chris Sutherland <chris...@gmail.com> wrote:
Interesting stuff here.
I'm curious (and will read up about) the rationale behind fixing sigma, and whether there is a link function for the noneuc model? My understanding of the cost distance functions in R, which i assume are being used here (?) is that there is a d_cost = d*cost calculation, and having a cost surface the goes negative can cause problems depending on the link function.
Will be keeping an eye on this thread - lots to still learn about these models!
Chris
On Thu, Sep 13, 2018, 23:08 Clayton Lamb <ctl...@ualberta.ca> wrote:
Just an update: John and I had a productive discussion in a side thread and I think we found the issue to my problem, which was 0’s in my variance covariance matrix and SE’s for the noneuc parameter.
The issue was related to fixing sigma at 1, which was perhaps too small for grizzly bears.. So I set it to an average sigma value for the species of 6000 and the models began to fit much better.
The working model looks like this:
csecr.hii <- secr.fit(capthist = grizzCH.d, mask = GBmask.d,detectfn = "HHN",
details = list(userdist = fn3), model = list(D ~ 1, noneuc ~ hii, lambda0~bk + Trap_Type),
start=csecr.null, fixed = list(sigma = 6000))
The final piece is interpreting what the results from the model mean. The noneuc.hii parameter (human influence index) had a negative beta value (see plot). John and I discussed that this should mean that sigma is actually larger under high human influence, i.e., a large noneuc makes things effectively closer together, shrinks the space, therefore this means in reality that sigma is larger and the animals are moving more/farther in areas of high human influence?
Hopefully this 1) can help someone else with these models, and 2) can stimulate discussion on how to interpret…
Cheers,
Clayton
On Sep 11, 2018, at 10:28 AM, John <john....@maine.edu> wrote:
Clayton,
You sure you are using the right user distance function? In the vignette, fn2 is used for landscape resistance models.
--
You received this message because you are subscribed to the Google Groups "secr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to secrgroup+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Clayton Lamb, PhD Candidate
South Rockies Grizzly Bear Project
S.Boutin and S.Nielsen Labs
Biological Sciences, University of Alberta
e: ctl...@ualberta.ca
p: 778-215-0334
t: @ClaytonTLamb
w: www.lamb-eco-research.ca
--
You received this message because you are subscribed to the Google Groups "secr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to secrgroup+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi John,
Thanks. Indeed, all the applications we use and the way our fitting function is set up is to drop the intercept, although recently we have considered exploring ways of/reasons to include the intercept – like those Murray has implemented (by we, I mean the Royle et al scr-connectivity paper and the Sutherland et al non-euc paper).
So, if I understand you correctly, fitting the ~X-1 model means you don’t have to assume a sigma value like Clay did? Seems like a better solution.
Regarding the cost function, and given it is the same formulation as I am familiar with (thanks for saving me the reading J), here is some behavior I found when standardizing covariate cost surfaces (this is just an fyi I found interesting, and potentially probalematic):
Basically, if d_cost = f(d_euc * cost), consider the example where the resistance parameter is positive, i.e., cost function should evaluate to > 1 and d_cost should be greater than d_euc. Good to think of just a single move from one pixel to a neighbor here, but it scales to the path. This script shows that constraint isn’t respected when the covariate is negative to positive as is the case with scaling.
I might be wrong here, so happy to be corrected!
a2 <- 0.5 #positive cost
cov <- seq(0,3,length=20) #some values of (c1-c2)/2 covariate values
covS <- scale(cov) #scaled
#evaluate the toy cost function
cost1 <- exp(a2 * cov)
cost2 <- exp(a2 * covS)
#plot it
par(mfrow=c(1,2))
plot(cost1 ~ cov,ylim=c(0,5)); abline(h=1)
plot(cost2 ~ cov,ylim=c(0,5)); abline(h=1)
<image002.png>
From: John Clare <john....@maine.edu>
Sent: Friday, September 14, 2018 10:08 AM
To: Chris Sutherland <chris...@gmail.com>
Cc: Clayton Lamb <ctl...@ualberta.ca>; secr <secr...@googlegroups.com>
Subject: Re: Connectivity models: Continuously varying σ using gdistance
Murray can certainly answer more thoroughly or correct me, but I think the parameters associated with noneuc are fit using a log-link (with an intercept by default). The userdistance function and calls to noneuc seem to do a lot of things, but in the context of landscape resistance, if a1 = 1/(2 * sigma^2), log(cost) = a2 + a3 (z(x)+z(x'))/2 with one covariate. A call to noneuc~1 (without fixing sigma) introduces what looks like nonidentifiability of sigma and noneuc, or nonidentifiability of a1 and a2 above. Things either move farther, or spaces are closer together—many possible combinations are (equally) likely. Fitting a model with noneuc ~ covariate retains an intercept for noneuc, so same issue. So it seems like either one must be fixed (distance or a2 is known, and sigma is uncertain, or sigma is 'known' but a2 is uncertain) or the intercept must be specified as nonexistent within the model call (e.g., noneuc~covariate-1), in which case log(cost) = a2 (z(x)+z(x'))/2. This is how it's described in the 2013 paper. noneuc~covariate-1 probably would have been a much quicker solution!
On Sep 14, 2018, at 12:19 AM, Chris Sutherland <chris...@gmail.com> wrote:
Interesting stuff here.
I'm curious (and will read up about) the rationale behind fixing sigma, and whether there is a link function for the noneuc model? My understanding of the cost distance functions in R, which i assume are being used here (?) is that there is a d_cost = d*cost calculation, and having a cost surface the goes negative can cause problems depending on the link function.
Will be keeping an eye on this thread - lots to still learn about these models!
Chris
On Thu, Sep 13, 2018, 23:08 Clayton Lamb <ctl...@ualberta.ca> wrote:
Just an update: John and I had a productive discussion in a side thread and I think we found the issue to my problem, which was 0’s in my variance covariance matrix and SE’s for the noneuc parameter.
The issue was related to fixing sigma at 1, which was perhaps too small for grizzly bears.. So I set it to an average sigma value for the species of 6000 and the models began to fit much better.
The working model looks like this:
csecr.hii <- secr.fit(capthist = grizzCH.d, mask = GBmask.d,detectfn = "HHN",
details = list(userdist = fn3), model = list(D ~ 1, noneuc ~ hii, lambda0~bk + Trap_Type),
start=csecr.null, fixed = list(sigma = 6000))
The final piece is interpreting what the results from the model mean. The noneuc.hii parameter (human influence index) had a negative beta value (see plot). John and I discussed that this should mean that sigma is actually larger under high human influence, i.e., a large noneuc makes things effectively closer together, shrinks the space, therefore this means in reality that sigma is larger and the animals are moving more/farther in areas of high human influence?
Hopefully this 1) can help someone else with these models, and 2) can stimulate discussion on how to interpret…
Cheers,
Clayton
<~WRD000.jpg>
On Sep 11, 2018, at 10:28 AM, John <john....@maine.edu> wrote:
Clayton,
You sure you are using the right user distance function? In the vignette, fn2 is used for landscape resistance models.
--
You received this message because you are subscribed to the Google Groups "secr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to secrgroup+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Clayton Lamb, PhD Candidate
South Rockies Grizzly Bear Project
S.Boutin and S.Nielsen Labs
Biological Sciences, University of Alberta
e: ctl...@ualberta.ca
p: 778-215-0334
t: @ClaytonTLamb
w: www.lamb-eco-research.ca
--
You received this message because you are subscribed to the Google Groups "secr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to secrgroup+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<~WRD000.jpg>
To unsubscribe from this group and stop receiving emails from it, send an email to secrgroup+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Clayton Lamb, PhD Candidate
South Rockies Grizzly Bear Project
S.Boutin and S.Nielsen Labs
Biological Sciences, University of Alberta
e: ctl...@ualberta.ca
p: 778-215-0334
t: @ClaytonTLamb
w: www.lamb-eco-research.ca
--
You received this message because you are subscribed to the Google Groups "secr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to secrgroup+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Thanks Murray!!
<~WRD000.jpg>
To unsubscribe from this group and stop receiving emails from it, send an email to secrgroup+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Clayton Lamb, PhD Candidate
South Rockies Grizzly Bear Project
S.Boutin and S.Nielsen Labs
Biological Sciences, University of Alberta
e: ctl...@ualberta.ca
p: 778-215-0334
t: @ClaytonTLamb
w: www.lamb-eco-research.ca
--
You received this message because you are subscribed to the Google Groups "secr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to secrgroup+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<Screen Shot 2018-09-13 at 8.38.20 PM.png>
--
You received this message because you are subscribed to the Google Groups "secr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to secrgroup+...@googlegroups.com.