44 |
m->min = DBL_MAX; |
m->min = DBL_MAX; |
45 |
m->max = -DBL_MAX; |
m->max = -DBL_MAX; |
46 |
|
|
47 |
|
m->histogram = 0; |
48 |
|
|
49 |
m->moments = moments1_create(MOMENT_KURTOSIS); |
m->moments = moments1_create(MOMENT_KURTOSIS); |
50 |
|
|
142 |
m->wvp = (struct weighted_value **) hsh_sort(m->ordered_data); |
m->wvp = (struct weighted_value **) hsh_sort(m->ordered_data); |
143 |
m->n_data = hsh_count(m->ordered_data); |
m->n_data = hsh_count(m->ordered_data); |
144 |
|
|
145 |
|
/* Trimmed mean calculation */ |
146 |
|
if ( m->n_data <= 1 ) |
147 |
|
{ |
148 |
|
m->trimmed_mean = m->mean; |
149 |
|
return; |
150 |
|
} |
151 |
|
|
152 |
m->histogram = histogram_create(10, m->min, m->max); |
m->histogram = histogram_create(10, m->min, m->max); |
153 |
|
|
154 |
for ( i = 0 ; i < m->n_data ; ++i ) |
for ( i = 0 ; i < m->n_data ; ++i ) |
157 |
gsl_histogram_accumulate(m->histogram, wv[i]->v.f, wv[i]->w); |
gsl_histogram_accumulate(m->histogram, wv[i]->v.f, wv[i]->w); |
158 |
} |
} |
159 |
|
|
|
/* Trimmed mean calculation */ |
|
|
if ( m->n_data <= 1 ) |
|
|
{ |
|
|
m->trimmed_mean = m->mean; |
|
|
return; |
|
|
} |
|
|
|
|
160 |
tc = m->n * 0.05 ; |
tc = m->n * 0.05 ; |
161 |
k1 = -1; |
k1 = -1; |
162 |
k2 = -1; |
k2 = -1; |
273 |
{ |
{ |
274 |
hsh_destroy(m->ordered_data); |
hsh_destroy(m->ordered_data); |
275 |
hsh_destroy(m->ptile_hash); |
hsh_destroy(m->ptile_hash); |
276 |
gsl_histogram_free(m->histogram); |
if ( m-> histogram ) |
277 |
|
gsl_histogram_free(m->histogram); |
278 |
} |
} |
279 |
|
|
280 |
void |
void |