Patterns in static

Apophenia

apop_hist.c File Reference

Functions


Detailed Description

PMF and CMF manipulations.

Copyright (c) 2006--2007 by Ben Klemens. Licensed under the modified GNU GPL v2; see COPYING and COPYING2. (Except psmirnov2x, Copyright R Project, but also licensed under the GPL.)


Function Documentation

apop_model* apop_histogram_model_reset ( apop_model base,
apop_model m,
long int  draws,
gsl_rng *  rng 
)

Give me an existing histogram (i.e., an apop_model) and I'll create a new histogram with the same bins, but with data from draws random draws from the parametrized model you provide.

Unlike with most other histogram-genrating functions, this one will normalize the output to integrate to one. It uses the Designated initializers syntax for inputs.

Parameters:
base An apop_model produced using a form like apop_estimate(yourdata, apop_histogram). I.e. a histogram model to be used as a template. (No default)
m The model to be drawn from. Because this function works via random draws, the model needs to have a draw method. (No default)
draws The number of random draws to make. (arbitrary default = 1e5)
rng The gsl_rng used to make random draws. (default: see note on Auto-allocated RNGs)
void apop_histogram_normalize ( apop_model m  ) 

Scale a histogram so it integrates to one (and is thus a proper PMF).

apop_model* apop_histogram_vector_reset ( apop_model template,
gsl_vector *  indata 
)

Give me an existing histogram (i.e., an apop_model) and I'll create a new histogram with the same bins, but with data from the vector you provide

Parameters:
template An apop_model produced using a form like apop_estimate(yourdata, apop_histogram).
indata The new data to be binned.
apop_data* apop_histograms_test_goodness_of_fit ( apop_model m0,
apop_model m1 
)

Test the goodness-of-fit between two histograms (in apop_model form). I assume that the histograms are aligned.

apop_data* apop_test_kolmogorov ( apop_model m1,
apop_model m2 
)

Run the Kolmogorov test to determine whether two distributions are identical.

Parameters:
m1,m2 Two matching apop_histograms, probably produced via apop_histogram_vector_reset or apop_histogram_model_reset.
Returns:
The $p$-value from the Kolmogorov test that the two distributions are equal.

SourceForge.net Logo

Autogenerated by doxygen on 23 Nov 2009.