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

Home » Public Forums » archive » Oddities with the linfit function
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Oddities with the linfit function [message #91625 is a reply to message #91622] Thu, 06 August 2015 15:08 Go to previous message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
On Thursday, August 6, 2015 at 11:51:21 PM UTC+2, Wayana Dolan wrote:
> I've got an array for X, and an array for y.
>
> so I do this
>
> plot, x,y, psym=1
> result=linfit(x,y)
> print, result
>
> and instead of getting the usual 2 things that are the m and the b of the y=mx+b, I get three. The first two things I think are the m and b, and the third thing I though was the r^2. But if I multiply the x value by -1 so everything flips, then do linfit, I get the identical third value, but negative...
>
> Not sure why I get three things, and I'm not sure how to get the real r^2 value.
>
> Thanks for your help!

Kind of impossible. Are you using the "right" linfit from IDL that is found in /lib/linfit.pro?
If you can debug, try to step in the function and see where it brings you.
Or maybe even easier, try:
print, routine_info('linfit', /source, /function)

See also http://www.exelisvis.de/docs/LINFIT.html

Cheers,
Helder
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: cgScatter2D label
Next Topic: What's New in IDL 8.4

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

Current Time: Wed Oct 08 13:58:30 PDT 2025

Total time taken to generate the page: 0.00248 seconds