remove data items based on density - Maple Help

Online Help

All Products    Maple    MapleSim

Home : Support : Online Help : Statistics : Statistics Package : Data Manipulation : Statistics/Excise

Statistics[Excise] - remove data items based on density

Calling Sequence

Excise(p, X, Y, Z, options)




fraction of data points to be removed from the sample



first data sample



(optional) second data sample



(optional) third data sample



(optional) equation(s) of the form option=value where option is one of to_plot, or return_same; specify options for the Excise function



The Excise command calculates how densely clustered every point of data is with respect to every other point of data. A certain number of points, determined by the magnitude of p, are removed from the data and the remaining points are returned as an expression sequence of one dimensional Arrays.  Excise returns the same number of data samples as are passed into the function.


If p is a positive number between zero and one, and n is the number of points passed to Excise, then p*n of the least densely clustered points are excised, and (1-p)*n of the most densely clustered points will be returned.


If p is a negative number between zero and negative one, and n is the number of points passed to Excise, then (-p)*n of the most densely clustered points are excised, and (1+p)*n of the least densely clustered points will be returned.


The parameters X, Y and Z are the data samples to be excised. Each can be given as a Vector, Matrix, Array, or list, though they do not all have to be of the same type. They also do not need to be one dimensional, but will be treated as though they are. The first data sample, X, is required, but the second and third data samples, Y and Z respectively, are optional. Note that all data samples must have the same number of elements.


This function is part of the Statistics package, so it can be used in the short form Excise(..) only after executing the command with(Statistics).  However, it can always be accessed through the long form of the command by using Statistics[Excise](..).



A simple 1D case. Excise will remove the sparsest half of the data, leaving the densest half, which it returns as a 1D Array. In this case, this will the center four points.








If a negative fraction is used as the first argument, then the returned data will be the sparsest points, in this case the outer four points.



If the return_same option is used, then Excise will return the remaining data as the same type as was entered.










Excise can be used to trim points from data and then pass the remainders to a plotting function. If the to_plot option is used, then the original range of the data will be preserved so it can be compared with the original data. This is accomplished by returning a line of the form view= [range(s)] to be used as an option by the plotting function.




Plot original data


Plot of the densest half of the data


See Also

Statistics, Statistics[DataManipulation], Statistics[Remove], Statistics[RemoveInRange], Statistics[RemoveNonNumeric]

Download Help Document

Was this information helpful?

Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam