Page 1 of 1

circular.r in secr 2.3.1

PostPosted: Mon Jun 11, 2012 2:21 pm
by bdt
Using model results from a run in secr 2.3.1, I estimated a 95% home range radius for a half normal detection function as:
sqrt(-log(0.05)*2*sigma^2)= sqrt(-log(0.05)*2*11,999.24^2)=29,371.1
and then with circular.r as:
circular.r(p=0.95,detectfn=0,sigma=1.199924e+04)
[1] 29371.1. agreement.

I then attempted the same for an exponential detection function as:
-log(0.05)*sigma=-log(0.05)* 7.358096e+03=22,0428.86
and then with circular.r as:
circular.r(p=0.95,detectfn=2,sigma=7358.0963364 )
[1] 34905.81 disagreement.

I do not understand the reason for the discrepancy in the case of the exponential function.

The manual indicates that the probability for other than the half normal detection functions is computed numerically by integrating the radial distribution and cautions that numerical integration is not foolproof. Could that be the source of the discrepancy? Is there another problem?

Thank you,
Brian

Re: circular.r in secr 2.3.1

PostPosted: Mon Jun 11, 2012 5:31 pm
by murray.efford
You did well to find this function! We are looking for the radius r that includes 95% of the volume of the 2-D figure of rotation formed by the detection function. I'm not clear why your formula should work for the exponential case. I've checked with a hacked version of the code that the integration is working for the halfnormal case; the numerical integration is unlikely to be giving trouble with such reasonable parameter values.

If your two 'sigma' values represent different fits to actual data it may help to think of it this way: the exponential detection function has a longer tail than the halfnormal, so we expect the nominal home range radius to be larger in this case. Thus the value from 'circular.r' is more plausible than yours.

The code is fairly simple (although the detection functions themselves are out of sight) and it may be worth taking a look (type circular.r at the R prompt).

Murray

Re: circular.r in secr 2.3.1

PostPosted: Tue Jun 12, 2012 7:13 pm
by bdt
Murray,

Thank you. I did a bit more research and see that the proper analytical approach in the exponential case requires integrating the pdf for the wrapped (circular) exponential distribution... a good reason for the numerical solution.

Thanks again,
Brian