Two-Species SIF - Calculating SE

posts related to the RPresence library, which may not be of general interest to users of 'classic' PRESENCE.

Re: Two-Species SIF - Calculating SE

Postby jhines » Tue May 09, 2023 9:00 am

The species interaction factor (SIF) you're trying to compute is saved in the model output as fit$derived[[1]]$phi$est. The variance can be obtained as fit$derived[[1]]$phi$se^2. So, you code should be:

Code: Select all
psiBa <- as.vector(fit$real$psi$psiBa[,1])
psiBA <- as.vector(fit$real$psi$psiBA[,1])
psiA <- as.vector(fit$real$psi$psiA[,1])

#a vector containing SIF for each camera
SIF = fit$derived[[1]]$phi$est         # SIF = psiAB / (psiA*psiB) = psiA*psiBA / (psiA*(psiA*psiBA+(1-psiA)*psiBa) 
var.sif = fit$derived[[1]]$phi$se^2         # get variance = std.error ^2
sif.mean = mean(SIF)
sif.var = sum((SIF - meansif)^2) / (length(SIF)-1)
cat(sif.mean, sqrt(sif.var), sif.mean + c(-1.96, 0, 1.96)*sqrt(sif.var), '\n')


Note - you're missing parentheses around the denominator in the formula for SIF.

Note2 - See Darryl's previous post about using nu as the species interaction factor instead of phi.
jhines
 
Posts: 599
Joined: Fri May 16, 2003 9:24 am
Location: Laurel, MD, USA

Re: Two-Species SIF - Calculating SE

Postby Hsin Cheng » Tue May 09, 2023 10:05 am

Thank you for your fast reply!
I'm willing to try the nu SIF method, but I have some questions.

1. To make sure, the equation of nu is:
SIF = (psiBA/(1-psiBA) / (psiBa/(1-psiBa))

2. If I want to use nu as SIF, can I calculate the CI simply by changing the "phi" in the code you provided above to "nu"? Should I change the parameterization from PsiBA to nu? The output of these parameterization methods seems similar.

3. The values and SEs of nu and phi are much different. Not sure if it's normal.
Code: Select all
> dmfit1$derived[[1]]$nu
       est     se
1   99.999 99.999
2   99.999 99.999
3   99.999 99.999
4   99.999 99.999
5   99.999 99.999
6   99.999 99.999
7   99.999 99.999

> dmfit1$derived[[1]]$phi
      est    se
1   1.384 0.099
2   1.402 0.134
3   1.354 0.083
4   1.411 0.156
5   1.439 0.241
6   1.334 0.098
7   1.359 0.081

And this is the output of the code you provided. They both show co-occurrence patterns but with very different values.
Code: Select all
# nu SIF
> cat(sif.mean, sqrt(sif.var), sif.mean + c(-1.96, 0, 1.96)*sqrt(sif.var), '\n')
95.21921 14.818 66.17593 95.21921 124.2625

# Richmond et al. 2010 SIF
> cat(sif.mean, sqrt(sif.var), sif.mean + c(-1.96, 0, 1.96)*sqrt(sif.var), '\n')
1.361635 0.03326755 1.296431 1.361635 1.426839

4. Do the estimated SIF and CIs above need to be back-transformed? Like
True SIF = EXP(SIF untransformed)/(1+EXP(SIF untransformed))

5. I read some papers and found a factor called Rho. It's the detection version of nu SIF. The equation is:
rho = (rBA/(1-rBA))/(rBa/(1-rBa))
Also, I read Jim's post and found the factor Lam = rAB/(rA*rB). I guess that's the conditional version of Rho.
The question is: where can I find these factors in the model output?
Hsin Cheng
 
Posts: 7
Joined: Wed Apr 12, 2023 11:25 am

Re: Two-Species SIF - Calculating SE

Postby jhines » Tue May 09, 2023 11:38 am

The output for nu is not normal. If you email me (jhines@usgs.gov) the input file and R script, I will diagnose the problem.

The SIF does not need to be transformed. It is simply the ratio of two probabilities (phi) or log-odds (nu).

Just as the case where the two species can avoid each other (phi<1) or tend to occupy the same patches (phi>1), we can have the case where species are more easily detected together (rho>1) or less easily (rho<1). An example is the case where a sub-dominant species calls less often when a dominant species is calling, making the sub-dominant species less detectable. So, rho is associated with detection probabilities, not occupancy probabilities.
jhines
 
Posts: 599
Joined: Fri May 16, 2003 9:24 am
Location: Laurel, MD, USA

Previous

Return to RPresence

Who is online

Users browsing this forum: No registered users and 8 guests

cron