model average error "invalid 'times' value"

12 views
Skip to first unread message

Asia Murphy

unread,
Nov 17, 2025, 4:21:53 PMNov 17
to secr
Hello again,

I'm currently running multi-session (27 sessions) density models. I wanted to model average the results; however, whenever I use the function, I get this error:

Error in rep.int(rep.int(seq_len(nx), rep.int(rep.fac,nx)),orep):
invalid 'times' value

This happens whether or not I can't find any mention of such an error in the historical messages. My code below.

###

library(secr)
modlist<-list(mod1,mod2,mod3,mod4,mod5,mod7,mod8,mod9,mod10,mod11,
              mod12,mod13,mod14,mod16,mod18,mod19,mod20,mod21,mod22,mod23,
              mod24,mod25,mod27,mod28,mod29,mod30,mod31,mod33,mod34,
              mod35,mod36,mod38,mod39,mod40,mod41,mod42,mod44,mod45,mod46)
class(modlist)<-c('secrlist')
modelAverage(modlist, betanames="D")

Thank you for your help!

Murray Efford

unread,
Nov 17, 2025, 4:30:24 PMNov 17
to Asia Murphy, secr
That's a mystery to me. "orep" appears nowhere in the secr code. So my guess is that you are unintentionally calling modelAverage from a different package. Suggest trying secr::modelAverage().

--
You received this message because you are subscribed to the Google Groups "secr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to secrgroup+...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/secrgroup/92d6b61f-1617-4e16-af9c-9d0dee37c95fn%40googlegroups.com.

Asia Murphy

unread,
Nov 17, 2025, 4:38:58 PMNov 17
to secr
Still getting the same error message with that addition to the code. How strange.

Murray Efford

unread,
Nov 17, 2025, 5:59:25 PMNov 17
to Asia Murphy, secr
OK, that error must come from some function called internally.
The basic code works e.g.,
modelAverage(secrlist(ovenbird.model.1, ovenbird.model.D), betanames = 'D')

So I imagine there is something screwy about one or more of your fitted models. Have you tried AIC(modlist)?

Asia Murphy

unread,
Nov 18, 2025, 1:07:35 PMNov 18
to secr
Yep! And the AIC function appears to work on the same set of models perfectly well.

Murray Efford

unread,
Nov 18, 2025, 3:07:34 PM (14 days ago) Nov 18
to secr
I think you'll need to troubleshoot some more yourself - does modelAverage() work with just a couple of your fitted models? Can you isolate the problem to particular fitted models? Does the problem arise when averaging real parameters rather than beta parameters? 
Reply all
Reply to author
Forward
0 new messages