/* paxx.h Header file for definitions of functions used in the computation of piece-wise analytic fits based on sample data. Ramses van Zon, December 14, 2009 Reference: [] Ramses van Zon and Jeremy Schofield, "Constructing smooth potentials of mean force, radial distribution functions and probability densities from sampled data", arxiv.0912.0465 [cond-mat.stat-mech]. Created: 14-12-2009 13:56 By user: rzon On machine: rzon-PC Implementation: paxx.cc */ #ifndef __PAXX_H__ #define __PAXX_H__ #ifndef __cplusplus #warning that this header file is intended for c++ programs! #endif // Definitions go here: #include #include namespace pa { // class to hold the information on a piece-wise analytic fit. class Fit { private: int km_,mm_; int k; double *a; double *b; double *c; double **d; double *f; double *g; void dealloc(); void realloc(int km,int mm); public: Fit(); ~Fit(); // compute the parameters of the piecewise analytic fit to a // probability distribution from data. double fit(int n,const double *r,double qm,int km,int mm,bool nodiscont); // evaluate the piecewise analytic probability distribution at a double pd(double r); // evaluate the piecewise analytic cumulative distribution. double cd(double r); // write the fit parameters found by pafit to a file. void write(FILE *file); }; // perform a weighted resampling of data. double bias(int n,const double*r,double (*w)(double),double (*rnd)(void*),void*s,double*x); // perform a weighted resampling of data for use with a jackknife. double jbias(int j,int m,int n,const double *r, double (*w)(double),double (*rnd)(void*),void *s,double*x); // perform a resampling of data for use with a bootstrap estimator. void boot(int n,const double *r,double (*rnd)(void*),void *s,double *x); // perform a simple block-jackknife. void jack(int j,int m,int n,const double *r,double *x); // perform a resampling of data for use with a block-jackknife. void jackboot(int j,int m,int n,const double *r,double (*rnd)(void*),void *s,double *x); // read a binary data file of a specific format into an array. double* newreadbinfile(const char *s,double&y1,double&y2,int&m,int&n); } // Local variables: // mode: c++ // End: #endif // __PAXX_H__