Constraining occupancy to zero returns warning

questions concerning analysis/theory using program MARK

Constraining occupancy to zero returns warning

Postby markmiller » Thu Apr 20, 2023 12:01 pm

I am using a multi-season occupancy model with initial occupancy and seasonal colonization (gamma) and extinction (epsilon). If I constrain occupancy, detection and colonization to zero and extinction to one for a subset of sites I get the following warning with both MARK and RMark:

Code: Select all
* *  WARNING  * *   Invalid calculation occurred during processing derived parameters of this model.
IEEE flag status at end of processing derived parameters:
overflow       F
divide by zero F
invalid        T
underflow      F
inexact        T


I have investigated this warning with deterministic fake data (provided below). Both MARK and RMark return the correct parameter estimates and the correct derived seasonal occupancies. I am not sure whether the lambdas are correct because I keep forgetting exactly what they represent. I am not really interested in the lambdas.

My inclination is to ignore this warning, but I wanted to ask advice from others here first. I also provide my RMark code below so anyone can reproduce this warning with my fake data.

A little background that led to this issue. Initially I did not stratify my sites by habitat. However, gradually I came to realize a subset of sites with a particular habitat appeared to be unoccupied. The species of interest was never detected in any of the sites with this habitat. So, I started thinking I should create at least one model with occupancy = 0 for sites in the perceived poor-quality habitat. This would allow me to get a better idea of the occupancy dynamics in the other sites. And I could perhaps use AIC to support constraining occupancy = 0 in the perceived poor-quality sites. I could not do the latter if I just deleted the perceived poor-quality sites from the data set.

Thank you for any thoughts on ignoring or resolving the warning message with either MARK or RMark.

Here is my RMark code, my fake data set and the estimates returned by RMark and MARK:

Code: Select all
library(RMark)

n.days <- 4

mydata <- convert.inp("fake_msocc_data_Apr20_2023.inp",
                      group.df = data.frame(habitat=c("good", "poor")))
head(mydata)

# Process data
mydata.processed = process.data(mydata, begin.time = 1, model = "RDOccupEG",
                                time.intervals = c(rep(c(0,1), (n.days-1)),0),
                                groups=("habitat"))

# Create default design data
mydata.ddl = make.design.data(mydata.processed)

# examine data
head(mydata.ddl$Psi)
head(mydata.ddl$Epsilon)
head(mydata.ddl$Gamma)
head(mydata.ddl$p)

# occupancy probability
psihabitat  = list(formula = ~ -1 + habitat)

# detection probability
pdayhabitat = list(formula = ~ -1 + session : habitat)

# epsilon probability
ehabitat = list(formula = ~ -1 + habitat)

# gamma probability
ghabitat = list(formula = ~ -1 + habitat)

mydata.ddl$Psi$fix[mydata.ddl$Psi$habitat         == 'poor'] <- 0
mydata.ddl$Epsilon$fix[mydata.ddl$Epsilon$habitat == 'poor'] <- 1
mydata.ddl$Gamma$fix[mydata.ddl$Gamma$habitat     == 'poor'] <- 0
mydata.ddl$p$fix[mydata.ddl$p$habitat             == 'poor'] <- 0

habitat.model = mark(mydata.processed, mydata.ddl,
                     model.parameters = list(    Psi = psihabitat,
                                                   p = pdayhabitat,
                                             Epsilon = ehabitat,
                                               Gamma = ghabitat),
                     output=FALSE, silent=TRUE)

habitat.model
# LOGIT Link Function Parameters of { Psi(~-1 + habitat)Epsilon(~-1 + habitat)Gamma(~-1 + habitat)p(~-1 + session:habitat) }
#                                                              95% Confidence Interval
#    Parameter                  Beta         Standard Error     Lower           Upper
# -------------------------  --------------  --------------  --------------  --------------
#    1:Psi:habitatgood       -1.3862943       0.0791937      -1.5415139      -1.2310747   
#    2:Epsilon:habitatgood    1.4000000       0.0828573       1.2375998       1.5624003   
#    3:Gamma:habitatgood     -0.1500000       0.0461333      -0.2404212      -0.0595787   
#    4:p:session1:habitatgo   2.9444390       0.2411869       2.4717127       3.4171654   
#    5:p:session2:habitatgo   2.1972244       0.1286285       1.9451126       2.4493363   
#    6:p:session3:habitatgo   1.7346009       0.1219025       1.4956719       1.9735299   
#    7:p:session4:habitatgo   1.3862944       0.1114515       1.1678495       1.6047393   

#   * *  WARNING  * *   Invalid calculation occurred during processing derived parameters of this model.
#     IEEE flag status at end of processing derived parameters:
#     overflow       F
#     divide by zero F
#     invalid        T
#     underflow      F
#     inexact        T


# from Program MARK
#
#     LOGIT Link Function Parameters of {psi(hab) epsilon(hab) gamma(hab) p(t, hab) C}
#                                                              95% Confidence Interval
#    Parameter                  Beta         Standard Error     Lower           Upper
# -------------------------  --------------  --------------  --------------  --------------
#    1:                      -1.3862944       0.0791937      -1.5415140      -1.2310748   
#    2:                       0.0000000       0.0000000       0.0000000       0.0000000   
#    3:                       1.4000000       0.0828573       1.2375997       1.5624002   
#    4:                       0.0000000       0.0000000       0.0000000       0.0000000   
#    5:                      -0.1500000       0.0461333      -0.2404212      -0.0595788   
#    6:                       0.0000000       0.0000000       0.0000000       0.0000000   
#    7:                       2.9444389       0.2411869       2.4717127       3.4171652   
#    8:                       0.0000000       0.0000000       0.0000000       0.0000000   
#    9:                       2.1972246       0.1286285       1.9451127       2.4493365   
#   10:                       1.7346010       0.1219025       1.4956720       1.9735300   
#   11:                       1.3862943       0.1114515       1.1678494       1.6047392   



Here is my fake data set:

Code: Select all
00000000 133.868709113837 0  ;
00000001 17.479379385232 0  ;
00000010 17.479379385232 0  ;
00000011 69.9175174626282 0  ;
00000100 20.636490560905 0  ;
00000101 0.806270394275684 0  ;
00000110 0.806270394275684 0  ;
00000111 3.225081573491 0  ;
00001000 20.636490560905 0  ;
00001001 0.806270394275684 0  ;
00001010 0.806270394275684 0  ;
00001011 3.225081573491 0  ;
00001100 116.940113717777 0  ;
00001101 4.56886558863333 0  ;
00001110 4.56886558863333 0  ;
00001111 18.2754623340668 0  ;
00010000 14.9768153148402 0  ;
00010001 1.98256278367592 0  ;
00010010 1.98256278367592 0  ;
00010011 7.93025112582268 0  ;
00010100 0.680667137174515 0  ;
00010101 0.0265937543711953 0  ;
00010110 0.0265937543711953 0  ;
00010111 0.106375017365653 0  ;
00011000 0.680667137174515 0  ;
00011001 0.0265937543711953 0  ;
00011010 0.0265937543711953 0  ;
00011011 0.106375017365653 0  ;
00011100 3.85711379511085 0  ;
00011101 0.150697942131776 0  ;
00011110 0.150697942131776 0  ;
00011111 0.602791767852044 0  ;
00100000 14.9768153148402 0  ;
00100001 1.98256278367592 0  ;
00100010 1.98256278367592 0  ;
00100011 7.93025112582268 0  ;
00100100 0.680667137174515 0  ;
00100101 0.0265937543711953 0  ;
00100110 0.0265937543711953 0  ;
00100111 0.106375017365653 0  ;
00101000 0.680667137174515 0  ;
00101001 0.0265937543711953 0  ;
00101010 0.0265937543711953 0  ;
00101011 0.106375017365653 0  ;
00101100 3.85711379511085 0  ;
00101101 0.150697942131776 0  ;
00101110 0.150697942131776 0  ;
00101111 0.602791767852044 0  ;
00110000 134.791338192617 0  ;
00110001 17.8430651006133 0  ;
00110010 17.8430651006133 0  ;
00110011 71.3722603225242 0  ;
00110100 6.12600425088896 0  ;
00110101 0.239343789978317 0  ;
00110110 0.239343789978317 0  ;
00110111 0.957375158841114 0  ;
00111000 6.12600425088897 0  ;
00111001 0.239343789978317 0  ;
00111010 0.239343789978317 0  ;
00111011 0.957375158841114 0  ;
00111100 34.7140242484682 0  ;
00111101 1.35628148279882 0  ;
00111110 1.35628148279882 0  ;
00111111 5.42512592511975 0  ;
01000000 2.34958876739863 0  ;
01000001 0.306750369874292 0  ;
01000010 0.306750369874292 0  ;
01000011 1.22700147812306 0  ;
01000100 0.36448516319788 0  ;
01000101 0.0142404831563718 0  ;
01000110 0.0142404831563718 0  ;
01000111 0.0569619325616959 0  ;
01001000 0.36448516319788 0  ;
01001001 0.0142404831563718 0  ;
01001010 0.0142404831563718 0  ;
01001011 0.0569619325616959 0  ;
01001100 2.06541593431347 0  ;
01001101 0.0806960715916017 0  ;
01001110 0.0806960715916017 0  ;
01001111 0.322784286004924 0  ;
01010000 0.0760363187956941 0  ;
01010001 0.0100653425099453 0  ;
01010010 0.0100653425099453 0  ;
01010011 0.0402613699946929 0  ;
01010100 0.0034557028545762 0  ;
01010101 0.000135014764009204 0  ;
01010110 0.000135014764009204 0  ;
01010111 0.000540059055432011 0  ;
01011000 0.0034557028545762 0  ;
01011001 0.000135014764009204 0  ;
01011010 0.000135014764009204 0  ;
01011011 0.000540059055432011 0  ;
01011100 0.0195823162662433 0  ;
01011101 0.000765083666247309 0  ;
01011110 0.000765083666247309 0  ;
01011111 0.003060334661562 0  ;
01100000 0.0760363187956941 0  ;
01100001 0.0100653425099453 0  ;
01100010 0.0100653425099453 0  ;
01100011 0.0402613699946929 0  ;
01100100 0.0034557028545762 0  ;
01100101 0.000135014764009204 0  ;
01100110 0.000135014764009204 0  ;
01100111 0.000540059055432011 0  ;
01101000 0.0034557028545762 0  ;
01101001 0.000135014764009204 0  ;
01101010 0.000135014764009204 0  ;
01101011 0.000540059055432011 0  ;
01101100 0.0195823162662433 0  ;
01101101 0.000765083666247309 0  ;
01101110 0.000765083666247309 0  ;
01101111 0.003060334661562 0  ;
01110000 0.684326870984143 0  ;
01110001 0.0905880828308146 0  ;
01110010 0.0905880828308146 0  ;
01110011 0.362352330917463 0  ;
01110100 0.0311013257740329 0  ;
01110101 0.00121513287931969 0  ;
01110110 0.00121513287931969 0  ;
01110111 0.00486053151183548 0  ;
01111000 0.0311013257740329 0  ;
01111001 0.00121513287931969 0  ;
01111010 0.00121513287931969 0  ;
01111011 0.00486053151183548 0  ;
01111100 0.176240846865657 0  ;
01111101 0.00688575301456792 0  ;
01111110 0.00688575301456792 0  ;
01111111 0.0275430120274265 0  ;
10000000 2.34958876739863 0  ;
10000001 0.306750369874292 0  ;
10000010 0.306750369874292 0  ;
10000011 1.22700147812306 0  ;
10000100 0.36448516319788 0  ;
10000101 0.0142404831563718 0  ;
10000110 0.0142404831563718 0  ;
10000111 0.0569619325616959 0  ;
10001000 0.36448516319788 0  ;
10001001 0.0142404831563718 0  ;
10001010 0.0142404831563718 0  ;
10001011 0.0569619325616959 0  ;
10001100 2.06541593431347 0  ;
10001101 0.0806960715916017 0  ;
10001110 0.0806960715916017 0  ;
10001111 0.322784286004924 0  ;
10010000 0.0760363187956941 0  ;
10010001 0.0100653425099453 0  ;
10010010 0.0100653425099453 0  ;
10010011 0.0402613699946929 0  ;
10010100 0.00345570285457619 0  ;
10010101 0.000135014764009204 0  ;
10010110 0.000135014764009204 0  ;
10010111 0.00054005905543201 0  ;
10011000 0.0034557028545762 0  ;
10011001 0.000135014764009204 0  ;
10011010 0.000135014764009204 0  ;
10011011 0.000540059055432011 0  ;
10011100 0.0195823162662433 0  ;
10011101 0.000765083666247309 0  ;
10011110 0.000765083666247309 0  ;
10011111 0.003060334661562 0  ;
10100000 0.0760363187956941 0  ;
10100001 0.0100653425099453 0  ;
10100010 0.0100653425099453 0  ;
10100011 0.0402613699946929 0  ;
10100100 0.00345570285457619 0  ;
10100101 0.000135014764009204 0  ;
10100110 0.000135014764009204 0  ;
10100111 0.00054005905543201 0  ;
10101000 0.0034557028545762 0  ;
10101001 0.000135014764009204 0  ;
10101010 0.000135014764009204 0  ;
10101011 0.000540059055432011 0  ;
10101100 0.0195823162662433 0  ;
10101101 0.000765083666247309 0  ;
10101110 0.000765083666247309 0  ;
10101111 0.003060334661562 0  ;
10110000 0.684326870984143 0  ;
10110001 0.0905880828308146 0  ;
10110010 0.0905880828308146 0  ;
10110011 0.362352330917463 0  ;
10110100 0.0311013257740329 0  ;
10110101 0.00121513287931969 0  ;
10110110 0.00121513287931969 0  ;
10110111 0.00486053151183548 0  ;
10111000 0.0311013257740329 0  ;
10111001 0.00121513287931969 0  ;
10111010 0.00121513287931969 0  ;
10111011 0.00486053151183548 0  ;
10111100 0.176240846865657 0  ;
10111101 0.00688575301456792 0  ;
10111110 0.00688575301456792 0  ;
10111111 0.0275430120274265 0  ;
11000000 44.6421866177859 0  ;
11000001 5.82825703246974 0  ;
11000010 5.82825703246974 0  ;
11000011 23.3130281037709 0  ;
11000100 6.9252181065323 0  ;
11000101 0.270569180196599 0  ;
11000110 0.270569180196599 0  ;
11000111 1.08227671957436 0  ;
11001000 6.9252181065323 0  ;
11001001 0.270569180196599 0  ;
11001010 0.270569180196599 0  ;
11001011 1.08227671957436 0  ;
11001100 39.2429027846671 0  ;
11001101 1.53322536151847 0  ;
11001110 1.53322536151847 0  ;
11001111 6.13290143920568 0  ;
11010000 1.44469005832242 0  ;
11010001 0.191241507848372 0  ;
11010010 0.191241507848372 0  ;
11010011 0.76496603053681 0  ;
11010100 0.0656583542916778 0  ;
11010101 0.0025652805183132 0  ;
11010110 0.0025652805183132 0  ;
11010111 0.0102611220617615 0  ;
11011000 0.0656583542916778 0  ;
11011001 0.0025652805183132 0  ;
11011010 0.0025652805183132 0  ;
11011011 0.0102611220617615 0  ;
11011100 0.37206400936876 0  ;
11011101 0.014536589670816 0  ;
11011110 0.014536589670816 0  ;
11011111 0.0581463586181464 0  ;
11100000 1.44469005832242 0  ;
11100001 0.191241507848372 0  ;
11100010 0.191241507848372 0  ;
11100011 0.76496603053681 0  ;
11100100 0.0656583542916778 0  ;
11100101 0.0025652805183132 0  ;
11100110 0.0025652805183132 0  ;
11100111 0.0102611220617615 0  ;
11101000 0.0656583542916778 0  ;
11101001 0.0025652805183132 0  ;
11101010 0.0025652805183132 0  ;
11101011 0.0102611220617615 0  ;
11101100 0.37206400936876 0  ;
11101101 0.014536589670816 0  ;
11101110 0.014536589670816 0  ;
11101111 0.0581463586181464 0  ;
11110000 13.0022105595368 0  ;
11110001 1.72117357522018 0  ;
11110010 1.72117357522018 0  ;
11110011 6.8846942931706 0  ;
11110100 0.590925190199195 0  ;
11110101 0.0230875247263189 0  ;
11110110 0.0230875247263189 0  ;
11110111 0.0923500988018535 0  ;
11111000 0.590925190199195 0  ;
11111001 0.0230875247263189 0  ;
11111010 0.0230875247263189 0  ;
11111011 0.0923500988018535 0  ;
11111100 3.34857609323872 0  ;
11111101 0.130829307385844 0  ;
11111110 0.130829307385844 0  ;
11111111 0.523317228957319 0  ;
00000000 0 1000  ;
markmiller
 
Posts: 49
Joined: Fri Nov 08, 2013 6:23 pm

Re: Constraining occupancy to zero returns warning

Postby markmiller » Thu Apr 20, 2023 12:19 pm

P.S. If I do remove the perceived poor-quality sites from the input data file then all estimates, SEs and confidence intervals appear to be the same as before. All derived parameters, SEs and confidence intervals appear to be the same as before, including the lambdas.

This suggests perhaps the warning is strictly related to the parameters constrained to 0 or 1. Although, I am not sure. This also seem to reinforce my inclination to ignore this warning. Although, perhaps that is not the wisest decision.
markmiller
 
Posts: 49
Joined: Fri Nov 08, 2013 6:23 pm

Re: Constraining occupancy to zero returns warning

Postby gwhite » Thu Apr 20, 2023 12:37 pm

The lambda estimates are ratios of psi estimates, so fixing a value of psi = 0 will mean dividing by zero, i.e., lambda is technically undefined. Thus, you are constructing a non-sensical model.

But ignore the warning and probably the lambda estimates when you get the warning.

Gary
gwhite
 
Posts: 329
Joined: Fri May 16, 2003 9:05 am


Return to analysis help

Who is online

Users browsing this forum: Google [Bot] and 14 guests