Modify weight calculation again

Dividing the weights by variance or unweighted variance seems to have a
significant negative impact on response with normally distributed
network delays.

Divide by the difference between the mean and minimum distance instead.
It should be stable as there is no loop and the response seems to be a
good compromise between the original minimum distance weighting which
works well with normally distributed delays and the variance weighting
which works well with exponentially distributed delays.
This commit is contained in:
Miroslav Lichvar 2011-04-28 17:32:13 +02:00
parent 66c7ac4d24
commit bb40f4aff4

View file

@ -384,7 +384,7 @@ SST_DoNewRegression(SST_Stats inst)
int best_start, times_back_start;
double est_intercept, est_slope, est_var, est_intercept_sd, est_slope_sd;
int i, j, nruns;
double min_distance;
double min_distance, mean_distance;
double sd_weight, sd;
double old_skew, old_freq, stress;
@ -395,17 +395,19 @@ SST_DoNewRegression(SST_Stats inst)
offsets[i + inst->runs_samples] = inst->offsets[get_runsbuf_index(inst, i)];
}
for (i = 0, min_distance = DBL_MAX; i < inst->n_samples; i++) {
for (i = 0, mean_distance = 0.0, min_distance = DBL_MAX; i < inst->n_samples; i++) {
j = get_buf_index(inst, i);
peer_distances[i] = 0.5 * inst->peer_delays[j] + inst->peer_dispersions[j];
mean_distance += peer_distances[i];
if (peer_distances[i] < min_distance) {
min_distance = peer_distances[i];
}
}
mean_distance /= inst->n_samples;
/* And now, work out the weight vector */
sd = sqrt(inst->variance);
sd = mean_distance - min_distance;
if (sd > min_distance || sd <= 0.0)
sd = min_distance;