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

Home » Public Forums » archive » Re: linear fit y=ax
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: linear fit y=ax [message #46667] Wed, 07 December 2005 09:47
mmeron is currently offline  mmeron
Messages: 44
Registered: October 2003
Member
In article <1133972085.075357.230360@z14g2000cwz.googlegroups.com>, lajam@caramail.com writes:
> Hello,
>
> I have a very easy question but I didn't find the answer in the IDL
> reference guide. I want to fit data with a linear fit y=ax. I want to
> impose my fit to pass by zero. I have looked at the linfit, regress,
> ... functions and I didn't understand how to adapt these functions for
> my problem. I have tried with regress:
> result=regress(desired_value,calculated_value,weigths) but I'm not sure
> that it's the regular way to obtain calculated_value=A*desired_value.
> Could someone help me, please?
>
You can look in my library, MIDL, on the RSI user contributions page.
Chack out the routine LINFIT_MM. It'll do just what you ask for (and
much more)

Mati Meron | "When you argue with a fool,
meron@cars.uchicago.edu | chances are he is doing just the same"
Re: linear fit y=ax [message #46670 is a reply to message #46667] Wed, 07 December 2005 08:48 Go to previous message
Paolo Grigis is currently offline  Paolo Grigis
Messages: 171
Registered: December 2003
Senior Member
Paolo Grigis wrote:
>
>
> lajam@caramail.com wrote:
>
>> Hello,
>>
>> I have a very easy question but I didn't find the answer in the IDL
>> reference guide. I want to fit data with a linear fit y=ax. I want to
>> impose my fit to pass by zero. I have looked at the linfit, regress,
>> ... functions and I didn't understand how to adapt these functions for
>> my problem. I have tried with regress:
>> result=regress(desired_value,calculated_value,weigths) but I'm not sure
>> that it's the regular way to obtain calculated_value=A*desired_value.
>
>
> try: total(y)/total(x)
actually, I meant total(y*x)/total(x*x)
>
>
> Ciao,
> Paolo
>
>
>> Could someone help me, please?
>>
>>
>> Thanks,
>> Cedric
>>
Re: linear fit y=ax [message #46671 is a reply to message #46670] Wed, 07 December 2005 08:32 Go to previous message
Paolo Grigis is currently offline  Paolo Grigis
Messages: 171
Registered: December 2003
Senior Member
lajam@caramail.com wrote:
> Hello,
>
> I have a very easy question but I didn't find the answer in the IDL
> reference guide. I want to fit data with a linear fit y=ax. I want to
> impose my fit to pass by zero. I have looked at the linfit, regress,
> ... functions and I didn't understand how to adapt these functions for
> my problem. I have tried with regress:
> result=regress(desired_value,calculated_value,weigths) but I'm not sure
> that it's the regular way to obtain calculated_value=A*desired_value.

try: total(y)/total(x)


Ciao,
Paolo


> Could someone help me, please?
>
>
> Thanks,
> Cedric
>
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Creating Panels in iTools
Next Topic: netCDF 3.6.0.

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

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

Total time taken to generate the page: 0.00898 seconds