Error in crossVal

31 views
Skip to first unread message

Julien Piquet

unread,
Mar 20, 2025, 1:12:18 PM (11 days ago) Mar 20
to unmarked
Hi everybody!

I am running N-mixture (pcount) models in unmarked and when trying to run crossVal I get "Error in V %*% ppars : non-conformable arguments". However, the models run smoothly and I get no troubles otherwise. The code looks like this:

crossVal(pcount(~num_date + time + temp + hr + windmax + rocks + clouds + (1|observers)~ tmin + ppt + landcover + area, data = data_list$galgal, mixture = "P"), method = "Kfold")

Furthermore, when I try to loop it to run several models at once I get "Error in split_formula(formula) : Double right-hand side formula required" .

Could anyone explain me what might be happening?

Best

Julien

Ken Kellner

unread,
Mar 20, 2025, 3:34:47 PM (11 days ago) Mar 20
to unmarked
I suspect your problem with crossVal is due to the random effect. Does the code run when you fit the model without the random effect?

The likely problem is that when the dataset is split into folds, some folds randomly end up without any representative data points for some of the levels of 'observer'. At the moment unmarked cannot handle that situation and the result is an error. I'll look into a fix but it's probably not going to be a quick one, so you may not be able to use crossVal with that model.

The second error is hard to diagnose but I suspect something's wrong with your loop. Maybe if you post the full code for the loop we can help more.

Ken

Julien Piquet

unread,
Mar 21, 2025, 9:39:33 AM (10 days ago) Mar 21
to unmarked
Hi Ken,

Thank you for your quick response. Unfortunately, observers is a relevant factor in my dataset, thus finding a solution for the second issue is not necessary as I have to include this factor in my analysis. Anyway, I thank you again for your help.

Best

Julien
Reply all
Reply to author
Forward
0 new messages