matlab - Simple data processing -


let's got set of data. after sorting distribution can drawn out below.

m=[-99  -99 -44.5   -7.375  -5.5    -1.666666667    -1.333333333    -1.285714286    0.436363636 2.35    3.3 4.285714286 5.052631579 6.2 7.076923077 7.230769231 7.916666667 9.7 10.66666667 16.16666667 17.4    19.2    19.6    20.75   24.25   34.5    49.5] 

plot data

my question how find out values among middle range , record indices. using normal distribution or else? appreciate help!

picture jonas' enter image description here

assuming mid range [-10 10] indices be:

> find(-10< m & m< 10) ans =      4    5    6    7    8    9   10   11   12   13   14   15   16   17   18 

please note can acces values logical indexing, like:

> m(-10< m & m< 10) ans =   columns 1 through 15:    -7.37500  -5.50000  -1.66667  -1.33333  , on ... 

and mid range, just:

> q= quantile(m(:), [.25 .75]) q =     -1.3214    17.0917  > find(q(1)< m & m< q(2)) ans =      8    9   10   11   12   13   14   15   16   17   18   19   20 

note m(:) used here ensure quantile treats m vector. may adopt convention vectors in programs column vectors, of functions automatically treats them correctly.

update:
now, short description of quantiles that: points taken cumulative distribution function (cdf) of random variable. (now m assumed kind of cdf, since nondecreasing , can normalized sum 1). 'simply' quantile .5 of data 'means 50% of values lower quantile'. more details on quantiles can found example here.


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -