NA in likelihood calculations

questions concerning anlysis/theory using program DENSITY and R package secr. Focus on spatially-explicit analysis.

Re: NA in likelihood calculations

Postby bedford » Fri Nov 02, 2018 9:21 am

Okay, done! Thanks very much.
Nicole
bedford
 
Posts: 4
Joined: Thu Oct 25, 2018 5:10 pm

Re: NA in likelihood calculations

Postby murray.efford » Fri Nov 02, 2018 8:17 pm

Thanks for sending the data.

One issue I should have guessed before: there are enough long moves (hist(unlist(moves(mouse17)))) that detectfn = 'HN' struggles. Switching to detectfn = 'EX' allows fitting to proceed (non-missing log likelihood).

However, fitting is still a rocky road, and by default yields no variance for sigma-hat. This can be repaired by running with the more refined numerical algorithm
Code: Select all
mask <- make.mask(traps(mouse17), buffer = 80, type = 'trapbuffer')
fit17a <- secr.fit(mouse17, model = list(D~1, g0~1, sigma~1), buffer = 80,
                  detectfn = 'EX', mask = mask)
## doesn't converge well...
## default mask spacing is wider than trap spacing - disconcerting and possibly problematic
## try a finer mask
mask5 <- make.mask(traps(mouse17), buffer = 80, type = 'trapbuffer', spacing = 5)
nrow(mask5)
## this will be slow...
fit17b <- secr.fit(mouse17, model = list(D~1, g0~1, sigma~1), buffer=80,
                   detectfn = 'EX', mask = mask5)
## no SE for sigma-hat, so recompute
fit17c <- secr.fit(mouse17, model = list(D~1, g0~1, sigma~1), buffer=80,
                   detectfn = 'EX', mask = mask5, start=fit17b, method = 'none')

predict(fit17a)
# link   estimate SE.estimate       lcl        ucl
# D       log  2.1939802 0.408944556 1.5273081 3.15165579
# g0    logit  0.0550488 0.007925989 0.0414255 0.07281199
# sigma   log 18.1718790         NaN       NaN        NaN
predict(fit17b)
# link   estimate SE.estimate        lcl        ucl
# D       log  2.4744063 0.430321629 1.76417096 3.47057428
# g0    logit  0.0584761 0.008517707 0.04385152 0.07758227
# sigma   log 18.3024897         NaN        NaN        NaN
predict(fit17c)
# link   estimate SE.estimate         lcl        ucl
# D       log  2.4744063 0.423730612  1.77320388  3.4528948
# g0    logit  0.0584761 0.001954107  0.05476171  0.0624258
# sigma   log 18.3024897 0.186117364 17.94132677 18.6709229


Also, the layout rings some alarm bells about the mask: the layout has 70 columns of traps in the east-west direction, and the default mask divides this plus 2 x buffer by 64, so the default mask has spacing (13.3 m) wider than the trap layout (10 m) and a large fraction of sigma-hat. SECR models are fairly robust to spatial discretization (https://www.otago.ac.nz/density/pdfs/secr-habitatmasks.pdf) but some caution is called for (I shifted to a 5-m mask spacing).

[Note sigma-hat and g0 should not be compared between HN and EX fits]
Murary
murray.efford
 
Posts: 537
Joined: Mon Sep 29, 2008 7:11 pm
Location: Dunedin, New Zealand

Previous

Return to analysis help

Who is online

Users browsing this forum: No registered users and 2 guests