Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. One for the math/stats buffs.

One for the math/stats buffs.

Scheduled Pinned Locked Moved The Lounge
helpquestion
30 Posts 15 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Brady Kelly
    wrote on last edited by
    #1

    I have a range of values (voltage) over time (thousands of minutes, one value per minute). I am trying to chart these. Determining the length of my Y axis is quite a problem for me. If I take a minimum and maximum, and use that as the axis height, one or two zero values result in all the others being scrunched up at the top of the chart. If I remove zeroes, it looks much better, and for a chart, they aren't very important, I'll give all real values in a tabular report. What I would like to do is determine the average height of the band of data points, sort of the space between the moving average of the low points and that of the heigh points. I figure to do that, I would need a median series, so I could determine a smoothed series of points above and below median, and make my Y axis 's' higher and 's' lower than those. How do people normally do this?

    K B CPalliniC L R 12 Replies Last reply
    0
    • B Brady Kelly

      I have a range of values (voltage) over time (thousands of minutes, one value per minute). I am trying to chart these. Determining the length of my Y axis is quite a problem for me. If I take a minimum and maximum, and use that as the axis height, one or two zero values result in all the others being scrunched up at the top of the chart. If I remove zeroes, it looks much better, and for a chart, they aren't very important, I'll give all real values in a tabular report. What I would like to do is determine the average height of the band of data points, sort of the space between the moving average of the low points and that of the heigh points. I figure to do that, I would need a median series, so I could determine a smoothed series of points above and below median, and make my Y axis 's' higher and 's' lower than those. How do people normally do this?

      K Offline
      K Offline
      Kenneth Haugland
      wrote on last edited by
      #2

      Well, down sample and send the result trough a low-pass filter. (That's a lot of work though) Edit: Been a while since I did this, seems the order should be reversed: http://en.wikipedia.org/wiki/Decimation_(signal_processing)[^]

      B 1 Reply Last reply
      0
      • K Kenneth Haugland

        Well, down sample and send the result trough a low-pass filter. (That's a lot of work though) Edit: Been a while since I did this, seems the order should be reversed: http://en.wikipedia.org/wiki/Decimation_(signal_processing)[^]

        B Offline
        B Offline
        Brady Kelly
        wrote on last edited by
        #3

        Yeah, a but much for a simple charting app. Why a low pass, by the way?

        K 1 Reply Last reply
        0
        • B Brady Kelly

          Yeah, a but much for a simple charting app. Why a low pass, by the way?

          K Offline
          K Offline
          Kenneth Haugland
          wrote on last edited by
          #4

          Anti aliasing. If you just down-sample all the values could be wrong, if you put them trough a low-pass filter it would be much better, and you would be guaranteed not to get only zeros. http://dali.feld.cvut.cz/ucebna/matlab/toolbox/signal/decimate.html[^]

          1 Reply Last reply
          0
          • B Brady Kelly

            I have a range of values (voltage) over time (thousands of minutes, one value per minute). I am trying to chart these. Determining the length of my Y axis is quite a problem for me. If I take a minimum and maximum, and use that as the axis height, one or two zero values result in all the others being scrunched up at the top of the chart. If I remove zeroes, it looks much better, and for a chart, they aren't very important, I'll give all real values in a tabular report. What I would like to do is determine the average height of the band of data points, sort of the space between the moving average of the low points and that of the heigh points. I figure to do that, I would need a median series, so I could determine a smoothed series of points above and below median, and make my Y axis 's' higher and 's' lower than those. How do people normally do this?

            B Offline
            B Offline
            BillWoodruff
            wrote on last edited by
            #5

            I would post a question in the Algorithms forum here on CodeProject.

            « I had therefore to remove knowledge, in order to make room for belief » Immanuel Kant

            1 Reply Last reply
            0
            • B Brady Kelly

              I have a range of values (voltage) over time (thousands of minutes, one value per minute). I am trying to chart these. Determining the length of my Y axis is quite a problem for me. If I take a minimum and maximum, and use that as the axis height, one or two zero values result in all the others being scrunched up at the top of the chart. If I remove zeroes, it looks much better, and for a chart, they aren't very important, I'll give all real values in a tabular report. What I would like to do is determine the average height of the band of data points, sort of the space between the moving average of the low points and that of the heigh points. I figure to do that, I would need a median series, so I could determine a smoothed series of points above and below median, and make my Y axis 's' higher and 's' lower than those. How do people normally do this?

              CPalliniC Offline
              CPalliniC Offline
              CPallini
              wrote on last edited by
              #6

              Can you exclude the zeroes as 'out-of-statistic' or are they just 'the interesting pieces of data in the data set'?

              THESE PEOPLE REALLY BOTHER ME!! How can they know what you should do without knowing what you want done?!?! -- C++ FQA Lite

              In testa che avete, signor di Ceprano?

              B 1 Reply Last reply
              0
              • B Brady Kelly

                I have a range of values (voltage) over time (thousands of minutes, one value per minute). I am trying to chart these. Determining the length of my Y axis is quite a problem for me. If I take a minimum and maximum, and use that as the axis height, one or two zero values result in all the others being scrunched up at the top of the chart. If I remove zeroes, it looks much better, and for a chart, they aren't very important, I'll give all real values in a tabular report. What I would like to do is determine the average height of the band of data points, sort of the space between the moving average of the low points and that of the heigh points. I figure to do that, I would need a median series, so I could determine a smoothed series of points above and below median, and make my Y axis 's' higher and 's' lower than those. How do people normally do this?

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                I use Nplot for charting: http://netcontrols.org/nplot/wiki/[^] It has the source too if you want to look under the hood.

                Richard Andrew x64R B 2 Replies Last reply
                0
                • B Brady Kelly

                  I have a range of values (voltage) over time (thousands of minutes, one value per minute). I am trying to chart these. Determining the length of my Y axis is quite a problem for me. If I take a minimum and maximum, and use that as the axis height, one or two zero values result in all the others being scrunched up at the top of the chart. If I remove zeroes, it looks much better, and for a chart, they aren't very important, I'll give all real values in a tabular report. What I would like to do is determine the average height of the band of data points, sort of the space between the moving average of the low points and that of the heigh points. I figure to do that, I would need a median series, so I could determine a smoothed series of points above and below median, and make my Y axis 's' higher and 's' lower than those. How do people normally do this?

                  R Offline
                  R Offline
                  RTek23
                  wrote on last edited by
                  #8

                  what are you using to do the charting..?

                  B 1 Reply Last reply
                  0
                  • L Lost User

                    I use Nplot for charting: http://netcontrols.org/nplot/wiki/[^] It has the source too if you want to look under the hood.

                    Richard Andrew x64R Offline
                    Richard Andrew x64R Offline
                    Richard Andrew x64
                    wrote on last edited by
                    #9

                    Looks like that project has been abandoned for some time.

                    The difficult we do right away... ...the impossible takes slightly longer.

                    L 1 Reply Last reply
                    0
                    • Richard Andrew x64R Richard Andrew x64

                      Looks like that project has been abandoned for some time.

                      The difficult we do right away... ...the impossible takes slightly longer.

                      L Offline
                      L Offline
                      Lost User
                      wrote on last edited by
                      #10

                      Looks like you are right, the source is still available here: http://sourceforge.net/p/nplot/code/HEAD/tree/[^]

                      1 Reply Last reply
                      0
                      • R RTek23

                        what are you using to do the charting..?

                        B Offline
                        B Offline
                        Brady Kelly
                        wrote on last edited by
                        #11

                        OxyPlot. It's really quite good looking at their examples,but documentation is dismal.

                        R 1 Reply Last reply
                        0
                        • CPalliniC CPallini

                          Can you exclude the zeroes as 'out-of-statistic' or are they just 'the interesting pieces of data in the data set'?

                          THESE PEOPLE REALLY BOTHER ME!! How can they know what you should do without knowing what you want done?!?! -- C++ FQA Lite

                          B Offline
                          B Offline
                          Brady Kelly
                          wrote on last edited by
                          #12

                          It gets quite sweet when I exclude the zeroes. The chart then spreads across the Y axis nicely.

                          CPalliniC P 2 Replies Last reply
                          0
                          • L Lost User

                            I use Nplot for charting: http://netcontrols.org/nplot/wiki/[^] It has the source too if you want to look under the hood.

                            B Offline
                            B Offline
                            Brady Kelly
                            wrote on last edited by
                            #13

                            Doesn't look like it does WPF though. OxyPlot also provides source, and operates on most .NET platforms.

                            1 Reply Last reply
                            0
                            • B Brady Kelly

                              It gets quite sweet when I exclude the zeroes. The chart then spreads across the Y axis nicely.

                              CPalliniC Offline
                              CPalliniC Offline
                              CPallini
                              wrote on last edited by
                              #14

                              I see. But what is the physical reason of such zeroes (e.g. spurious measure values, ...) ?

                              THESE PEOPLE REALLY BOTHER ME!! How can they know what you should do without knowing what you want done?!?! -- C++ FQA Lite

                              In testa che avete, signor di Ceprano?

                              B 1 Reply Last reply
                              0
                              • CPalliniC CPallini

                                I see. But what is the physical reason of such zeroes (e.g. spurious measure values, ...) ?

                                THESE PEOPLE REALLY BOTHER ME!! How can they know what you should do without knowing what you want done?!?! -- C++ FQA Lite

                                B Offline
                                B Offline
                                Brady Kelly
                                wrote on last edited by
                                #15

                                Maybe that, maybe power outages. We get zero volts in the house quite frequently.

                                1 Reply Last reply
                                0
                                • B Brady Kelly

                                  I have a range of values (voltage) over time (thousands of minutes, one value per minute). I am trying to chart these. Determining the length of my Y axis is quite a problem for me. If I take a minimum and maximum, and use that as the axis height, one or two zero values result in all the others being scrunched up at the top of the chart. If I remove zeroes, it looks much better, and for a chart, they aren't very important, I'll give all real values in a tabular report. What I would like to do is determine the average height of the band of data points, sort of the space between the moving average of the low points and that of the heigh points. I figure to do that, I would need a median series, so I could determine a smoothed series of points above and below median, and make my Y axis 's' higher and 's' lower than those. How do people normally do this?

                                  M Offline
                                  M Offline
                                  Mark_Wallace
                                  wrote on last edited by
                                  #16

                                  Use either a Venn diagram, a pie chart, or a swim-lanes chart, because those three are, without a doubt, the most incredibly useful and versatile charts that have ever been invented and will ever be invented.

                                  I wanna be a eunuchs developer! Pass me a bread knife!

                                  1 Reply Last reply
                                  0
                                  • B Brady Kelly

                                    OxyPlot. It's really quite good looking at their examples,but documentation is dismal.

                                    R Offline
                                    R Offline
                                    RTek23
                                    wrote on last edited by
                                    #17

                                    Neat. took a look, but did see any way to implement the low pass filter idea....you could implement outside the livrary by averaging the previous 10 readings (1-10)- or whatever value you like....the greater, the smoother- values to average, then 2-11 etc. I had a several day temperature test that had the occasional dropout/communication error that resulted in a similar waveform, everything scrunched at the top and spikes to 0. In that volume of air, there is no way it could spike like that, so it was a realistic solution....if your voltages are similar it might be a solution...or it could mask a real problem..... Ken

                                    1 Reply Last reply
                                    0
                                    • B Brady Kelly

                                      I have a range of values (voltage) over time (thousands of minutes, one value per minute). I am trying to chart these. Determining the length of my Y axis is quite a problem for me. If I take a minimum and maximum, and use that as the axis height, one or two zero values result in all the others being scrunched up at the top of the chart. If I remove zeroes, it looks much better, and for a chart, they aren't very important, I'll give all real values in a tabular report. What I would like to do is determine the average height of the band of data points, sort of the space between the moving average of the low points and that of the heigh points. I figure to do that, I would need a median series, so I could determine a smoothed series of points above and below median, and make my Y axis 's' higher and 's' lower than those. How do people normally do this?

                                      A Offline
                                      A Offline
                                      Andy Brummer
                                      wrote on last edited by
                                      #18

                                      What you might want to do is outlyer detection, and just encode those results with some kind of symbol on the chart like a red line or something like that. Or, as others have said, just drop them and leave them as gaps. Also, you can compute the median and standard deviation for your series, and then just plot everything within a few standard deviations of the median, which should be pretty close to the same thing.

                                      Curvature of the Mind now with 3D

                                      B 1 Reply Last reply
                                      0
                                      • A Andy Brummer

                                        What you might want to do is outlyer detection, and just encode those results with some kind of symbol on the chart like a red line or something like that. Or, as others have said, just drop them and leave them as gaps. Also, you can compute the median and standard deviation for your series, and then just plot everything within a few standard deviations of the median, which should be pretty close to the same thing.

                                        Curvature of the Mind now with 3D

                                        B Offline
                                        B Offline
                                        Brady Kelly
                                        wrote on last edited by
                                        #19

                                        How do I calculate the median. That would be a straight line - I want a 'median' between lows and highs that moves up and down with the lows and highs. I suppose I could do it point for point and calculate a median curve.

                                        A 2 Replies Last reply
                                        0
                                        • B Brady Kelly

                                          How do I calculate the median. That would be a straight line - I want a 'median' between lows and highs that moves up and down with the lows and highs. I suppose I could do it point for point and calculate a median curve.

                                          A Offline
                                          A Offline
                                          Andy Brummer
                                          wrote on last edited by
                                          #20

                                          Ok, that gets into how you display the data. For a single static graph, I'd do it for the entire graph. That would give the bounds for the entire image. If I was calculating a rolling average, I'd plot that as a curve overlay on top of the existing data. Check out various stock charts for that kind of visualization. To calculate a rolling average, you just assign a window to each point, for example the last 30 data points and calculate the statistics on that window. The trick is really to use a window that makes sense for the underlying data.

                                          Curvature of the Mind now with 3D

                                          B 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups