[GRASS-dev] r.regression.multi failing

Paulo van Breugel p.vanbreugel at gmail.com
Wed Mar 23 08:43:37 PDT 2016



On 23-03-16 16:21, Moritz Lennert wrote:
> Le Wed, 23 Mar 2016 15:55:40 +0100,
> Paulo van Breugel <p.vanbreugel at 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
>>> <lucadeluge at gmail.com> wrote:
>>>> On 23 March 2016 at 14:31, Paulo van Breugel
>>>> <p.vanbreugel at 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. 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?

>
> Moritz



More information about the grass-dev mailing list