Thread Subject: Important Regression Questions

Subject: Important Regression Questions

From: Samoline1 Linke

Date: 4 Nov, 2009 17:13:03

Message: 1 of 4

Hi,

I have a few confusions about Regression!

First, I have seen regression can be applied to either 'linear' or 'non linear' models

BUT!!!

1 - What is the best criteria to see that the fitted curve or line is the best model e.g. one way could be to compare the values of norm of residuals....is there any other?

2- when I do regstats (x,y), then it gives me very useful information e.g. value of R-square etc. but are these values calculated based on a linear model or does it calculate the values fitting the best possible model?

3- why is it so that for nonlinear, one must have some formula in mind to apply. Is not it possible that I simply input my data and matlab itself decides whats the best fit (non linear).

Thanks for ur time.

Subject: Important Regression Questions

From: someone

Date: 4 Nov, 2009 18:54:02

Message: 2 of 4

"Samoline1 Linke" <maganatewoman@yahoo.com> wrote in message <hcscmu$8u9$1@fred.mathworks.com>...
> Hi,
>
> I have a few confusions about Regression!
>
> First, I have seen regression can be applied to either 'linear' or 'non linear' models
>
> BUT!!!

I'm not an expert, but my experiences are:

>
> 1 - What is the best criteria to see that the fitted curve or line is the best model e.g. one way could be to compare the values of norm of residuals....is there any other?

Yes, there are many others, but no "best" criteria other than plotting and using your own eyeball to judge which is best given YOUR criteria.
>
> 2- when I do regstats (x,y), then it gives me very useful information e.g. value of R-square etc. but are these values calculated based on a linear model or does it calculate the values fitting the best possible model?

I believe it calculates the values based on the model YOU supplied.
(There is no a-priori "best possible model" under ALL circumstances.

>
> 3- why is it so that for nonlinear, one must have some formula in mind to apply. Is not it possible that I simply input my data and matlab itself decides whats the best fit (non linear).

No, I don't believe it is possible.
There are an infinite number of nonlinear models that can be applied.
How can MATLAB try all the infinite possibilities?

>
> Thanks for ur time.

Subject: Important Regression Questions

From: Samoline1 Linke

Date: 5 Nov, 2009 11:47:01

Message: 3 of 4

"someone" <someone@somewhere.net> wrote in message <hcsika$kc3$1@fred.mathworks.com>...
> "Samoline1 Linke" <maganatewoman@yahoo.com> wrote in message <hcscmu$8u9$1@fred.mathworks.com>...
> > Hi,
> >
> > I have a few confusions about Regression!
> >
> > First, I have seen regression can be applied to either 'linear' or 'non linear' models
> >
> > BUT!!!
>
> I'm not an expert, but my experiences are:
>
> >
> > 1 - What is the best criteria to see that the fitted curve or line is the best model e.g. one way could be to compare the values of norm of residuals....is there any other?
>
> Yes, there are many others, but no "best" criteria other than plotting and using your own eyeball to judge which is best given YOUR criteria.
> >
> > 2- when I do regstats (x,y), then it gives me very useful information e.g. value of R-square etc. but are these values calculated based on a linear model or does it calculate the values fitting the best possible model?
>
> I believe it calculates the values based on the model YOU supplied.
> (There is no a-priori "best possible model" under ALL circumstances.
>
> >
> > 3- why is it so that for nonlinear, one must have some formula in mind to apply. Is not it possible that I simply input my data and matlab itself decides whats the best fit (non linear).
>
> No, I don't believe it is possible.
> There are an infinite number of nonlinear models that can be applied.
> How can MATLAB try all the infinite possibilities?
>
> >
> > Thanks for ur time.

-------------

I have checked for regstats and have seen that it calculates the values based on the model. But one can not make it to calculate the values for a cubic or 5th degree polynomial fitting.

Could someone please confirm?

Subject: Important Regression Questions

From: Tom Lane

Date: 5 Nov, 2009 15:10:17

Message: 4 of 4

> I have checked for regstats and have seen that it calculates the values
> based on the model. But one can not make it to calculate the values for a
> cubic or 5th degree polynomial fitting.
>
> Could someone please confirm?

The polyfit function would be easier for this:

>> load census
>> x = (cdate-mean(cdate))/100;
>> p = polyfit(x,pop,5)
p =
    6.3901 4.7543 -3.8481 60.9626 120.8211 62.2285

But it is possible to use regstats for this by specifying the model as a
vector of powers of the x variable:

>> regstats(pop,x,(0:5)','beta')
ans =
    source: 'regstats'
      beta: [6x1 double]
>> ans.beta
ans =
   62.2285
  120.8211
   60.9626
   -3.8481
    4.7543
    6.3901

-- Tom

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com