comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: linfit and regress questions
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: linfit and regress questions [message #56686] Mon, 12 November 2007 02:02 Go to next message
rlayberry is currently offline  rlayberry
Messages: 33
Registered: November 2004
Member
On 11 Nov, 16:49, hradilv <hrad...@yahoo.com> wrote:
> On Nov 11, 10:42 am, rlaybe...@hotmail.com wrote:
>
>
>
>
>
>> On 11 Nov, 16:37, hradilv <hrad...@yahoo.com> wrote:
>
>>> On Nov 11, 10:27 am, rlaybe...@hotmail.com wrote:
>
>>>> Hi
>
>>>> I am interested in fitting a line of the form y=mx+c using regress or
>>>> linfit. I want the option of fixing the value of c at zero. Can I do
>>>> this in either of these 2 functions or would I need to use something
>>>> else?
>
>>>> Thanks
>
>>>> Russ
>
>>> Just write it yourself:
>
>>> mhat = total(x*y)/total(x*x)
>
>>> http://mallit.fr.umn.edu/fr5218/reg_refresh/origin.html
>
>> thanks. is that really true? this gives the best fit? great, that's
>> one problem solved. what about if I want to set the intercept to c1?
>
>> russ
>
> Transform the data?
>
> mhat = total(x*(y-c1))/total(x*x)- Hide quoted text -
>
> - Show quoted text -

thanks hradilv, you've saved me a few hours!
Re: linfit and regress questions [message #56690 is a reply to message #56686] Sun, 11 November 2007 08:49 Go to previous messageGo to next message
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
On Nov 11, 10:42 am, rlaybe...@hotmail.com wrote:
> On 11 Nov, 16:37, hradilv <hrad...@yahoo.com> wrote:
>
>
>
>> On Nov 11, 10:27 am, rlaybe...@hotmail.com wrote:
>
>>> Hi
>
>>> I am interested in fitting a line of the form y=mx+c using regress or
>>> linfit. I want the option of fixing the value of c at zero. Can I do
>>> this in either of these 2 functions or would I need to use something
>>> else?
>
>>> Thanks
>
>>> Russ
>
>> Just write it yourself:
>
>> mhat = total(x*y)/total(x*x)
>
>> http://mallit.fr.umn.edu/fr5218/reg_refresh/origin.html
>
> thanks. is that really true? this gives the best fit? great, that's
> one problem solved. what about if I want to set the intercept to c1?
>
> russ

Transform the data?

mhat = total(x*(y-c1))/total(x*x)
Re: linfit and regress questions [message #56691 is a reply to message #56690] Sun, 11 November 2007 08:42 Go to previous messageGo to next message
rlayberry is currently offline  rlayberry
Messages: 33
Registered: November 2004
Member
On 11 Nov, 16:37, hradilv <hrad...@yahoo.com> wrote:
> On Nov 11, 10:27 am, rlaybe...@hotmail.com wrote:
>
>> Hi
>
>> I am interested in fitting a line of the form y=mx+c using regress or
>> linfit. I want the option of fixing the value of c at zero. Can I do
>> this in either of these 2 functions or would I need to use something
>> else?
>
>> Thanks
>
>> Russ
>
> Just write it yourself:
>
> mhat = total(x*y)/total(x*x)
>
> http://mallit.fr.umn.edu/fr5218/reg_refresh/origin.html

thanks. is that really true? this gives the best fit? great, that's
one problem solved. what about if I want to set the intercept to c1?

russ
Re: linfit and regress questions [message #56692 is a reply to message #56691] Sun, 11 November 2007 08:37 Go to previous messageGo to next message
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
On Nov 11, 10:27 am, rlaybe...@hotmail.com wrote:
> Hi
>
> I am interested in fitting a line of the form y=mx+c using regress or
> linfit. I want the option of fixing the value of c at zero. Can I do
> this in either of these 2 functions or would I need to use something
> else?
>
> Thanks
>
> Russ

Just write it yourself:

mhat = total(x*y)/total(x*x)

http://mallit.fr.umn.edu/fr5218/reg_refresh/origin.html
Re: linfit and regress questions [message #56772 is a reply to message #56690] Mon, 12 November 2007 19:16 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
hradilv <hradilv@yahoo.com> writes:
>
> Transform the data?
>
> mhat = total(x*(y-c1))/total(x*x)

Of course this all assumes the data are meant to be equally weighted
(no error bars, or all error bars are equal).

Craig
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: FLAASH Atmospheric Module
Next Topic: Re: icontour scaling color table

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 17:35:42 PDT 2025

Total time taken to generate the page: 0.00703 seconds