libsim  Versione7.2.3

◆ normalizeddensityindex()

subroutine, public simple_stat::normalizeddensityindex ( real, dimension(:), intent(in)  rnum,
real, dimension(:), intent(in)  perc_vals,
real, dimension(:), intent(out)  ndi,
real, dimension(:), intent(out)  nlimbins 
)

Compute Normalized Density Index.

Parametri
[in]rnumdata to analize
[in]perc_valsthe percentiles values to be computed, between 0. and 100.
[out]ndinormalized density index
[out]nlimbinsthe extreme values of data taken in account for ndi computation

Definizione alla linea 1336 del file simple_stat.f90.

1336 
1337 REAL, DIMENSION(:), INTENT(IN) :: rnum
1338 REAL, DIMENSION(:), INTENT(IN) :: perc_vals
1339 REAL, DIMENSION(:), INTENT(OUT) :: ndi
1340 REAL, DIMENSION(:), INTENT(OUT) :: nlimbins
1341 
1342 REAL, DIMENSION(size(ndi)) :: di
1343 INTEGER, DIMENSION(size(ndi)) :: occu
1344 REAL, DIMENSION(size(nlimbins)) :: limbins
1345 real :: med
1346 integer :: i,k,middle
1347 
1348 ndi=rmiss
1349 limbins = stat_percentile(rnum,perc_vals) ! compute percentile
1350 
1351 call densityindex(di,nlimbins,occu,rnum,limbins)
1352 
1353 ! Mediana calculation for density index
1354 k=0
1355 middle=count(c_e(rnum))/2
1356 
1357 do i=1,count(c_e(occu))
1358  k=k+occu(i)
1359  if (k > middle) then
1360  if (k > 1 .and. (k - occu(i)) == middle) then
1361  med = (di(i-1) + di(i)) / 2.
1362  else
1363  med = di(i)
1364  end if
1365  exit
1366  end if
1367 end do
1368 
1369 !weighted density index
1370 ndi(:count(c_e(di))) = min(pack(di,mask=c_e(di))/med,1.0)
1371 

Generated with Doxygen.