ObjCryst::PowderPatternBackgroundBayesianMinimiser Class Reference

This object is used to estimate the background in a powder pattern, using a Bayesian approach (David & Sivia, Acta Cryst A50 (1994), 703). More...

Inheritance diagram for ObjCryst::PowderPatternBackgroundBayesianMinimiser:
Inheritance graph
[legend]
Collaboration diagram for ObjCryst::PowderPatternBackgroundBayesianMinimiser:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 PowderPatternBackgroundBayesianMinimiser (PowderPatternBackground &backgd)
virtual const string & GetClassName () const
 Name for this class ("RefinableObj", "Crystal",...). This is only useful to distinguish different classes when picking up objects from the RefinableObj Global Registry.
virtual REAL GetLogLikelihood () const
 Get -log(likelihood) of the current configuration for the object.

Static Public Member Functions

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.

Public Attributes

PowderPatternBackgroundmpBackground

Detailed Description

This object is used to estimate the background in a powder pattern, using a Bayesian approach (David & Sivia, Acta Cryst A50 (1994), 703).

Definition at line 36 of file PowderPatternBackgroundBayesianMinimiser.h.


Member Function Documentation

REAL ObjCryst::PowderPatternBackgroundBayesianMinimiser::BayesianBackgroundLogLikelihood ( const REAL  t  )  [static]

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.

34(2001), 318).

Returns:
  • $ L(t) = \frac{\left(y^{calc}_{Background}-y^{obs}\right)^2}{2\sigma^2}$ for <0
  • $ L(t) = A-\log{\int_\epsilon^{\infty} {\frac{1}{u} e^{-(t-u)^2} du}}$ for t>0, with: $\epsilon = 1e-6$, $ t = \frac{y^{calc}_{Background}-y^{obs}}{\sigma\sqrt{2}}$ and A a normalizing constant so that the function is continuous for t=0 (i.e. L(0)=0).
Parameters:
\form::25 For small t>0 values, L(t) behaves like a quadratic function, and for large positive values it is equivalent to $ \log{\frac{\sqrt{\pi}}{t}}$.

As the integral diverges for $\epsilon=0$, it is necessary to use a small, non-null $\epsilon$. The use of a smaller $\epsilon$ changes the range over which the function behaves quadratically, as well as the maximum value (at t=0), but does not affect the asymptotic value.

See tabulated values in the source code. The function is approximated with a cubic spline until t=8, and then uses the asymptotic$A-\log{\frac{\sqrt{\pi}}{t}}$ value.

Note:
For a more strict calculation, we should include a normalizing constant (?)

Definition at line 115 of file PowderPatternBackgroundBayesianMinimiser.cpp.

REAL ObjCryst::PowderPatternBackgroundBayesianMinimiser::GetLogLikelihood (  )  const [virtual]

Get -log(likelihood) of the current configuration for the object.

By default (no likelihood evaluation available), this is equal to 0.

This call should not be recursive, it is the task of the algorithm to get the sum of likelihoods for all objects invlolved.

Note:
contrary to the old "Cost Function" approach, with log(Likelihood) there is no 'choice' of cost function, so that it is the task of the object to give the optimized likelihood (possibly with user options).
Warning:
: this is in under heavy development, so expect changes...

Reimplemented from ObjCryst::RefinableObj.

Definition at line 45 of file PowderPatternBackgroundBayesianMinimiser.cpp.


The documentation for this class was generated from the following files:

Generated on Mon Dec 7 23:06:22 2009 for FOX/ObjCryst++ by  doxygen 1.6.1