Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Graphics > Scientific visualization > Re: How to resa...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 15 of 27 Topic 789 of 833
Post > Topic >>

Re: How to resample continuosly time data to be represented real time

by pamela fluente <pamelafluente@[EMAIL PROTECTED] > May 22, 2008 at 11:22 AM

On 22 Mag, 17:49, LordOfTh...@[EMAIL PROTECTED]
 wrote:
> Perfectly understandable. You are slightly off-topic here but as I
> can't think of anywhere else to give a sartifactory answer, here we
> go...
>
> As previously suggested, box-plotting (AKA candlestick) is the
> appropriate technique for this problem. If the target audience is not
> statistically literate, a simplified version displaying min, max and
> mean (as opposed to quartiles and median) may be preferable; in such a
> case the data required per box could be:-
>
> {
> =A0 =A0float =A0 startTime, endTime;
> =A0 =A0float =A0 sampleMin, sampleMax, sampleTotal;
> =A0 =A0integer sampleCount;
>
> } Box;
>
> You would declare an array of boxes (any more than 128 boxes is likely
> to be a problem for clarity of display) and add one sample value to
> each box until the boxes are filled. Once all boxes are filled with
> the same number of samples, you must then merge pairs of adjacent
> boxes (thus doubling the number of samples per box and halving the
> number of boxes). Subsequent samples are then added to the next free
> box until it has the same number of samples as previous boxes; then
> move onto the next free box and so on. When the boxes are once again
> all filled with the same number of samples, merge pairs of adjacent
> boxes as before.
>
> Merging is a straightforward operation:
>
> mergedBox.startTime=3D MIN(box1.startTime, box2.startTime);
> mergedBox.endTime=3D MIN(box1.endTime, box2.endTime);
> mergedBox.sampleMin=3D MIN(box1.sampleMin, box2.sampleMin);
> mergedBox.endTime=3D MIN(box1.sampleMax, box2.sampleMax);
> mergedBox.sampleTotal=3D box1.sampleTotal + box2.sampleTotal;
> mergedBox.sampleCount=3D box1.sampleCount + box2.sampleCount;
>
> The complexity is all in managing the box data structures; using two
> lists (source and destination) for the merge process will help to make
> it more understandable. Should you require any help with lists, you
> definately should not request it from this group...


Thank you Lord, very kind and helpful of you

 I will keep your suggestion in mind in case I am also asked to to
make the candlestick chart.

For now I have to stock wih the line chart.

By the way I have been revising the initial idea of removing odd-place
terms
by adding the device to do that "piecewise".

Doing that piecewise *is* needed because if I do not do it, then I
get several ****tions with different sampling rate, and the beginning
of the chart becomes smoother and smoother, until it become a line
[that's the previous attempt I have done and discarded]..

Doing it piecewise gives much more acceptable result. We still have
(at most) 2 sampling rates
simultaneously in the chart, but I bet if I do not tell you, your eye
does not notice it.
The difference between 1 second and 2 second rate, or 1 minute and 2
minute
is unnoticeable as the number of terms increase.

Here is the small procedure that I just wrote to do it and seems to
work fine. But it must be changed if
we assume that values are not equispaced or there can be interruptions
(and I can have interruptions).
So now I am looking to creating also a version which solve this second
problem.

Let me know in case of ideas on the best solution.




    Sub KeepListUniformlyResampledWithinBound(ByRef MyList As List(Of
ObservedValue), _
                                              ByVal ListCountBound As
Integer, _
                                              ByRef ValuesProcessed As
Integer, _
                                              ByVal PreservedMin As
Double, _
                                              ByVal PreservedMax As
Double)

        If MyList.Count < ListCountBound Then Exit Sub

        'Resampling

        Dim NumberOfRemovedItems As Integer
        Dim NumberOfKeptItems As Integer

        For i As Integer =3D MyList.Count - ValuesProcessed - 1 To 0
Step -1

            Dim Value As Double =3D MyList(i).Value

            If i Mod 2 =3D 1 AndAlso Value <> PreservedMin AndAlso Value
<> PreservedMax Then
                MyList.RemoveAt(i)
                NumberOfRemovedItems +=3D 1
            Else
                NumberOfKeptItems +=3D 1
            End If
        Next i

        ValuesProcessed +=3D NumberOfKeptItems

        If NumberOfRemovedItems <=3D 1 Then ValuesProcessed =3D 0

    End Sub


Where, as said before, ObservedValue represents the pair Time, Value:


    <Serializable()> Public Class ObservedValue

        Sub New(ByVal Value As Double, ByVal Instant As Date)
            Me.Value =3D Value
            Me.Instant =3D Instant
        End Sub

        Public Value As Double
        Public Instant As Date

    End Class
 




 27 Posts in Topic:
How to resample continuosly time data to be represented real tim
pamela fluente <pamela  2008-05-21 03:50:34 
Re: How to resample continuosly time data to be represented real
"Skybuck Flying"  2008-05-21 14:54:10 
Re: How to resample continuosly time data to be represented real
pamela fluente <pamela  2008-05-21 07:10:14 
Re: How to resample continuosly time data to be represented real
"Skybuck Flying"  2008-05-21 23:25:09 
Re: How to resample continuosly time data to be represented real
"Skybuck Flying"  2008-05-21 23:28:00 
Re: How to resample continuosly time data to be represented real
"Skybuck Flying"  2008-05-21 23:37:43 
Re: How to resample continuosly time data to be represented real
"Paul E. Black"  2008-05-21 12:54:25 
Re: How to resample continuosly time data to be represented real
pamela fluente <pamela  2008-05-21 15:28:16 
Re: How to resample continuosly time data to be represented real
"Skybuck Flying"  2008-05-22 01:10:43 
Re: How to resample continuosly time data to be represented real
pamela fluente <pamela  2008-05-21 16:55:23 
Re: How to resample continuosly time data to be represented real
"Skybuck Flying"  2008-05-22 08:32:16 
Re: How to resample continuosly time data to be represented real
pamela fluente <pamela  2008-05-22 02:45:37 
Re: How to resample continuosly time data to be represented real
"Skybuck Flying"  2008-05-23 04:22:23 
Re: How to resample continuosly time data to be represented real
LordOfThePi@[EMAIL PROTEC  2008-05-22 08:49:59 
Re: How to resample continuosly time data to be represented real
pamela fluente <pamela  2008-05-22 11:22:21 
Re: How to resample continuosly time data to be represented real
"Skybuck Flying"  2008-05-23 04:31:17 
Re: How to resample continuosly time data to be represented real
"Skybuck Flying"  2008-05-23 05:19:32 
Re: How to resample continuosly time data to be represented real
"Skybuck Flying"  2008-05-23 05:43:27 
Re: How to resample continuosly time data to be represented real
"Skybuck Flying"  2008-05-23 05:53:25 
Re: How to resample continuosly time data to be represented real
"Skybuck Flying"  2008-05-23 06:00:57 
Re: How to resample continuosly time data to be represented real
"Skybuck Flying"  2008-05-23 06:02:22 
Re: How to resample continuosly time data to be represented real
"Skybuck Flying"  2008-05-23 06:18:23 
Re: How to resample continuosly time data to be represented real
pamela fluente <pamela  2008-05-23 11:01:15 
Re: How to resample continuosly time data to be represented real
Patricia Shanahan <pat  2008-05-27 05:52:42 
Re: How to resample continuosly time data to be represented real
"Skybuck Flying"  2008-05-28 19:57:24 
Re: How to resample continuosly time data to be represented real
"Skybuck Flying"  2008-05-28 20:03:12 
Re: How to resample continuosly time data to be represented real
pamela fluente <pamela  2008-06-18 10:30:44 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 14:58:17 CST 2008.