Files | |
| file | psMinimizeLMM.h |
| minimization operations | |
| file | psMinimizePolyFit.h |
| minimization operations | |
| file | psMinimizePowell.h |
| minimization operations | |
| file | psPolynomial.h |
| Standard Mathematical Functions. | |
| file | psPolynomial.h |
| Standard Mathematical Functions. | |
| file | psStats.h |
| basic statistical operations
This file will hold the definition of the histogram and stats data structures. | |
Data Structures | |
| struct | psMinimization |
| A data structure for minimization routines. More... | |
| struct | psMinConstrain |
| A data structure for minimization routines. More... | |
| struct | psPolynomial1D |
| One-dimensional polynomial. More... | |
| struct | psPolynomial2D |
| Two-dimensional polynomial. More... | |
| struct | psPolynomial3D |
| Three-dimensional polynomial. More... | |
| struct | psPolynomial4D |
| Four-dimensional polynomial. More... | |
| struct | p_chebyPolys |
| struct | psStats |
| This is the generic statistics structure. More... | |
| struct | psHistogram |
| The basic histogram structure which contains bounds and bins. More... | |
Defines | |
| #define | PS_DETERMINE_BRACKET_STEP_SIZE 0.10 |
| #define | PS_MAX_LMM_ITERATIONS 100 |
| #define | PS_MAX_MINIMIZE_ITERATIONS 100 |
| #define | P_PSMINIMIZATION_SET_MAXITER(m, val) *(int*)&m->maxIter = val |
| #define | P_PSMINIMIZATION_SET_TOL(m, val) *(float*)&m->tol = val |
| #define | PS_ASSERT_POLY1D(NAME, RVAL) |
| #define | PS_ASSERT_POLY_NON_NULL(NAME, RVAL) |
| #define | PS_ASSERT_POLY_TYPE(NAME, TYPE, RVAL) |
| #define | PS_POLY_PRINT_1D(NAME) |
| #define | PS_POLY_PRINT_2D(NAME) |
Typedefs | |
| typedef float(* | psMinimizeLMChi2Func )(psVector *deriv, const psVector *params, const psVector *x) |
| Specifies the format of a user-defined function that the general Levenberg- Marquardt minimizer routine will accept. | |
| typedef float(* | psMinimizePowellFunc )(const psVector *params, const psArray *coords) |
| Specifies the format of a user-defined function that the general Powell minimizer routine will accept. | |
| typedef psVector *(* | psMinimizeChi2PowellFunc )(const psVector *params, const psArray *coords) |
| Specifies the format of a user-defined function that the general Powell chi- squared minimizer routine will accept. | |
Enumerations | |
| enum | psPolynomialType { PS_POLYNOMIAL_ORD, PS_POLYNOMIAL_CHEB } |
| Polynomial Type. More... | |
| enum | psStatsOptions { PS_STAT_SAMPLE_MEAN = 0x000001, PS_STAT_SAMPLE_MEDIAN = 0x000002, PS_STAT_SAMPLE_STDEV = 0x000004, PS_STAT_SAMPLE_QUARTILE = 0x000008, PS_STAT_ROBUST_MEDIAN = 0x000010, PS_STAT_ROBUST_STDEV = 0x000020, PS_STAT_ROBUST_QUARTILE = 0x000040, PS_STAT_FITTED_MEAN = 0x000080, PS_STAT_FITTED_STDEV = 0x000100, PS_STAT_CLIPPED_MEAN = 0x000200, PS_STAT_CLIPPED_STDEV = 0x000400, PS_STAT_MAX = 0x000800, PS_STAT_MIN = 0x001000, PS_STAT_USE_RANGE = 0x002000, PS_STAT_USE_BINSIZE = 0x004000 } |
| enumeration of statistical calculation options More... | |
Functions | |
| psMinConstrain * | psMinConstrainAlloc () |
| psMinimization * | psMinimizationAlloc (int maxIter, float tol) |
| Allocates a psMinimization structure. | |
| bool | psMemCheckMinimization (psPtr ptr) |
| bool | psMinimizeLMChi2 (psMinimization *min, psImage *covar, psVector *params, psMinConstrain *constrain, const psArray *x, const psVector *y, const psVector *yWt, psMinimizeLMChi2Func func) |
| Minimizes a specified function based on the Levenberg-Marquardt method. | |
| bool | psMinimizeGaussNewtonDelta (psVector *delta, const psVector *params, const psVector *paramMask, const psArray *x, const psVector *y, const psVector *yErr, psMinimizeLMChi2Func func) |
| psF64 | p_psMinLM_SetABX (psImage *alpha, psVector *beta, const psVector *params, const psVector *paramMask, const psArray *x, const psVector *y, const psVector *dy, psMinimizeLMChi2Func func) |
| Function used to set parameters for generating "best guess" in minimizing Chi-Squared value. | |
| psPolynomial1D * | psVectorFitPolynomial1D (psPolynomial1D *poly, const psVector *mask, psMaskType maskValue, const psVector *f, const psVector *fErr, const psVector *x) |
| Derive a polynomial fit. | |
| psPolynomial2D * | psVectorFitPolynomial2D (psPolynomial2D *poly, const psVector *mask, psMaskType maskValue, const psVector *f, const psVector *fErr, const psVector *x, const psVector *y) |
| psPolynomial3D * | psVectorFitPolynomial3D (psPolynomial3D *poly, const psVector *mask, psMaskType maskValue, const psVector *f, const psVector *fErr, const psVector *x, const psVector *y, const psVector *z) |
| psPolynomial4D * | psVectorFitPolynomial4D (psPolynomial4D *poly, const psVector *mask, psMaskType maskValue, const psVector *f, const psVector *fErr, const psVector *x, const psVector *y, const psVector *z, const psVector *t) |
| psPolynomial1D * | psVectorClipFitPolynomial1D (psPolynomial1D *poly, psStats *stats, const psVector *mask, psMaskType maskValue, const psVector *f, const psVector *fErr, const psVector *x) |
| psPolynomial2D * | psVectorClipFitPolynomial2D (psPolynomial2D *poly, psStats *stats, const psVector *mask, psMaskType maskValue, const psVector *f, const psVector *fErr, const psVector *x, const psVector *y) |
| psPolynomial3D * | psVectorClipFitPolynomial3D (psPolynomial3D *poly, psStats *stats, const psVector *mask, psMaskType maskValue, const psVector *f, const psVector *fErr, const psVector *x, const psVector *y, const psVector *z) |
| psPolynomial4D * | psVectorClipFitPolynomial4D (psPolynomial4D *poly, psStats *stats, const psVector *mask, psMaskType maskValue, const psVector *f, const psVector *fErr, const psVector *x, const psVector *y, const psVector *z, const psVector *t) |
| bool | psMinimizePowell (psMinimization *min, psVector *params, const psVector *paramMask, const psArray *coords, psMinimizePowellFunc func) |
| Minimizes a specified function based on the Powell method. | |
| bool | psMinimizeChi2Powell (psMinimization *min, psVector *params, psMinConstrain *constrain, const psArray *coords, const psVector *value, const psVector *error, psMinimizeChi2PowellFunc model) |
| Minimizes a specified function based on the Powell chi-squared method. | |
| float | psGaussian (float x, float mean, float sigma, bool normal) |
| Evaluate a non-normalized Gaussian with the given mean and sigma at the given coordianate. | |
| psVector * | p_psGaussianDev (psF32 mean, psF32 sigma, unsigned int Npts) |
| Produce a vector of random numbers from a Gaussian distribution with the specified mean and sigma. | |
| psPolynomial1D * | psPolynomial1DAlloc (psPolynomialType type, unsigned int nX) |
| Allocates a psPolynomial1D structure with n terms. | |
| psPolynomial2D * | psPolynomial2DAlloc (psPolynomialType type, unsigned int nX, unsigned int nY) |
| Allocates a 2-D polynomial structure. | |
| psPolynomial3D * | psPolynomial3DAlloc (psPolynomialType type, unsigned int nX, unsigned int nY, unsigned int nZ) |
| Allocates a 3-D polynomial structure. | |
| psPolynomial4D * | psPolynomial4DAlloc (psPolynomialType type, unsigned int nX, unsigned int nY, unsigned int nZ, unsigned int nT) |
| Allocates a 4-D polynomial structure. | |
| psF64 | psPolynomial1DEval (const psPolynomial1D *poly, psF64 x) |
| Evaluates a 1-D polynomial at specific coordinates. | |
| psF64 | psPolynomial2DEval (const psPolynomial2D *poly, psF64 x, psF64 y) |
| Evaluates a 2-D polynomial at specific coordinates. | |
| psF64 | psPolynomial3DEval (const psPolynomial3D *poly, psF64 x, psF64 y, psF64 z) |
| Evaluates a 3-D polynomial at specific coordinates. | |
| psF64 | psPolynomial4DEval (const psPolynomial4D *poly, psF64 x, psF64 y, psF64 z, psF64 t) |
| Evaluates a 4-D polynomial at specific coordinates. | |
| psVector * | psPolynomial1DEvalVector (const psPolynomial1D *poly, const psVector *x) |
| Evaluates a 1-D polynomial at specific sets of coordinates. | |
| psVector * | psPolynomial2DEvalVector (const psPolynomial2D *poly, const psVector *x, const psVector *y) |
| Evaluates a 2-D polynomial at specific sets of coordinates. | |
| psVector * | psPolynomial3DEvalVector (const psPolynomial3D *poly, const psVector *x, const psVector *y, const psVector *z) |
| Evaluates a 3-D polynomial at specific sets of coordinates. | |
| psVector * | psPolynomial4DEvalVector (const psPolynomial4D *poly, const psVector *x, const psVector *y, const psVector *z, const psVector *t) |
| Evaluates a 4-D polynomial at specific sets of coordinates. | |
| bool | psMemCheckPolynomial1D (psPtr ptr) |
| Checks the type of a particular pointer. | |
| bool | psMemCheckPolynomial2D (psPtr ptr) |
| Checks the type of a particular pointer. | |
| bool | psMemCheckPolynomial3D (psPtr ptr) |
| Checks the type of a particular pointer. | |
| bool | psMemCheckPolynomial4D (psPtr ptr) |
| Checks the type of a particular pointer. | |
| psPolynomial1D ** | p_psCreateChebyshevPolys (psS32 numPolys) |
| Creates the specified number of chebyshev polys. | |
| psStats * | psVectorStats (psStats *stats, const psVector *in, const psVector *errors, const psVector *mask, psMaskType maskVal) |
| Performs statistical calculations on a vector. | |
| psStats * | psStatsAlloc (psStatsOptions options) |
| Allocator of the psStats structure. | |
| bool | psMemCheckStats (psPtr ptr) |
| Checks the type of a particular pointer. | |
| psHistogram * | psHistogramAlloc (float lower, float upper, int n) |
| Allocator for psHistogram where the bounds of the bins are implicitly specified through simply specifying an upper and lower limit along with the size of the bins. | |
| bool | psMemCheckHistogram (psPtr ptr) |
| Checks the type of a particular pointer. | |
| psHistogram * | psHistogramAllocGeneric (const psVector *bounds) |
| Allocator for psHistogram where the bounds of the bins are explicitly specified. | |
| psHistogram * | psVectorHistogram (psHistogram *out, const psVector *values, const psVector *errors, const psVector *mask, psMaskType maskVal) |
| Calculate a histogram. | |
| psBool | p_psGetStatValue (const psStats *stats, psF64 *value) |
| Extracts the statistic value specified by stats->options. | |
|
|
Definition at line 74 of file psMinimizeLMM.h. |
|
|
Definition at line 75 of file psMinimizeLMM.h. |
|
|
Value: if (false == psMemCheckPolynomial1D(NAME)) { \ psError(PS_ERR_BAD_PARAMETER_NULL, true, \ "Unallowable operation: argument %s is not a psPolynomial1D struct.\n",\ #NAME); \ return(RVAL); \ } \ Definition at line 312 of file psPolynomial.h. |
|
|
Value: if ((NAME) == NULL || (NAME)->coeff == NULL) { \ psError(PS_ERR_BAD_PARAMETER_NULL, true, \ "Unallowable operation: polynomial %s or its coeffs is NULL.", \ #NAME); \ return(RVAL); \ } \ Definition at line 320 of file psPolynomial.h. |
|
|
Value: if ((NAME)->type != TYPE) { \ psError(PS_ERR_BAD_PARAMETER_TYPE, true, \ "Unallowable operation: polynomial %s has wrong type.", #NAME); \ return(RVAL); \ } \ Definition at line 328 of file psPolynomial.h. |
|
|
Definition at line 40 of file psMinimizeLMM.h. |
|
|
Definition at line 41 of file psMinimizeLMM.h. |
|
|
Definition at line 42 of file psMinimizeLMM.h. |
|
|
Value: printf("Poly %s: (nX) is (%d)\n", #NAME, NAME->nX);\ for (psS32 i = 0 ; i < NAME->nX+1 ; i++) {\ printf("%s->coeff[%d] is %f\n", #NAME, i, NAME->coeff[i]); \ }\ Definition at line 335 of file psPolynomial.h. |
|
|
Value: printf("Poly %s: (nX, nY) is (%d, %d)\n", #NAME, NAME->nX, NAME->nY);\ for (psS32 i = 0 ; i < NAME->nX+1 ; i++) {\ for (psS32 j = 0 ; j < NAME->nY+1 ; j++) {\ printf("%s->coeff[%d][%d] is %f\n", #NAME, i, j, NAME->coeff[i][j]); \ }\ }\ Definition at line 341 of file psPolynomial.h. |
|
|
Specifies the format of a user-defined function that the general Powell chi- squared minimizer routine will accept.
Definition at line 71 of file psMinimizePowell.h. |
|
|
Specifies the format of a user-defined function that the general Levenberg- Marquardt minimizer routine will accept.
Definition at line 104 of file psMinimizeLMM.h. |
|
|
Specifies the format of a user-defined function that the general Powell minimizer routine will accept.
Definition at line 48 of file psMinimizePowell.h. |
|
|
Polynomial Type. Enumeration for Polynomial types. Definition at line 65 of file psPolynomial.h. |
|
|
enumeration of statistical calculation options
|
|
|
Creates the specified number of chebyshev polys.
|
|
||||||||||||||||
|
Produce a vector of random numbers from a Gaussian distribution with the specified mean and sigma.
|
|
||||||||||||
|
Extracts the statistic value specified by stats->options.
|
|
||||||||||||||||||||||||||||||||||||
|
Function used to set parameters for generating "best guess" in minimizing Chi-Squared value.
|
|
||||||||||||||||||||
|
Evaluate a non-normalized Gaussian with the given mean and sigma at the given coordianate. Note that this is not a Gaussian deviate. The evaluated Gaussian is:
|
|
||||||||||||||||
|
Allocator for psHistogram where the bounds of the bins are implicitly specified through simply specifying an upper and lower limit along with the size of the bins.
|
|
|
Allocator for psHistogram where the bounds of the bins are explicitly specified.
|
|
|
Checks the type of a particular pointer. Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.
|
|
|
|
|
|
Checks the type of a particular pointer. Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.
|
|
|
Checks the type of a particular pointer. Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.
|
|
|
Checks the type of a particular pointer. Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.
|
|
|
Checks the type of a particular pointer. Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.
|
|
|
Checks the type of a particular pointer. Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.
|
|
|
|
|
||||||||||||
|
Allocates a psMinimization structure.
|
|
||||||||||||||||||||||||||||||||
|
Minimizes a specified function based on the Powell chi-squared method.
|
|
||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||||
|
Minimizes a specified function based on the Levenberg-Marquardt method.
|
|
||||||||||||||||||||||||
|
Minimizes a specified function based on the Powell method.
|
|
||||||||||||
|
Allocates a psPolynomial1D structure with n terms.
|
|
||||||||||||
|
Evaluates a 1-D polynomial at specific coordinates.
|
|
||||||||||||
|
Evaluates a 1-D polynomial at specific sets of coordinates.
|
|
||||||||||||||||
|
Allocates a 2-D polynomial structure.
|
|
||||||||||||||||
|
Evaluates a 2-D polynomial at specific coordinates.
|
|
||||||||||||||||
|
Evaluates a 2-D polynomial at specific sets of coordinates.
|
|
||||||||||||||||||||
|
Allocates a 3-D polynomial structure.
|
|
||||||||||||||||||||
|
Evaluates a 3-D polynomial at specific coordinates.
|
|
||||||||||||||||||||
|
Evaluates a 3-D polynomial at specific sets of coordinates.
|
|
||||||||||||||||||||||||
|
Allocates a 4-D polynomial structure.
|
|
||||||||||||||||||||||||
|
Evaluates a 4-D polynomial at specific coordinates.
|
|
||||||||||||||||||||||||
|
Evaluates a 4-D polynomial at specific sets of coordinates.
|
|
|
Allocator of the psStats structure.
|
|
||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||
|
Derive a polynomial fit. psVectorFitPolynomial1d returns the polynomial that best fits the observations. The input parameters are a polynomial that specifies the fit order, myPoly, which will be altered and returned with the best-fit coefficients; and the observations, x, y and yErr. The independent variable list, x may be NULL, in which case the vector index is used. The dependent variable error, yErr may be null, in which case the solution is determined in the assumption that all data errors are equal. This function must be valid only for types psF32, psF64.
|
|
||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||
|
Calculate a histogram. The following function populates the histogram bins from the specified vector (in). It alters and returns the histogram out structure. The input vector may be of types psU8, psU16, psF32, psF64.
|
|
||||||||||||||||||||||||
|
Performs statistical calculations on a vector.
|
1.4.4