## 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

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 cameraSIF = 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 ^2sif.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: 590
Joined: Fri May 16, 2003 9:24 am
Location: Laurel, MD, USA

### Re: Two-Species SIF - Calculating SE

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     se1   99.999 99.9992   99.999 99.9993   99.999 99.9994   99.999 99.9995   99.999 99.9996   99.999 99.9997   99.999 99.999> dmfit1\$derived[[1]]\$phi      est    se1   1.384 0.0992   1.402 0.1343   1.354 0.0834   1.411 0.1565   1.439 0.2416   1.334 0.0987   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

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: 590
Joined: Fri May 16, 2003 9:24 am
Location: Laurel, MD, USA

Previous