Error in %*%: non-conformable arguments

158 views
Skip to first unread message

Dimitris Poursanidis

unread,
Nov 2, 2018, 6:19:36 AM11/2/18
to Wallace Ecological Modeling App
Just run a complex maxnet model with 0.5 beta increase from 1 to 5.
In finish and then i have this error at the console >

Warning: Error in %*%: non-conformable arguments
  95: predict.maxnet
  94: maxnet::maxnet
  93: modelTune.maxnet
  92: tuning
  91: ENMeval::ENMevaluate
  90: <reactive> [modules/mod_c6_maxent.R#94]
  74: mod.maxent
  73: observeEventHandler [C:\Users\dpour\Documents\R\win-library\3.5\wallace\shiny/server.R#519]
   2: shiny::runApp
   1: run_wallace


Any idea on?

Gonzalo Pinilla-Buitrago

unread,
Nov 2, 2018, 11:48:24 AM11/2/18
to Wallace Ecological Modeling App
Hi Dimitris,

This issue looks like an ENMeval error instead of a Wallace error. Do you try with the maxent.jar option?

Let's wait that some of the developers of ENMeval package (some of them are in this google group) can give you some light on this problem.

Best,
Gonzalo

Jamie M. Kass

unread,
Dec 23, 2018, 6:30:25 PM12/23/18
to Wallace Ecological Modeling App
Sorry this is so late, but was this resolved? If not, could you provide more details on your Wallace run and/or make a reproducible example in code? Thanks.

Jamie

Cory Merow

unread,
Dec 24, 2018, 11:17:05 AM12/24/18
to Jamie M. Kass, Wallace Ecological Modeling App
Hi all,
I'm 99% sure this is a maxnet bug. A colleague and I noted it and didn't come up with a real solution. It occurs in maxnet when it computes mm %*% object$betas where object is the model and betas are the coefficients. The cause is that there are sometimes duplicate names in model$betas, and thus duplicate terms in the formula. And when the model matrix (mm) is computed using model.matrix() it seems to remove, or ignore, the duplicate term, so the dimensions of the model matrix, specifically the number of columns, is not equal to the length of object$betas, and the error occurs. I *think* there must be a a stochastic component to the optimization algorithm in maxnet because I use a catch (in R code, not Wallace) to note this issue and just try rerunning the model til it doesn't throw an error. And that seems to work. If you find that rerunning the model a few times reproduces the issue, I'd be interested to know.
Cory


Cory Merow
Ecology and Evolutionary Biology
University of Connecticut
skype: cory.merow

'Give me 4 parameters and I will draw you an elephant. Give me 5 and I will wag the trunk.'


--
You received this message because you are subscribed to the Google Groups "Wallace Ecological Modeling App" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wallaceEcoMo...@googlegroups.com.
To post to this group, send email to wallac...@googlegroups.com.
Visit this group at https://groups.google.com/group/wallaceEcoMod.
To view this discussion on the web visit https://groups.google.com/d/msgid/wallaceEcoMod/b591142a-8685-4351-9e4b-9c95287aa4b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jamie M. Kass

unread,
Dec 29, 2018, 3:45:42 PM12/29/18
to Wallace Ecological Modeling App
Weird... thanks for the info, Cory. Would this easily be solved by a pull request for an error catch?

Jamie

Dimitris Poursanidis

unread,
Apr 21, 2024, 2:25:52 PM4/21/24
to Wallace Ecological Modeling App
and it happens again!!

three times in the row with maxnet...

shall i switch to maxent.jar to complete the modelling work or try again? 

Dimitris Poursanidis

unread,
Apr 21, 2024, 2:26:26 PM4/21/24
to Wallace Ecological Modeling App
forgot to paste the R console msg


*** Running ENMeval v2.0.4 with maxnet from maxnet package v0.1.4 ***
|=========== | 12%Warning: Error in %*%: non-conformable arguments 2: shiny::runApp 1: run_wallace


Jamie M. Kass

unread,
Apr 21, 2024, 7:21:46 PM4/21/24
to Dimitris Poursanidis, Wallace Ecological Modeling App
One way to avoid this I've found is to avoid H1 parameterization because it often occurs when there are many possible features. However, for the long term, it would be good to post this as an issue to the maxnet repo, ideally with Cory's old explanation of what seems to be wrong. Maybe Steven can fix it.

Jamie

Dimitris Poursanidis

unread,
Apr 22, 2024, 9:23:17 AM4/22/24
to Jamie M. Kass, Wallace Ecological Modeling App
Thanks, I'll look into it. 
---
".. If something has to be done, take the responsibility and do it.."
Interpreting Earth & Ocean and its elements using satellites, models & field data
Dimitris Poursanidis, Ph.D. Marine Ecology

Reply all
Reply to author
Forward
0 new messages