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

Home » Public Forums » archive » regress
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: regress [message #65811 is a reply to message #65671] Tue, 17 March 2009 18:03 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
anniebryant@gmail.com writes:

> I have two 2D arrays I would like to regress. Both were created with
> the variance command and are intarr(673,274). Does one of these need
> to be a vector? Both need to be a vector? If so, is there a way to
> convert them from an array to a vector? I watched someone do this
> very quickly yesterday, but can not remember how.
>
> I thought this would be quite simple, but I haven't done a regression
> in IDL before and am hoping I can figure it out.

OK, if you just want to do a linear fit through the data,
I guess you can use REGRESS. I always have used LINFIT, but
in a quick test case, they appear to return the same results.

You will have to reformat both your images into vectors.
So, using LINFIT:

r = Linfit(Reform(d1, 673*274), Reform(d2, 673*274), YFIT=yfit
Print, 'Slope: ', r[1], ' Intercept: ', r[0]
Plot, Reform(d1, 673*274), Reform(d2, 673*274), PSYM=3
OPlot, Reform(d1, 673*274), yfit

Using REGRESS:

slope = Regress(Reform(d1, 673*274), Reform(d2, 673*274), $
YFIT=yfit, CONST=intercept)
Plot, Reform(d1, 673*274), Reform(d2, 673*274), PSYM=3
OPlot, Reform(d1, 673*274), yfit

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Writing BIG RGB GEOTIFF
Next Topic: IDL version

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

Current Time: Wed Oct 08 19:29:36 PDT 2025

Total time taken to generate the page: 0.00416 seconds