Remove 2D points that exceed std dev in either axis
1 次查看(过去 30 天)
显示 更早的评论
I have a bunch of 2D points. I want to find the truncated mean and the standard deviation in each dimension based on the truncated data, then keep the points that are within a standard deviation of either the x-mean or the y-mean.
What I've done so far is to create two copies of the data, one sorted on x and the other on y. Then, I cut off some threshold percentage from the top and bottom of each of these copies, and find the mean and standard deviation of each. I then find the data in each copy that is within a standard deviation of this truncated mean for the given copy. That is, if it's the x-sorted copy, find the points that are within a standard deviation of the truncated x mean. Now, I want to keep the points that are in either copy, but I need them to be in the same order as the original data. How would this be done?
0 个评论
采纳的回答
Thorsten
2015-10-7
编辑:Thorsten
2015-10-7
You can determine the cut-off threshold on the sorted data but remove the values from the top and the bottom in the unsorted data. Note that you have to identify indices where both x and y are valid, and change x and y with these indices. Otherwise you end up with x and y values that to not match.
For further advice please post your code.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrices and Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!