24 #include "ObjCryst/ObjCryst/PowderPatternBackgroundBayesianMinimiser.h" 
   27 PowderPatternBackgroundBayesianMinimiser::
 
   28    PowderPatternBackgroundBayesianMinimiser(PowderPatternBackground &backgd):
 
   34 PowderPatternBackgroundBayesianMinimiser::~PowderPatternBackgroundBayesianMinimiser()
 
   41    static string className=
"PowderPatternBackgroundBayesianMinimiser";
 
   47    TAU_PROFILE(
"PowderPatternBackgroundBayesianMinimiser::GetLogLikelihood()",
"void ()",TAU_DEFAULT);
 
   55       for(
long i=0;i<nb;i+=step)
 
   61                         ((*pObs-*pBackgd) / (1.4142135623730951**pSigma));
 
   83   for(
long i=0;i<nb;i+=step)
 
  122    static const REAL vllk[11]={0.00000000e+00,
 
  133    static const REAL vt[11]={  0. ,   0.01,  0.1 ,  1.1 ,  2.1 ,  3.1 ,  4.1 ,  5.1 ,  6.1 ,  7.1 ,  8.1};
 
  135    static const REAL s1=spline(8)-log((REAL)8);
 
  136    if(t<=0) 
return 5*t*t;
 
  137    if(t<8)
return spline(t);
 
void AddSubRefObj(RefinableObj &)
virtual const string & GetClassName() const 
Name for this class ("RefinableObj", "Crystal",...). 
const CrystVector_REAL & GetPowderPatternObsSigma() const 
Get the sigma for each point of the observed powder pattern. 
virtual REAL GetLogLikelihood() const 
Get -log(likelihood) of the current configuration for the object. 
void RemoveSubRefObj(RefinableObj &)
virtual unsigned int GetNbLSQFunction() const 
Number of LSQ functions. 
virtual const CrystVector_REAL & GetLSQWeight(const unsigned int) const 
Get the weight values for the LSQ function. 
static REAL BayesianBackgroundLogLikelihood(const REAL t)
Returns the log(likelihood) of a background by marginalizing the effect of Bragg peaks, following the method described by David and Sivia (J.Appl.Cryst. 
CrystVector_REAL mBayesianCalc
Bayesian cost (-log(likelihood)) for each point. 
CrystVector_REAL mBayesianObs
Obs==0 (desired -log(likelihood)) 
const CrystVector_REAL & GetPowderPatternObs() const 
Get the observed powder pattern. 
virtual const CrystVector_REAL & GetLSQCalc(const unsigned int) const 
Get the current calculated value for the LSQ function. 
Cubic spline interpolation. 
virtual const CrystVector_REAL & GetLSQObs(const unsigned int) const 
Get the observed values for the LSQ function. 
The namespace which includes all objects (crystallographic and algorithmic) in ObjCryst++. 
const PowderPattern & GetParentPowderPattern() const 
Get the PowderPattern object which uses this component. 
virtual const CrystVector_REAL & GetPowderPatternCalc() const 
Get the calculated powder pattern for this component. 
CrystVector_REAL mBayesianWeight
Weight=1.