Bug 117897 - New plugin to bin one vector w.r.t. another
Summary: New plugin to bin one vector w.r.t. another
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: general (show other bugs)
Version: 1.1.0
Platform: Compiled Sources Linux
: HI wishlist
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-07 22:20 UTC by Andrew Walker
Modified: 2006-06-17 01:01 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Walker 2005-12-07 22:20:26 UTC
Version:           1.1.0 (using KDE KDE 3.4.0)
Installed from:    Compiled From Sources
OS:                Linux

The following was requested by Rodrigo Leonardi:

Binning is a simple and powerful tool for looking at data.
It would be very nice to have a plug-in that allows the user
to bin one vector as a function of another vector and also
produce the respective error bar per bin. For example, if we
want to bin the data as a function of clock angle and look
the error bar per bin (standard deviation/sqrt(N)). The
size of the bin should be a free parameter. And the plug-in
would produce the mean and error per bin for a given vector
expressed as a function of another vector.
Comment 1 Andrew Walker 2005-12-07 22:58:33 UTC
Is this what the syncbin plugin already does? Or something close to it?
Comment 2 Andrew Walker 2006-01-05 01:19:10 UTC
Barth, were you still planning to write this as Rodrigo is keen to get this working? if not I'll go ahead and write it.
Comment 3 Netterfield 2006-01-05 07:33:56 UTC
I'm going to be pretty swamped over the next couple weeks...

The tricky bit is the error bars.  In the absense of an antialiasing filter 
(ie, virtually never) you could just take the standard deviation in each bin 
as the error bar.  But with an antialiasing filter, which correlates 
successive samples this will be substantially wrong.

A heuristic I have used to get around this that has worked very well is to 
average all successive samples which are in the same bin into one sample, and 
then base the error bars on the distribution of these averages.

This can suffer from small number statistic if you don't have enough visits to 
a bin.  A solution is to calculate both types of error bars, calculate the 
mean scale factor to correct the per-sample error bar, and apply this to the 
per-sample error bars.

I would be happy to discuss this more.

cbn

  
On January 4, 2006 04:19 pm, Andrew Walker wrote:
[bugs.kde.org quoted mail]
Comment 4 Andrew Walker 2006-01-05 19:42:25 UTC
Additional information from Rodrigo:

=============================

People often need to see a vector as a function of another
vector (example: signal versus sensor temperature, signal
versus pointing angle, sensor temperature versus other
sensor temperature, and other thousands of possible
combinations). For that reason, I would need something in
KST to solve the following:

Let X and Y be two vectors, and Nx and Ny be, respectively,
the vectors dimension (the number of samples in each one).
In the general case, Nx is not equal to Ny.

Let assume that X = X(t) and Y = Y(t) are function of time.
And in the general case, X and Y have different sample
rates.

Let dx and dy be bin sizes defined by the user. The dx (or
dy) bin can result in expansion or compression of the X (or
Y) vector dimension. We should average for compression and
interpolate for expansion.

The plug-in should select the data given by the
intersection in the time domain of X and Y.

For the set X and Y that belongs to this intersection, we
should be able to quickly plot Y versus X, and also resizes
it with any dx (or/and dy) bin. An error bar per bin in the
plot should be an option in the plug-in.

I emphasize that Nx is not necessarily equal to Ny, and
that the dimensions of X and Y could remain different from
each other after binning. We could compress both vectors,
expand both vectors, compress one and expand the other, or
just plot them exactly as they are. It also would be nice
if the time domain intersection could be easily modified.

Comment 5 Andrew Walker 2006-01-26 19:48:48 UTC
Should be fixed for 1.2.1 release
Comment 6 Netterfield 2006-06-17 01:01:33 UTC
The plugin syncbin does this (It turns out I wrote it ~1.5 years ago and forgot that I had).

Of course, if it doesn't do what is desired, the bug can be re-opened.