MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: LinearModelFit regression estimated variance error

  • To: mathgroup at smc.vnet.net
  • Subject: [mg102342] Re: [mg102310] LinearModelFit regression estimated variance error
  • From: Darren Glosemeyer <darreng at wolfram.com>
  • Date: Thu, 6 Aug 2009 06:30:34 -0400 (EDT)
  • References: <200908050943.FAA18149@smc.vnet.net>

Parita wrote:
> Hi
>
> I want to run linear regression in Mathematica and am using
> LinearModelFit for the same. Following is the code that I am using.
> data1 contains the 10 columns. The first 9 columns contains the data
> through which I want to run regression and the last column contains
> the response value.
>
> model = LinearModelFit [data1, {a, b, c, d, e, f, g, h, i}, {a, b, c,
> d, e, f, g, h, i}];
> Print[model["BestFit"]];
>
> However, I am getting the following two errors -
> FittedModel::varzero: The estimated variance is zero. Properties
> requiring division by the variance or standard error will not be
> computed.
>
> FittedModel::varnum: The estimated variance -8.76512*10^-32 is not a
> positive number. Properties requiring division by the variance or
> standard error will not be computed.
> FittedModel::badfit: -- Message text not found --
>
> I am getting the coefficients for the regression model bu the standard
> error, p-values and R-squared are indeterminate. Any ideas what this
> error means and how can I go around it?
>
> Thanks in advance for your help
>   

The messages indicate that the fitted model goes through all of the data 
points. This will give a 0 variance estimate because the sum of squared 
errors will be 0, and any quantity that involves division by the 
variance or standard deviation will be indeterminate or infinite. In 
this case, the estimate is actually a small amount of numerical noise. 
This is possibly an indication that the model is over-fitting the data 
or that there are too few data points.

If the model is over-fitting, it may be that fewer basis functions could 
be used to get a good fit that is not an (effectively) exact fit. If the 
number of data points is equal to or less than the number of basis 
functions, more data (or fewer basis functions) would be needed.

Darren Glosemeyer
Wolfram Research


  • Prev by Date: Re: Re: Package won't load after v.7 upgrade
  • Next by Date: Re: NDSolve memory management problem
  • Previous by thread: LinearModelFit regression estimated variance error
  • Next by thread: Re: LinearModelFit regression estimated variance error