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

Home » Public Forums » archive » Re: least square matrix
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: least square matrix [message #43022] Fri, 11 March 2005 06:43 Go to previous message
James Kuyper is currently offline  James Kuyper
Messages: 425
Registered: March 2000
Senior Member
Matthias Demuzere wrote:
> Hi,
>
> Because my question maybe still a bit unclear, here it is again:
>
> I have a dataset of temperatures taken at hourly steps (k-value, ranging
> from 1-24) for a whole
> month (with i days). Now, I would like to compare each temperature Tk,i with
> every other Tk,j with j the same number of days as in i. I would like to do
> that comparison by least square methods like this
>
> Matrix Ai,j = sum (Tk,i-Tk,j)^2
>
> where the matrix Ai,j is a symmetrical matrix (because i,j are the same
> day).
>
> How can that be done in IDL?

sum(Tk,i-Tk,j)
= sum(Tk,i^2 -2Tk,i*Tk,j+Tk,j^2)
= sum(Tk,i^2) -2 sum(Tk,i*Tk,j)+sum(Tk,j^2)

T = indgen(31,24)*0.1
T2 = (T^2)#replicate(1,24,31)
A = T2 -2*T#transpose(T)+transpose(T2)
[Message index]
 
Read Message
Read Message
Previous Topic: Re: netCDF _FillValue attributes
Next Topic: Re: Calling data from a structure of pointers?

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

Current Time: Fri Oct 10 19:43:37 PDT 2025

Total time taken to generate the page: 2.39783 seconds