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!