Outlier Removal Problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Outlier Removal Problem

    Hi all, I am testing the outlier removal and how it works. Okay, so I made 50 generic points. 48 of these points share the nominal and measured value. I gave 2 points a deviation of 0.02 and the other one -0.001. The constructed line has an error of 0.021

    Then I calculated the standard deviation of these points, and this was 0.00294, so I think that with std.dev of 2 it will filter the point with deviation of 0.02, but it should not filter the point with deviation of -0.001, because with a standarddeviation of 2 it should remove points with a deviation higher than 0.00588 .However, PC-DMIS filters also the point with the deviation of -0.001?? Using a std.dev of 3 I'll receive an error of 0.000.

    Can anyone explain why this is happening?

  • #2
    numerically along the line, where are your deviation points (hitnum) if they are hits 48 49 and 50, that's why.
    outlier removal will pull/omit hits before and after the outlier as well, depending on the values you set.
    try the same study with the outliers spaced many points apart from each other (like outlier 1 at hitnum10, outlier 2 at hitnum25, and outlier 3 at hitnum45.

    Comment


    • #3
      I tried your suggestion and point 10 had a deviation of 0.02 and point 30 a deviation of 0.001, but both points were removed.

      Comment


      • #4
        Are you constructing a 2D or 3D line? For 2D lines the deviation is calculated in a plane parallel to the workplane.
        153010 Global Advantage w/ LSPX1H_T Analog Probe
        7107 Global Classic TP20
        2019R1 SP1 CAD++

        Comment


        • #5
          I am constructing a 2D line in the correct workplane. Without outlier removal I have an error in the line.

          Comment


          • #6
            With k=2, PC-DMIS should keep #95% of hits.
            Here, it's the case, even if I agree with your calculation.
            Maybe you could try to give a deviation to all hits, by a randomize, and then look at the result ?

            Comment


            • #7
              I gave a random deviation for all points and now I am lost I have used underneath 41 points for the Z with an interval of X=X+1.

              So I checked in PC-DMIS the following: with no outlier filter I have 41. With std.dev I get 37 points, with std.dev 2 I get 41 points and ofcourse with std.dev 3 I get 41 points. With my calculation it should filter more points..

              Then I started thinking that perhaps I have to calculate the deviation distance to the mean line?? I opened Excel and calculated the gaussian line of these points and took the deviation to the gaussian line, but this should filter even more points, therefore, this is also not the case.

              I am starting to wonder how this works :P I am clueless haha


              EDIT: JEFMAN I always thought that the percentage was just a statistical prediction, but it is not used for the filter??
              Z
              5.5125
              5.292
              5.076
              4.8645
              4.6575
              4.455
              4.257
              4.0635
              3.8745
              3.69
              3.51
              3.3345
              3.1635
              2.997
              2.835
              2.6775
              2.5245
              2.376
              2.232
              2.0925
              1.9575
              1.827
              1.701
              1.5795
              1.4625
              1.35
              1.242
              1.1385
              1.0395
              0.945
              0.855
              0.7695
              0.6885
              0.612
              0.54
              0.4725
              0.4095
              0.351
              0.297
              0.2475
              0.1
              Last edited by MihaelR; 01-03-2019, 03:31 PM.

              Comment


              • #8
                Can you try with those values (I'm not at the cmm to check).
                Z rand
                5.00537862
                4.77435693
                4.67172693
                4.69385373
                4.43295132
                4.3188786
                4.19132198
                4.02837584
                3.95018984
                3.73790713
                3.55835163
                3.47753672
                3.33401236
                3.03973443
                3.03709941
                3.05773258
                2.92757547
                2.6034731
                2.64866511
                2.46525985
                2.43629227
                2.03184034
                2.08419986
                1.88407139
                1.75200592
                1.6902963
                1.59218985
                1.3409968
                1.16127863
                1.09193787
                1.05959938
                0.65265639
                0.76917042
                0.44663304
                0.38691133
                0.45425183
                0.13792142
                0.22952643
                -0.27587662
                -0.27532787
                -0.47192802
                I don't know how you randomized your values, but it seems to be very regular... (your values are Z init, mine are z rand)


                graph init.JPG

                Then, if you calculate the standard deviation of distances to the line, it should give this :

                graph dev.JPG
                So there should be two points outliers.

                Comment


                • #9
                  JEFMAN , is it typical of a CMM to discard anything past 2sigma? One of our machines throws away anything outside of 3...

                  Comment


                  • #10
                    I often use 3 also, except in vision.
                    Here I took 2 just to have some points out !

                    Comment


                    • JacobCheverie
                      JacobCheverie commented
                      Editing a comment
                      Okay, that makes sense. When it comes to vision, are you more or less strict on your outlier elimination?

                      Sorry MihaelR , I didn't mean to hijack your thread

                  • #11
                    JacobCheverie , I use between 1.5 and 2, depends on the part quality.

                    Comment


                    • #12
                      JEFMAN I have tried it with your random points and got the following thing in Excel:

                      EDIT New picture (forgot to use the abs value for stdev)

                      checkOutlier.PNG
                      Then it should filter 8 points with std.dev1. Stdev2 should filter 2 point.

                      In PC-DMIS I took those points and with outlier stdev2 It did not filter any points.With stdev 1 it filtered 3 points. So PC-DMIS does not follow the method what I had simulated in Excel.I have attached my PC-DMIS code

                      Code:
                      F1         =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                                  NOM/XYZ,<1,0,0>,$
                                  MEAS/XYZ,<1,0,5.005>,$
                                  NOM/IJK,<0,0,1>,$
                                  MEAS/IJK,<0,0,1>
                      F2         =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                                  NOM/XYZ,<0,0,0>,$
                                  MEAS/XYZ,<2,0,4.774>,$
                                  NOM/IJK,<0,0,1>,$
                                  MEAS/IJK,<0,0,1>
                      F3         =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                                  NOM/XYZ,<0,0,0>,$
                                  MEAS/XYZ,<3,0,4.672>,$
                                  NOM/IJK,<0,0,1>,$
                                  MEAS/IJK,<0,0,1>
                      F4         =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                                  NOM/XYZ,<0,0,0>,$
                                  MEAS/XYZ,<4,0,4.694>,$
                                  NOM/IJK,<0,0,1>,$
                                  MEAS/IJK,<0,0,1>
                      F5         =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                                  NOM/XYZ,<0,0,0>,$
                                  MEAS/XYZ,<5,0,4.433>,$
                                  NOM/IJK,<0,0,1>,$
                                  MEAS/IJK,<0,0,1>
                      F6         =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                                  NOM/XYZ,<0,0,0>,$
                                  MEAS/XYZ,<5,0,4.319>,$
                                  NOM/IJK,<0,0,1>,$
                                  MEAS/IJK,<0,0,1>
                      F7         =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                                  NOM/XYZ,<0,0,0>,$
                                  MEAS/XYZ,<6,0,4.191>,$
                                  NOM/IJK,<0,0,1>,$
                                  MEAS/IJK,<0,0,1>
                      F8         =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                                  NOM/XYZ,<0,0,0>,$
                                  MEAS/XYZ,<7,0,4.028>,$
                                  NOM/IJK,<0,0,1>,$
                                  MEAS/IJK,<0,0,1>
                      F9         =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                                  NOM/XYZ,<0,0,0>,$
                                  MEAS/XYZ,<8,0,3.95>,$
                                  NOM/IJK,<0,0,1>,$
                                  MEAS/IJK,<0,0,1>
                      F10        =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                                  NOM/XYZ,<0,0,0>,$
                                  MEAS/XYZ,<9,0,3.738>,$
                                  NOM/IJK,<0,0,1>,$
                                  MEAS/IJK,<0,0,1>
                      F11        =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                                  NOM/XYZ,<0,0,0>,$
                                  MEAS/XYZ,<10,0,3.558>,$
                                  NOM/IJK,<0,0,1>,$
                                  MEAS/IJK,<0,0,1>
                      F12        =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                                  NOM/XYZ,<0,0,0>,$
                                  MEAS/XYZ,<11,0,3.478>,$
                                  NOM/IJK,<0,0,1>,$
                                  MEAS/IJK,<0,0,1>
                      F13        =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                                  NOM/XYZ,<0,0,0>,$
                                  MEAS/XYZ,<12,0,3.334>,$
                                  NOM/IJK,<0,0,1>,$
                                  MEAS/IJK,<0,0,1>
                      F14        =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                                  NOM/XYZ,<0,0,0>,$
                                  MEAS/XYZ,<13,0,3.04>,$
                                  NOM/IJK,<0,0,1>,$
                                  MEAS/IJK,<0,0,1>
                      F15        =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                                  NOM/XYZ,<0,0,0>,$
                                  MEAS/XYZ,<14,0,3.037>,$
                                  NOM/IJK,<0,0,1>,$
                                  MEAS/IJK,<0,0,1>
                      F16        =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                                  NOM/XYZ,<0,0,0>,$
                                  MEAS/XYZ,<15,0,3.058>,$
                                  NOM/IJK,<0,0,1>,$
                                  MEAS/IJK,<0,0,1>
                      F17        =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                                  NOM/XYZ,<0,0,0>,$
                                  MEAS/XYZ,<16,0,2.928>,$
                                  NOM/IJK,<0,0,1>,$
                                  MEAS/IJK,<0,0,1>
                      F18        =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                                  NOM/XYZ,<0,0,0>,$
                                  MEAS/XYZ,<17,0,2.603>,$
                                  NOM/IJK,<0,0,1>,$
                                  MEAS/IJK,<0,0,1>
                      F19        =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                                  NOM/XYZ,<0,0,0>,$
                                  MEAS/XYZ,<18,0,2.649>,$
                                  NOM/IJK,<0,0,1>,$
                                  MEAS/IJK,<0,0,1>
                      F20        =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                                  NOM/XYZ,<0,0,0>,$
                                  MEAS/XYZ,<19,0,2.465>,$
                                  NOM/IJK,<0,0,1>,$
                                  MEAS/IJK,<0,0,1>
                      F21        =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                                  NOM/XYZ,<0,0,0>,$
                                  MEAS/XYZ,<20,0,2.436>,$
                                  NOM/IJK,<0,0,1>,$
                                  MEAS/IJK,<0,0,1>
                      F22        =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                                  NOM/XYZ,<0,0,0>,$
                                  MEAS/XYZ,<21,0,2.032>,$
                                  NOM/IJK,<0,0,1>,$
                                  MEAS/IJK,<0,0,1>
                      F23        =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                                  NOM/XYZ,<0,0,0>,$
                                  MEAS/XYZ,<22,0,2.084>,$
                                  NOM/IJK,<0,0,1>,$
                                  MEAS/IJK,<0,0,1>
                      F24        =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                                  NOM/XYZ,<0,0,0>,$
                                  MEAS/XYZ,<23,0,1.884>,$
                                  NOM/IJK,<0,0,1>,$
                                  MEAS/IJK,<0,0,1>
                      F25        =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                                  NOM/XYZ,<0,0,0>,$
                                  MEAS/XYZ,<24,0,1.752>,$
                                  NOM/IJK,<0,0,1>,$
                                  MEAS/IJK,<0,0,1>
                      F26        =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                                  NOM/XYZ,<0,0,0>,$
                                  MEAS/XYZ,<25,0,1.69>,$
                                  NOM/IJK,<0,0,1>,$
                                  MEAS/IJK,<0,0,1>
                      F27        =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                                  NOM/XYZ,<0,0,0>,$
                                  MEAS/XYZ,<26,0,1.592>,$
                                  NOM/IJK,<0,0,1>,$
                                  MEAS/IJK,<0,0,1>
                      F28        =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                                  NOM/XYZ,<0,0,0>,$
                                  MEAS/XYZ,<27,0,1.341>,$
                                  NOM/IJK,<0,0,1>,$
                                  MEAS/IJK,<0,0,1>
                      F29        =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                                  NOM/XYZ,<0,0,0>,$
                                  MEAS/XYZ,<28,0,1.161>,$
                                  NOM/IJK,<0,0,1>,$
                                  MEAS/IJK,<0,0,1>
                      F30        =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                                  NOM/XYZ,<0,0,0>,$
                                  MEAS/XYZ,<29,0,1.092>,$
                                  NOM/IJK,<0,0,1>,$
                                  MEAS/IJK,<0,0,1>
                      F31        =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                                  NOM/XYZ,<0,0,0>,$
                                  MEAS/XYZ,<30,0,1.06>,$
                                  NOM/IJK,<0,0,1>,$
                                  MEAS/IJK,<0,0,1>
                      F32        =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                                  NOM/XYZ,<0,0,0>,$
                                  MEAS/XYZ,<31,0,0.653>,$
                                  NOM/IJK,<0,0,1>,$
                                  MEAS/IJK,<0,0,1>
                      F33        =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                                  NOM/XYZ,<0,0,0>,$
                                  MEAS/XYZ,<32,0,0.769>,$
                                  NOM/IJK,<0,0,1>,$
                                  MEAS/IJK,<0,0,1>
                      F34        =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                                  NOM/XYZ,<0,0,0>,$
                                  MEAS/XYZ,<33,0,0.447>,$
                                  NOM/IJK,<0,0,1>,$
                                  MEAS/IJK,<0,0,1>
                      F35        =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                                  NOM/XYZ,<0,0,0>,$
                                  MEAS/XYZ,<34,0,0.387>,$
                                  NOM/IJK,<0,0,1>,$
                                  MEAS/IJK,<0,0,1>
                      F36        =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                                  NOM/XYZ,<0,0,0>,$
                                  MEAS/XYZ,<35,0,0.454>,$
                                  NOM/IJK,<0,0,1>,$
                                  MEAS/IJK,<0,0,1>
                      F37        =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                                  NOM/XYZ,<0,0,0>,$
                                  MEAS/XYZ,<36,0,0.138>,$
                                  NOM/IJK,<0,0,1>,$
                                  MEAS/IJK,<0,0,1>
                      F38        =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                                  NOM/XYZ,<0,0,0>,$
                                  MEAS/XYZ,<37,0,0.23>,$
                                  NOM/IJK,<0,0,1>,$
                                  MEAS/IJK,<0,0,1>
                      F39        =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                                  NOM/XYZ,<0,0,0>,$
                                  MEAS/XYZ,<38,0,-0.276>,$
                                  NOM/IJK,<0,0,1>,$
                                  MEAS/IJK,<0,0,1>
                      F40        =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                                  NOM/XYZ,<0,0,0>,$
                                  MEAS/XYZ,<39,0,-0.275>,$
                                  NOM/IJK,<0,0,1>,$
                                  MEAS/IJK,<0,0,1>
                      F41        =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                                  NOM/XYZ,<0,0,0>,$
                                  MEAS/XYZ,<40,0,-0.472>,$
                                  NOM/IJK,<0,0,1>,$
                                  MEAS/IJK,<0,0,1>
                                  WORKPLANE/YPLUS
                      LIN1       =FEAT/LINE,CARTESIAN,UNBOUNDED,NO
                                  THEO/<1,0,0>,<-1,0,0>
                                  ACTL/<40.007,0,-0.422>,<-0.9908243,0,0.135156>
                                  CONSTR/LINE,BF,2D,F41,F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11,F12,F13,F14,F15,F16,F17,F18,F19,F20,F21,F22,F23,F24,F25,F26,F27,F28,F29,F30,F31,F32,F33,F34,F35,F36,F37,F38,F39,F40,,
                                  OUTLIER_REMOVAL/ON,1
                                  FILTER/OFF,WAVELENGTH=0
                                  ASSIGN/V1=LIN1.NUMHITS
                      Attached Files
                      Last edited by MihaelR; 01-04-2019, 12:36 PM.

                      Comment


                      • #13
                        From an old manual :
                        Remove Outliers check box
                        If you select the Remove outliers check box in the Construct Filter Feature dialog box (Insert | Feature | Constructed | Filter), PC-DMIS attempts to remove all points a given number of standard deviations from the substitute feature (usually a circle or a line). You specify the number of standard deviations in the Standard deviation multiple box. See the "Standard Deviation Multiple box".
                        Outlier removal behaves similar to filtering:
                        • If you select the Linear option, outlier removal is based on the 3D distance from the point in question to the line (best fit line through the data).
                        • If you select the Polar option, outlier removal occurs in the radial direction (parallel to the workplane).
                        Standard Deviation Multiple box
                        The Standard deviation multiple value in the Construct Filter Feature dialog box (Insert | Feature | Constructed | Filter) determines the number of standard deviations from the substitute (least squares) feature beyond which points are identified as outliers. The default value is 3.


                        Maybe there's a bug ?
                        I often have a doubt about filtering, but never have enough time to check it...

                        I was also wondering why my values were a little different than yours, it's just because I begin at 0 instead of 1 !!!

                        Comment


                        • #14
                          Here is the explanation (from core manual) :

                          Remove Outliers / Standard Deviation Multiple
                          For a best fit (BF) or best fit recompensate (BFRE) line, you can choose to remove outliers based on the distance from the best fit feature. This allows the removal of anomalies that arise in the measurement process.
                          PC-DMIS first fits a line to the data and then determines which points are outliers based on the value in the Standard Deviation Multiple box. It then does the following:
                          • Recalculates the best fit line with those outliers removed.
                          • Checks for outliers again.
                          • Recalculates the best fit line.
                          • Continues to repeat this process until no more outliers exist or until PC-DMIS cannot compute the line. (PC-DMIS can't compute the line if there are fewer than three data points.)
                          For 2D lines, the deviation is calculated in a plane parallel to the workplane.
                          For 3D lines, the deviation is computed as the distance from the measured point to the nearest point along the line.


                          So using once the std dev as we can do in Excel is not enough (even if it's more logical !!!!!!!)

                          Comment


                          • #15
                            JEFMAN - my first reaction when reading that was "will there ever be more than three points left?" As sigma goes down on each iteration (we removed at least one 'outlier') new points will be found to be 'outliers'...

                            AndersI
                            SW support - Hexagon Metrology Nordic AB

                            Comment

                            widgetinstance 190 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                            Working...
                            X