Presence models not completing

announcements (new versions, changes, bugs, installation problems...) related to program PRESENCE

Presence models not completing

Postby bkhobart » Tue Oct 15, 2019 11:45 am

Hi Phidot(Presence) community,

I'm trying to run multiseason, multistate occupancy models with Presence v2.12.34 and am encountering an issue: even a relatively basic model will not complete. I'm using the "psi(from,to), p(o,t)" parameterization, with 4 states, 72 sites, 25 primary sampling periods, 10 sampling periods per primary period. Based on the Presence command window, it looks like the model is running, but the dialogue box to save results never appears. I've copied the last few lines from the command window below. Any insights would be appreciated!

Best, Brendan

computing row 21/21...
100% done
invert matrix...
done
CPU time to compute varcov matrix: 1.3 minutes
bkhobart
 
Posts: 14
Joined: Mon Oct 30, 2017 12:33 pm

Re: Presence models not completing

Postby darryl » Tue Oct 15, 2019 2:59 pm

Hi Brendan,
Sometimes the message box saying that PRESENCE has finished comes up behind other windows (particularly if you've been using other software while the model was being fit), have you checked for that? It's should appear in the list of PRESENCE-related group of windows once the model is fit if you click on the group in the toolbar.
Cheers
Darryl
darryl
 
Posts: 495
Joined: Thu Jun 12, 2003 3:04 pm
Location: Dunedin, New Zealand

Re: Presence models not completing

Postby bkhobart » Tue Oct 15, 2019 3:04 pm

Hey Darryl, though I wish it was that simple, alas the window wasn't hiding anywhere (though that has got me in the past). It seemed like the model really just got stuck -- I left it running for about an hour before aborting Presence.

As a note, when I replaced all the 2's and 3's in my detection history with 1's and ran a simple (single state) multiseason model, it ran just fine. Not certain if that helps shed any light on the situation.

All the best, Brendan
bkhobart
 
Posts: 14
Joined: Mon Oct 30, 2017 12:33 pm

Re: Presence models not completing

Postby darryl » Tue Oct 15, 2019 3:08 pm

Always start with the simple options. ;-)

What happens if you just replace your 3's with 2's (or 1's)? Originally the multi-state models were for only 2 occupancy states, but Jim Hines may have generalised the code.
darryl
 
Posts: 495
Joined: Thu Jun 12, 2003 3:04 pm
Location: Dunedin, New Zealand

Re: Presence models not completing

Postby jhines » Tue Oct 15, 2019 5:06 pm

Hi Brendan,

Sorry for the trouble. Would you mind sending me your data? It's much easier to diagnose if I have a copy of it.

Thanks,

Jim
jhines
 
Posts: 599
Joined: Fri May 16, 2003 9:24 am
Location: Laurel, MD, USA

Re: Presence models not completing

Postby bkhobart » Tue Oct 15, 2019 6:20 pm

Good question, Darryl. I'll have to try that and see what happens. I do believe that Presence is equipped to handle 4 states, based on the the parameter options in the design matrices (e.g., has parameters for the detection of states 1, 2, and 3).

Thanks for your help, Jim. I've sent my DH file to your USGS address. Please note that the top row contains the values 1-250, but really the data are for 25 primary seasons with 10 samples/season.

I'd also note that last week I was trying to run these models with an old version (v11.something) and while the models were completing, the estimates were nonsensical. At that point I downloaded the new version and tried running them again.

Really appreciate any insights!

Best, Brendan
bkhobart
 
Posts: 14
Joined: Mon Oct 30, 2017 12:33 pm

Re: Presence models not completing

Postby jhines » Wed Oct 16, 2019 8:28 am

Hi Brendan,

Thanks for sending me your data. With 4 states and 250 surveys, 10 surveys per season, you have 4x4x25=400 occupancy/transition parameters and 4x4x250=4000 detection parameters. With the default model (no changes to design matrices - all parameters constant over surveys), there are 21 parameters and Presence finds the max-likelihood fairly quickly. However the computation of the var-cov matrix of the real parameters will take quite a bit of time since there are 4400 parameters. If you're at the stage of just searching for the "best" model, you can check the option in the Presence run dialog window to "Dont compute V-C matrix". Once you've decided which model(s) you want real estimates for, uncheck the box and wait. I don't know how long it will take.

Unless you need that level of detail, you might be better off combining surveys within seasons to reduce the number of possible parameters.

Jim
jhines
 
Posts: 599
Joined: Fri May 16, 2003 9:24 am
Location: Laurel, MD, USA

Re: Presence models not completing

Postby bkhobart » Thu Oct 17, 2019 10:49 am

Many thanks for the insights Jim. I should have considered telling Presence not to compute the VC matrix - thanks for pointing it out!

I've done as you suggested and run the default model, which does indeed complete. As for cutting down on the number of surveys per season: I worry that for my ultimate goal (see below), reducing the number of surveys may lead to the model not converging.

My goal: to obtain site-specific estimates of the probability of each state (averaged over all 25 seasons). I've attempted to follow the design that Gavin used (and you helped tweak) in this thread http://www.phidot.org/forum/viewtopic.php?f=11&t=2007&p=12061#p12061. To that end, I have parameterized a model (i.e., design matrix in Excel) with a site-level factor (unique intercept for each site using a full-identity site covariate table). All "real" parms (i.e., "psi[from,to]") that share a "to" state would get a set of site parms (i.e., C1-C72 for all psi[m,1]). This results in 72*3=216 columns in the occupancy design matrix. I let this model run (with "don't compute VC matrix" checked) for a couple hours yesterday. It did not complete within that time (and I had to cancel the run to pack up for the day).

Given how computationally intensive it is, I'm curious whether you think this model has any chance of running on a standard PC. If not, do I have any options short of hard coding the analysis and running on some sort of HTC?

Edit: I'd also note that for my desired analysis, I'd need Presence to compute the VC matrix, adding to the challenge.

Many thanks as always Jim!

Best, Brendan
bkhobart
 
Posts: 14
Joined: Mon Oct 30, 2017 12:33 pm

Re: Presence models not completing

Postby cooch » Thu Oct 17, 2019 11:47 am

Not sure if this is an option in PRESENCE, but...in MARK (where you could run this model), you can use an alternate approach to generating the V-C matrix that is less stable, but...much faster. Specifically, you can flip a switch in MARK and use the inverse of the Hessian matrix obtained as part of the numerical optimization of the likelihood function. This approach is not reliable, and should only be used when you are not interested in the standard errors, and already know the number of parameters that were estimated. But, I have used it to find a 'starting point', for the better (default) approach in MARK -- computing the information matrix directly using central difference approximations to the second partial derivatives.

You can also try deriving the V-C matrix using MCMC - but that might be a challenge given how it is implemented in MARK. [Basically, you generate the MCMC chains in MARK, output the MCMC object, post-proceess using the crosscorr function in the coda pacakge in R. There is a SAS equivalent, but I suspect Gary and I are the only ones left using SAS. :) ]

This isn't a comment at all on PRESENCE -- the V-C matrix in the problem described here is so high-dimension, not sure what the best strategy would be.
cooch
 
Posts: 1628
Joined: Thu May 15, 2003 4:11 pm
Location: Cornell University

Re: Presence models not completing

Postby jhines » Thu Oct 17, 2019 12:58 pm

One thing I forgot to mention is that I've added multi-threading to Presence. You can specify the number of threads in the "Tools" menu. The default is 1 thread. You can set it to the number of cpus/threads you have on your computer. It should speed up optimization and computation of the var-cov matrix.
jhines
 
Posts: 599
Joined: Fri May 16, 2003 9:24 am
Location: Laurel, MD, USA


Return to software problems/news

Who is online

Users browsing this forum: No registered users and 9 guests