With nn the number of locations, T_ijT_ij the
observed flow between location ii and location jj
(argument obs
), T_ijT_ij a simulated flow
between location ii and location jj (a matrix from
argument sim
), N=_i,j=1^n T_ijN=_i,j=1^n T_ij the
sum of observed flows and
N=_i,j=1^n T_ijT=_i,j=1^n T_ij
the sum of simulated flows.
Several goodness-of-fit measures have been considered
measures = c("CPC", "NRMSE", "KL", "CPL", "CPC_d", "KS")
. The Common Part
of Commuters Gargiulo2012,Lenormand2012,Lenormand2016TDLM,
CPC(T,T) = 2_i,j=1^n min(T_ij,T_ij)N + N CPC(T,T) = 2_i,j=1^n min(T_ij,T_ij)N + N
the Normalized Root Mean Square Error (NRMSE),
NRMSE(T,T) = _i,j=1^n (T_ij-T_ij)^2N NRMSE(T,T) = _i,j=1^n (T_ij-T_ij)^2N
the Kullback–Leibler divergence Kullback1951TDLM,
KL(T,T) = _i,j=1^n T_ijN(T_ijNNT_ij) KL(T,T) = _i,j=1^n T_ijN(T_ijNNT_ij)
the Common Part of Links (CPL) Lenormand2016TDLM,
CPL(T,T) = 2_i,j=1^n 1_T_ij>0 1_T_ij>0_i,j=1^n 1_T_ij>0 + _i,j=1^n 1_T_ij>0 CPL(T,T) = 2_i,j=1^n 1_T_ij>0 1_T_ij>0_i,j=1^n 1_T_ij>0 + _i,j=1^n 1_T_ij>0
the Common Part of Commuters based on the disance
Lenormand2016TDLM, noted CPC_d. Let us consider
N_kN_k (and N_kN_k) the
sum of observed (and simulated) flows at a distance comprised in the bin
[bin_size
*k-bin_size
, bin_size
*k[.
CPC_d(T,T) = 2_k=1^ min(N_k,N_k)N+N CPC_d(T,T) = 2_k=1^ min(N_k,N_k)N+N
and the Kolmogorv-Smirnov statistic and p-value Massey1951TDLM
, noted KS. It is based on the observed and simulated flow distance
distribution and computed with the ks_test function from
the Ecume package.