matching from a distribution
3 ビュー (過去 30 日間)
古いコメントを表示
I am a new user and I hope my question is not too sample.
I have a value A=1000; and i have a huge vector B . From B I want to select the observations that : 1. are 10% away from A in either direction (+ and - 10% of A) 2. select the matching values that fall in the same tercile of A (i.e where A falls in the 33.33% of the distribution of the values of B).
How can I do so without writing long programs. I feel a couple of lines by an expert can do the job.
4 件のコメント
回答 (2 件)
Oleg Komarov
2011 年 7 月 3 日
[I]
idx = B > A + .1*A | B < A + .1*A;
B(idx)
2 件のコメント
Oleg Komarov
2011 年 7 月 4 日
For A = 1000, your formulation detects B > 900 and B < 1100 which means values in between, but you said away in both directions from A, which I interpret outside of the confidence intervals.
参考
カテゴリ
Help Center および File Exchange で Startup and Shutdown についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!