Amplitude Marginaliser
|
00001 /* 00002 * Copyright (C) 2014 Matthew Pitkin 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with with program; see the file COPYING. If not, write to the 00016 * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, 00017 * MA 02111-1307 USA 00018 */ 00019 00025 #include <math.h> 00026 #include <string.h> 00027 00028 /* GSL headers */ 00029 #include <gsl/gsl_math.h> 00030 #include <gsl/gsl_sf_erf.h> 00031 #include <gsl/gsl_randist.h> 00032 #include <gsl/gsl_rng.h> 00033 00034 #define AM_SQUARE(x) (x*x) 00035 #define AM_LN2PI (M_LN2 + M_LNPI) 00036 #define AM_LNPI_2 (M_LNPI - M_LN2) 00038 /* define functions */ 00039 00072 double marginalise_amplitudes(int Nmodels, 00073 double **modelModel, 00074 double *dataModel, 00075 double sigma, 00076 unsigned int lastHalfRange); 00077 00080 float marginalise_amplitudes_f(int Nmodels, 00081 float **modelModel, 00082 float *dataModel, 00083 float sigma, 00084 unsigned int lastHalfRange); 00085 00096 double marginalise_amplitudes_except_final(int Nmodels, 00097 double **modelModel, 00098 double *dataModel, 00099 double sigma); 00100 00103 float marginalise_amplitudes_except_final_f(int Nmodels, 00104 float **modelModel, 00105 float *dataModel, 00106 float sigma); 00107 00111 double marginalise_amplitudes_linear(int Nmodels, 00112 double modelModel[], 00113 double dataModel[], 00114 double sigma, 00115 unsigned int lastHalfRange); 00116 00120 double marginalise_amplitudes_except_final_linear(int Nmodels, 00121 double modelModel[], 00122 double dataModel[], 00123 double sigma); 00124 00156 double marginalise_three_amplitudes(double **modelModel, 00157 double *dataModel, 00158 double sigma, 00159 unsigned int lastHalfRange); 00160 00163 float marginalise_three_amplitudes_f(float **modelModel, 00164 float *dataModel, 00165 float sigma, 00166 unsigned int lastHalfRange); 00167 00175 double marginalise_three_amplitudes_exclude_final(double **modelModel, 00176 double *dataModel, 00177 double sigma); 00178