Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reduce to zero
Message
 
 
To
05/02/2009 12:42:29
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01379529
Message ID:
01379564
Views:
25
Jos,

The actual root problem greatly helps! If I were approaching this "noisy data" problem, I would not alter the raw data because you have no auditability. What I'd do is store all of the raw data, gather the evidence of errors and use that to get the 3rd party to provide better data.

At display time I think you can choose to display "filtered results", something like ignore data points that have a deviation of N sigma from the average over a sliding window of days. What this would do is smooth the curve it would also time skew it so the plots would not show large changes in value until a day or two later. This may or may not be acceptable. You have to make sure that everyone understands the effects of the data display filters going into it.

>The problem I have is this: I get sent some data from a 3rd party. Values are in the range from 0 to +/-1000 or so. Sometimes the 3rd party makes a mistake and a data element may be accidentally set to zero. Then the next day I may get a non-zero value again, going back to the correct data range. This creates a data spike to zero which looks bad on a line chart (each individual point is not particularly important per se – rather the general trend of the data is).
>
>So I want to say if the data today is zero, but the previous point is not, then assume the zero value is an error. To avoid a spike just reduce the previous value by some amount. If the next day the value is zero again then I will again reduce the previous value (already reduced) by some amount. If the data has truly fallen to zero then within a finite/limited number of steps the data will reduce steadily to zero as well and no spike in the plot is shown – rather the data just trails off to zero.
>
>I don’t know if the previous data point has already been reduced or not and I don’t know when the first zero value occurred (unless I program and store additional info which I dont want to do). Hence I need a formula to just reduce a previous value by some amount if the current value is zero. And to be able to repeat that process a finite number of times so that eventually, if the data truly is now zero, that the data will fall to zero. The purpose here is to avoid data spikes caused by errors in the data.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform