Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALPulsar 7.1.1.1-b246709
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
cdfwchisq.h
Go to the documentation of this file.
1/*
2* Copyright (C) 2010, 2011 Evan Goetz
3*
4* This program is free software; you can redistribute it and/or modify
5* it under the terms of the GNU General Public License as published by
6* the Free Software Foundation; either version 2 of the License, or
7* (at your option) any later version.
8*
9* This program is distributed in the hope that it will be useful,
10* but WITHOUT ANY WARRANTY; without even the implied warranty of
11* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12* GNU General Public License for more details.
13*
14* You should have received a copy of the GNU General Public License
15* along with with program; see the file COPYING. If not, write to the
16* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17* MA 02110-1301 USA
18*/
19
20#ifndef __CDFWCHISQ_H__
21#define __CDFWCHISQ_H__
22
23#include <lal/LALStdlib.h>
24#include <lal/AVFactories.h>
25
26typedef struct {
27 REAL8 sigsq; //The value in front of the additional normally distributed random variable Q = Sum(w_i X_i) + sigma X_0
28 REAL8 wnmax; //Maximum value of weights*noise
29 REAL8 wnmin; //Minimum values of weights*noise
30 REAL8 wnmean; //The 'mean' value (not really the true mean)
31 REAL8 c; //The threshold value for Prob(Q < c)
32 REAL8 integrationValue; //Integration value
33 REAL8 integrationError; //Error of integration
34 INT4 count; //Count for number of times entering specific functions
35 INT4 lim; //Limit to number of integration terms
36 INT4 arrayNotSorted; //Array has not been sorted
37 INT4 fail; //Fail flag if integration failes
38 INT4 vectorMath; //Vector math flag
39 INT4Vector *dofs; //Array to hold values of the d.o.f. for each chi-squared variable
40 INT4Vector *sorting; //Array to hold the sorted element values for weights*noise
41 alignedREAL8Vector *weights; //Array of weights in front of each chi-squared variable to sum (in my case, weight*noise/2.0)
42 REAL8Vector *noncentrality; //Array of non-centrality parameters for each chi-squared variable in sum
43} qfvars;
44
45REAL8 cdfwchisq( qfvars *vars, REAL8 sigma, REAL8 acc, INT4 *ifault );
46REAL8 cdfwchisq_twospect( qfvars *vars, REAL8 sigma, REAL8 acc, INT4 *ifault );
47
48void order( qfvars *vars );
49void findu( qfvars *vars, REAL8 *utx, REAL8 accx );
50void findu_twospect( qfvars *vars, REAL8 *utx, REAL8 accx );
51void integrate( qfvars *vars, INT4 nterm, REAL8 interv, REAL8 tausq, INT4 mainx );
52void integrate_eg( qfvars *vars, INT4 nterm, REAL8 interv, REAL8 tausq, INT4 mainx );
53void integrate_twospect( qfvars *vars, INT4 nterm, REAL8 interv, REAL8 tausq, INT4 mainx );
54void integrate_twospect2( qfvars *vars, INT4 nterm, REAL8 interv, REAL8 tausq, INT4 mainx );
55INT4 fast_integrate_twospect2( qfvars *vars, INT4 nterm, REAL8 interv, REAL8 tausq, INT4 mainx );
56
57REAL8 exp1( REAL8 x );
60REAL8 errbound( qfvars *vars, REAL8 u, REAL8 *cx );
62REAL8 cutoff( qfvars *vars, REAL8 accx, REAL8 *upn );
63REAL8 cutoff_twospect( qfvars *vars, REAL8 accx, REAL8 *upn );
64REAL8 truncation( qfvars *vars, REAL8 u, REAL8 tausq );
65REAL8 truncation_twospect( qfvars *vars, REAL8 u, REAL8 tausq );
66REAL8 coeff( qfvars *vars, REAL8 x );
68
69int compar( void *p, const void *a, const void *b );
70
71int compar( void *p, const void *a, const void *b );
72
73#endif
REAL8 truncation(qfvars *vars, REAL8 u, REAL8 tausq)
Definition: cdfwchisq.c:222
void integrate_twospect2(qfvars *vars, INT4 nterm, REAL8 interv, REAL8 tausq, INT4 mainx)
Definition: cdfwchisq.c:524
void findu_twospect(qfvars *vars, REAL8 *utx, REAL8 accx)
Definition: cdfwchisq.c:385
REAL8 coeff(qfvars *vars, REAL8 x)
Definition: cdfwchisq.c:620
REAL8 cutoff(qfvars *vars, REAL8 accx, REAL8 *upn)
Definition: cdfwchisq.c:140
void integrate_twospect(qfvars *vars, INT4 nterm, REAL8 interv, REAL8 tausq, INT4 mainx)
Definition: cdfwchisq.c:457
REAL8 cdfwchisq(qfvars *vars, REAL8 sigma, REAL8 acc, INT4 *ifault)
Definition: cdfwchisq.c:751
REAL8 twospect_log_1plusx_mx(REAL8 x)
Definition: cdfwchisq.c:49
REAL8 twospect_log_1plusx(REAL8 x)
Definition: cdfwchisq.c:45
void findu(qfvars *vars, REAL8 *utx, REAL8 accx)
Definition: cdfwchisq.c:349
REAL8 cutoff_twospect(qfvars *vars, REAL8 accx, REAL8 *upn)
Definition: cdfwchisq.c:180
REAL8 truncation_twospect(qfvars *vars, REAL8 u, REAL8 tausq)
Definition: cdfwchisq.c:289
INT4 fast_integrate_twospect2(qfvars *vars, INT4 nterm, REAL8 interv, REAL8 tausq, INT4 mainx)
Definition: cdfwchisq.c:558
REAL8 cdfwchisq_twospect(qfvars *vars, REAL8 sigma, REAL8 acc, INT4 *ifault)
Definition: cdfwchisq.c:917
void integrate_eg(qfvars *vars, INT4 nterm, REAL8 interv, REAL8 tausq, INT4 mainx)
Definition: cdfwchisq.c:492
REAL8 coeff_twospect(qfvars *vars, REAL8 x)
Definition: cdfwchisq.c:682
REAL8 exp1(REAL8 x)
Definition: cdfwchisq.c:35
int compar(void *p, const void *a, const void *b)
Definition: cdfwchisq.c:67
void order(qfvars *vars)
Definition: cdfwchisq.c:56
REAL8 errbound_twospect(qfvars *vars, REAL8 u, REAL8 *cx)
Definition: cdfwchisq.c:117
void integrate(qfvars *vars, INT4 nterm, REAL8 interv, REAL8 tausq, INT4 mainx)
Definition: cdfwchisq.c:421
REAL8 errbound(qfvars *vars, REAL8 u, REAL8 *cx)
Definition: cdfwchisq.c:94
double REAL8
int32_t INT4
static const INT4 a
REAL8 wnmax
Definition: cdfwchisq.h:28
INT4Vector * dofs
Definition: cdfwchisq.h:39
REAL8 integrationValue
Definition: cdfwchisq.h:32
INT4Vector * sorting
Definition: cdfwchisq.h:40
INT4 count
Definition: cdfwchisq.h:34
REAL8Vector * noncentrality
Definition: cdfwchisq.h:42
REAL8 wnmean
Definition: cdfwchisq.h:30
REAL8 sigsq
Definition: cdfwchisq.h:27
INT4 arrayNotSorted
Definition: cdfwchisq.h:36
REAL8 wnmin
Definition: cdfwchisq.h:29
INT4 fail
Definition: cdfwchisq.h:37
INT4 lim
Definition: cdfwchisq.h:35
REAL8 integrationError
Definition: cdfwchisq.h:33
REAL8 c
Definition: cdfwchisq.h:31
INT4 vectorMath
Definition: cdfwchisq.h:38
alignedREAL8Vector * weights
Definition: cdfwchisq.h:41