Helping function for algorithm 2: Pre-compute the partial sums S_i = sumj=k_i+1^k_i+1x_i and the partial sums of squared T_i = sumj=k_i+1^k_i+1x_i^2 between the (sorted) candidates k_i and k_i+1 in cand. Output: data frame with 4 columns k_i | k_i+1 | S_i | T_i
Helping function for algorithm 2: Pre-compute the partial sums S_i = sumj=k_i+1^k_i+1x_i and the partial sums of squared T_i = sumj=k_i+1^k_i+1x_i^2 between the (sorted) candidates k_i and k_i+1 in cand. Output: data frame with 4 columns k_i | k_i+1 | S_i | T_i