Adding random effect to CJS model

questions concerning analysis/theory using the R package 'marked'

Adding random effect to CJS model

Postby SuperLenny » Thu Nov 28, 2024 7:51 am

I am trying to make a CJS model in Marked with a fixed group effect called Restoration, and a random effect for Year. However, I keep getting an error message when I try to fit the model:

# Process data
smolt.proc <- process.data(data = capt.hist, groups = c("Restoration", "Year"))
smolt.ddl <- make.design.data(smolt.proc)

# Fit model with TMB
model1 <- crm(smolt.proc, smolt.ddl, use.tmb = TRUE,
model.parameters = list(
Phi = list(formula = ~ Restoration + (1 | Year)),
p = list(formula = ~ Restoration)
))

Results in this error message:
g++ -std=gnu++17 -c cjsre_tmb.cpp -o cjsre_tmb.o
as: cjsre_tmb.o: too many sections (35030)
Fatal error: can't write 331 bytes to section .text of cjsre_tmb.o: 'file too big'
make: *** [Makeconf:272: cjsre_tmb.o] Error 1
Error in compile(paste(tpl, ".cpp", sep = ""), flags = "-Wno-ignored-attributes") :
Compilation failed

I am not sure what I am doing wrong. Any help would be much appreciated!
SuperLenny
 
Posts: 2
Joined: Wed Nov 27, 2024 9:29 am

Re: Adding random effect to CJS model

Postby SuperLenny » Thu Nov 28, 2024 8:17 am

As a add on, I realize I have multiple recapture events, so I also need to have a time-varying component. But this also resulted in similar problems:

model1 <- crm(smolt.proc, smolt.ddl, use.tmb=TRUE,
model.parameters = list(
Phi = list(formula = ~ Restoration*time + (1|Year)),
p = list(formula = ~ time)
))

With the following error:
as: cjsre_tmb.o: too many sections (35030)
Fatal error: can't write 331 bytes to section .text of cjsre_tmb.o: 'file too big'
make: *** [Makeconf:272: cjsre_tmb.o] Error 1
Compilation failed
SuperLenny
 
Posts: 2
Joined: Wed Nov 27, 2024 9:29 am

Re: Adding random effect to CJS model

Postby jlaake » Wed Dec 04, 2024 7:11 pm

We worked with this offline. I never got that error so we never determined what caused the error they observed. As it turns out they only had 4 years - 2 in each treatment, so random effects was out of the question. I have them working in RMark since they only needed fixed effects.
jlaake
 
Posts: 1479
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA


Return to analysis help

Who is online

Users browsing this forum: No registered users and 2 guests

cron