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

Home » Public Forums » archive » weighted average
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: weighted average [message #86890 is a reply to message #86881] Tue, 10 December 2013 08:15 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On Tuesday, December 10, 2013 1:41:37 AM UTC-5, sid wrote:
> Hello everyone,
>
> I have data set of 800 data points spreaded in 20 years, I have to take six monthly mean of the data set, but I need to take weighted mean. My preference is that , while taking six monthly mean more weightage has to be given to those values which are more in numbers, less weightage to those values which lesser in numbers. How can I do this, is there any idl routine that does this. Please help me out in this regard.

Mats has the right idea. But usually the analyst has a rationale for assigning weights. For example, if each data point has an error bar (gaussian), then weights is typically assigned (1/error^2).

If you want to assign weight based on the value ("more in numbers"), you can do that, but why? There is a danger in assigning weights arbitrarily. By emphasizing the larger values, you will bias your mean value toward larger values. That bias may or may not be reasonable. In the extreme limit, why not just take the maximum of all of your data points?
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Subsetting an Image with Map Coordinates
Next Topic: cdf2idl, but I need code to WRITE the file

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

Current Time: Wed Oct 08 16:00:47 PDT 2025

Total time taken to generate the page: 0.00398 seconds