libsim Versione 7.1.11

◆ normalizeddensityindex()

subroutine, public 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 1335 del file simple_stat.f90.

1336
1337REAL, DIMENSION(:), INTENT(IN) :: rnum
1338REAL, DIMENSION(:), INTENT(IN) :: perc_vals
1339REAL, DIMENSION(:), INTENT(OUT) :: ndi
1340REAL, DIMENSION(:), INTENT(OUT) :: nlimbins
1341
1342REAL, DIMENSION(size(ndi)) :: di
1343INTEGER, DIMENSION(size(ndi)) :: occu
1344REAL, DIMENSION(size(nlimbins)) :: limbins
1345real :: med
1346integer :: i,k,middle
1347
1348ndi=rmiss
1349limbins = stat_percentile(rnum,perc_vals) ! compute percentile
1350
1351call densityindex(di,nlimbins,occu,rnum,limbins)
1352
1353! Mediana calculation for density index
1354k=0
1355middle=count(c_e(rnum))/2
1356
1357do 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
1367end do
1368
1369!weighted density index
1370ndi(:count(c_e(di))) = min(pack(di,mask=c_e(di))/med,1.0)
1371

Generated with Doxygen.