Temporal covariates

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

Temporal covariates

Postby howeer » Mon Aug 09, 2010 4:03 pm

Hi,
I get the following error message when I try to fit a multisession model with a temporal covariate (jc) affecting sigma:

> gDT.sjc=secr.fit(seeh69, model=list(g0~1, sigma~jc), mask=masklist,CL=T,detectfn=1,timecov=timecovs,sessioncov=sesscovs,details=list(distribution='binomial'), stepmax=50)
Checking data
Preparing detection design matrices
Finding initial parameter values...
Initial values D = 0.00088, g0 = 0.36223, sigma = 1275.15136
Maximizing likelihood...
Eval Loglik g0 sigma sigma.jc z
1 -5543.359 -0.5657 7.1508 0.0000 1.6094
2 -5543.359 -0.5657 7.1508 0.0000 1.6094
3 -5543.359 -0.5657 7.1508 0.0000 1.6094
4 -5543.349 -0.5657 7.1508 0.0000 1.6094
5 -5543.213 -0.5657 7.1508 0.0000 1.6094
6 -5543.361 -0.5657 7.1508 0.0000 1.6094
beta vector : -0.5113226 7.658609 49.99597 1.233034
Error in f(x, ...) :
extreme beta in secr.loglikfn (try smaller stepmax in nlm Newton-Raphson?)

I had already defined stepmax = 50, and tried bumping it down to 10 with no change.
My "timecovs" dataframe looks like this:
> timecovs
occasion jc
1 1 66
2 2 78
3 3 90
4 4 100
5 5 100
6 6 100

The dataset includes sessions with 4, 5, and 6 occasions, and secr documentation specifies that the lenght of timecov should equal the number of occasions, however, I didn't have this problem when fitting similar models to similar data (multiple sessions with different numbers of occasions) using secr v 1.3.0.

Any insights appreciated.
Eric
howeer
 
Posts: 39
Joined: Wed Jun 21, 2006 10:49 am

Re: Temporal covariates

Postby murray.efford » Tue Aug 10, 2010 9:05 am

Eric
This is a curly one for which I don't have a direct answer. Obviously there is a numerical problem in maximisation of the likelihood. With Newton-Raphson in nlm() the large step taken after the first gradient evaluation can throw an error, as you found: get past that and you should be OK. I would (i) try a different method ('Nelder-Mead' is robust but slower), (ii) check other settings in the documentation for nlm() (you can pass them in the dots argument of secr.fit) or (iii) set the starting values rather than rely on the automatic values (remember the starting values are beta values on the link scale). I wonder also whether simply scaling the time covariates (e.g. dividing by 100: 0.66, 0.78 etc.) might help (secr does not scale covariates automatically). As far as I know timecov should work in 1.4 as it did in 1.3. I haven't thought about session-specific time covariates - I suppose the timecov argument should really be a list of dataframes...
Hope this helps.
Murray
murray.efford
 
Posts: 686
Joined: Mon Sep 29, 2008 7:11 pm
Location: Dunedin, New Zealand

Re: Temporal covariates

Postby howeer » Tue Aug 10, 2010 10:45 am

Hi Murray,
I tried the quickest fix first, and scaled the covariates by dividing by 100. This worked in the case of the simple g0~1, sigma~jc model :D
Thanks!
Eric
BTW, I can think of a few situations where it would be useful to be able to specify session-specific time covariates.
howeer
 
Posts: 39
Joined: Wed Jun 21, 2006 10:49 am


Return to analysis help

Who is online

Users browsing this forum: No registered users and 12 guests

cron