Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #11323 > unrolled thread

Removing Outliers from List

Started byMurta <rodrigomurtax@gmail.com>
First post2012-08-14 08:21 +0000
Last post2012-08-14 08:21 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Removing Outliers from List Murta <rodrigomurtax@gmail.com> - 2012-08-14 08:21 +0000

#11323 — Removing Outliers from List

FromMurta <rodrigomurtax@gmail.com>
Date2012-08-14 08:21 +0000
SubjectRemoving Outliers from List
Message-ID<k0d1pc$lu1$1@smc.vnet.net>
Hi All

    Some simple idea on how to remove the outliers from a list like this?:

    l={24, 24, 3, 2, 1, 1, 1, 1}

    to get this:
    
    l={3, 2, 1, 1, 1, 1}

I have one complicated one that need a lower sigma parameter to work:
------------------------------------------------
l={24, 24, 3, 2, 1, 1, 1, 1}

removeNormalOutliers[data_,\[Alpha]_:2.09]:=Block[{removeSub},

	removeSub[dataSub_]:=Module[{\[Sigma],\[Mu],return},
                If[Length[dataSub]>1,\[Mu]=N@Mean[dataSub];
		\[Sigma]=N@StandardDeviation[dataSub];
		return=Select[dataSub,#<=\[Mu]+\[Alpha] \[Sigma]&],dataSub]
	];
	FixedPoint[removeSub,data,20]
]

removeNormalOutliers[l, 1]
------------------------------------------------

Some better/simple idea?
tks in advance
Murta

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web