On Wed, Mar 23, 2016 at 4:43 PM, Paulo van Breugel <p.vanbreu...@gmail.com> wrote: > > > On 23-03-16 16:21, Moritz Lennert wrote: >> >> Le Wed, 23 Mar 2016 15:55:40 +0100, >> Paulo van Breugel <p.vanbreu...@gmail.com> a écrit : >> >>> On 23-03-16 15:24, Anna Petrášová wrote: >>>> >>>> On Wed, Mar 23, 2016 at 10:01 AM, Luca Delucchi >>>> <lucadel...@gmail.com> wrote: >>>>> >>>>> On 23 March 2016 at 14:31, Paulo van Breugel >>>>> <p.vanbreu...@gmail.com> wrote: >>>>>> >>>>>> Hi, >>>>>> >>>>> >>>>> Hi, >>>>> >>>>>> >>>>>> I am using r.regression.multi in a python script (using >>>>>> grass.run_command()) to compute the variance inflation factor >>>>>> (VIF). It runs in a loop, regressing variables one by one to all >>>>>> the other variables. It sometimes happen that the function fails >>>>>> with: >>>>>> >>>>>> WARNING: Matrix is unsolvable >>>>>> ERROR: Multiple regression failed >> >> This looks like a clear bug for me. So, even if I understand that you >> need to work around it for now, could you also post a bug report with a >> reproductible example ? > > Not sure it is a bug? It happens when amongst the independent variables > there are perfectly correlated variables. The message "WARNING: Matrix is > unsolvable" therefore seems correct to me.
Yes, this warning should only occur in case of colinearity > Now this is treated as an error > (ERROR: Multiple regression failed"), which I guess is the equivalent of > grass.error() in a python script? Perhaps it would be possible to provide a > warning instead, and give an output that can be captured, like NA for the > coefficient estimates, instead of breaking of the function? Instead of grass.run_command(), you can use ps = grass.start_command() returncode = ps.wait() returncode is zero if the module finished successfully, non-zero if an error occurred, easy to capture in a script. Markus M _______________________________________________ grass-dev mailing list grass-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-dev