projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Need to make sure m4/Makefile.am exists before running gnulib-tool.
[pspp]
/
src
/
factor_stats.h
diff --git
a/src/factor_stats.h
b/src/factor_stats.h
index c193f883e47384008781b39bd41333f0969990c5..02a69db32e42d82add7516c812da94d4041857d1 100644
(file)
--- a/
src/factor_stats.h
+++ b/
src/factor_stats.h
@@
-15,8
+15,8
@@
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 5
9 Temple Place - Suite 330
, Boston, MA
-0211
1-1307
, USA. */
+Foundation, Inc., 5
1 Franklin Street, Fifth Floor
, Boston, MA
+0211
0-1301
, USA. */
#ifndef FACTOR_STATS
#define FACTOR_STATS
#ifndef FACTOR_STATS
#define FACTOR_STATS
@@
-27,6
+27,12
@@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
#include "hash.h"
#include "val.h"
#include "hash.h"
#include "val.h"
+#include <string.h>
+#include <gsl/gsl_histogram.h>
+#include "subclist.h"
+#include "percentiles.h"
+
+struct moments1;
struct metrics
{
struct metrics
{
@@
-34,40
+40,53
@@
struct metrics
double n_missing;
double n_missing;
- double ssq;
-
- double sum;
-
double min;
double max;
double mean;
double min;
double max;
double mean;
- double s
tderr
;
+ double s
e_mean
;
double var;
double stddev;
double var;
double stddev;
+ struct moments1 *moments;
+
+ gsl_histogram *histogram;
+
+ double skewness;
+ double kurtosis;
+
double trimmed_mean;
double trimmed_mean;
- /* A hash of data for this factor.
- */
+ /* A hash of data for this factor. */
struct hsh_table *ordered_data;
/* A Pointer to this hash table AFTER it has been SORTED and crunched */
struct weighted_value **wvp;
struct hsh_table *ordered_data;
/* A Pointer to this hash table AFTER it has been SORTED and crunched */
struct weighted_value **wvp;
-
/* The number of values in the above array
(if all the weights are 1, then this will
be the same as n) */
int n_data;
/* The number of values in the above array
(if all the weights are 1, then this will
be the same as n) */
int n_data;
-};
+ /* Percentile stuff */
+
+ /* A hash of struct percentiles */
+ struct hsh_table *ptile_hash;
+
+ /* Algorithm to be used for calculating percentiles */
+ enum pc_alg ptile_alg;
+ /* Tukey's Hinges */
+ double hinge[3];
+};
+
+
+struct metrics * metrics_create(void);
void metrics_precalc(struct metrics *m);
void metrics_precalc(struct metrics *m);
@@
-76,6
+95,9
@@
void metrics_calc(struct metrics *m, const union value *f, double weight,
void metrics_postcalc(struct metrics *m);
void metrics_postcalc(struct metrics *m);
+void metrics_destroy(struct metrics *m);
+
+
/* Linked list of case nos */
struct case_node
/* Linked list of case nos */
struct case_node
@@
-111,12
+133,14
@@
void weighted_value_free(struct weighted_value *wv);
struct factor_statistics {
struct factor_statistics {
- /* The value
of the independent variable
*/
+ /* The value
s of the independent variables
*/
union value id[2];
/* The an array stats for this factor, one for each dependent var */
struct metrics *m;
union value id[2];
/* The an array stats for this factor, one for each dependent var */
struct metrics *m;
+ /* The number of dependent variables */
+ int n_var;
};
};
@@
-129,18
+153,15
@@
create_factor_statistics (int n, union value *id0, union value *id1);
void factor_statistics_free(struct factor_statistics *f);
void factor_statistics_free(struct factor_statistics *f);
+/* Compare f0 and f1.
+ width is the width of the independent variable */
int
factor_statistics_compare(const struct factor_statistics *f0,
int
factor_statistics_compare(const struct factor_statistics *f0,
- const struct factor_statistics *f1,
void *aux
);
+ const struct factor_statistics *f1,
int width
);
unsigned int
unsigned int
-factor_statistics_hash(const struct factor_statistics *f, void *aux);
-
-
-
-
-
+factor_statistics_hash(const struct factor_statistics *f, int width);
#endif
#endif