David L Miller
Distance
object
, distance
library(Distance)
df_hn <- ds(distdata, truncation=6000, adjustment = NULL)
summary(df_hn)
Summary for distance analysis
Number of observations : 132
Distance range : 0 - 6000
Model : Half-normal key function
AIC : 2252.06
Detection function parameters
Scale Coefficients:
estimate se
(Intercept) 7.900732 0.07884776
Estimate SE CV
Average p 0.5490484 0.03662569 0.06670757
N in covered region 240.4159539 21.32287580 0.08869160
plot(df_hn)
Here we'll look at:
Distance
will warn you about this:
** Warning: Problems with fitting model. Did not converge**
Error in detfct.fit.opt(ddfobj, optim.options, bounds, misc.options) :
No convergence.
This can be complicated, see ?"mrds-opt"
for info.
check.mono
can helpcheck.mono(df_hr$ddf)
[1] TRUE
ddf.gof(df_hn$ddf)
summary
and plot
(fitting issues?)ddf.gof
df_hn <- ds(distdata, truncation=6000, adjustment = NULL)
df_hn_cos <- ds(distdata, truncation=6000, adjustment = "cos")
df_hr <- ds(distdata, truncation=6000, key="hr", adjustment = NULL)
df_hr_cos <- ds(distdata, key="hr", truncation=6000, adjustment = "cos")
df_hn$ddf$criterion
[1] 2252.06
df_hn_cos$ddf$criterion
[1] 2247.69
## same model!
df_hr$ddf$criterion
[1] 2247.594
df_hr_cos$ddf$criterion
[1] 2247.594
Decompose \( \sigma=\exp \left( \beta_0 + \beta_1 z_1 + \ldots\right) \)
formula=...
to our ds()
call:df_hr_ss <- ds(distdata, truncation=6000,
key="hr", formula=~SeaState)
df_hr_ss_size <- ds(distdata, truncation=6000,
key="hr", formula=~SeaState+size)
summary(df_hr_ss)
Summary for distance analysis
Number of observations : 132
Distance range : 0 - 6000
Model : Hazard-rate key function
AIC : 2247.347
Detection function parameters
Scale Coefficients:
estimate se
(Intercept) 8.1019226 0.7906353
SeaState -0.4473291 0.2797965
Shape parameters:
estimate se
(Intercept) 0.07319982 0.2417426
Estimate SE CV
Average p 0.3583687 0.07308615 0.2039412
N in covered region 368.3357858 79.54571167 0.2159598
\[ \hat{p}(\mathbf{z}_i) = \int_0^w g(x; \boldsymbol{\hat{\theta}}, \mathbf{z}_i) dx \quad \text{for } i=1, \ldots, n \]
unique(predict(df_hr_ss$ddf)$fitted)
[1] 0.3360342 0.3876026 0.2895189 0.2480620 0.3985064 0.4439768 0.2723358
[8] 0.2559550 0.2808264 0.3459473 0.3263237 0.3663789 0.5684780 0.2114896
[15] 0.3560627 0.4677557 0.1795108 0.7000862
where \( s_i \) is group size, \( n \) is number of observations (groups)
Obtain overall CV by adding squared CVs:
(Running through this quickly, see bibliography for more details)
head(region.table)
Region.Label Area
1 StudyArea 5.285e+11
head(sample.table)
Sample.Label Effort Region.Label
1 en0439520040624 144044.67 StudyArea
2 en0439520040625 167646.84 StudyArea
3 en0439520040626 59997.33 StudyArea
4 en0439520040627 33821.89 StudyArea
5 en0439520040628 147414.92 StudyArea
6 en0439520040629 101107.83 StudyArea
head(obs.table)
object Sample.Label Region.Label
1 1 en0439520040628 StudyArea
2 2 en0439520040628 StudyArea
3 3 en0439520040628 StudyArea
4 4 en0439520040628 StudyArea
5 5 en0439520040629 StudyArea
6 6 en0439520040629 StudyArea
This generates a lot of output (here is a snippit):
dht(df_hr$ddf, region.table, sample.table, obs.table)
Summary for individuals
Summary statistics:
Region Area CoveredArea Effort n ER se.ER cv.ER mean.size
1 StudyArea 5.285e+11 113981689066 9498474 238.7 2.513035e-05 5.667492e-06 0.2255238 1.808333
se.mean
1 0.1020928
Abundance:
Label Estimate se cv lcl ucl df
1 Total 3053.558 943.7425 0.3090632 1682.187 5542.912 170.9157
More investigation in the practical exercises…
So
\[ \hat{N}= \frac{n}{\hat{p}} \frac{A}{a} = 3053.558 \]