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!