7 #ifndef IMPISD_FNORMAL_H
8 #define IMPISD_FNORMAL_H
10 #include <IMP/isd/isd_config.h>
17 IMPISD_BEGIN_NAMESPACE
39 FNormal(
double FA,
double JA,
double FM,
double sigma)
49 virtual void do_update_sufficient_statistics(
Floats data)
override {
53 virtual Floats do_get_sufficient_statistics()
const override {
58 virtual double do_evaluate()
const override {
59 return -log(JA_ / sigma_) + 0.5 * log(2 *
IMP::PI) +
60 1 / (2 * square(sigma_)) * square(FA_ - FM_);
64 virtual double evaluate_derivative_FA()
const {
65 return (FA_ - FM_) / square(sigma_);
68 virtual double evaluate_derivative_JA()
const {
return -1 / JA_; }
71 virtual double evaluate_derivative_FM()
const {
72 return (FM_ - FA_) / square(sigma_);
75 virtual double evaluate_derivative_sigma()
const {
76 return 1 / sigma_ - square(FA_ - FM_) / pow(sigma_, 3);
80 virtual double do_get_density()
const override {
81 return JA_ / (sqrt(2 *
IMP::PI) * sigma_) *
82 exp(-square(FA_ - FM_) / (2 * square(sigma_)));
86 void set_FA(
double f) { FA_ = f; }
87 void set_JA(
double f) { JA_ = f; }
88 void set_FM(
double f) { FM_ = f; }
89 void set_sigma(
double f) { sigma_ = f; }
96 double FA_, JA_, FM_, sigma_;
Helper functions to check for NaN or infinity.
Base class for single-variate distributions that cache sufficient statistics.
OneDimensionalSufficientDistribution(std::string name="OneDimensionalSufficientDistribution %1%")
Constructor.
static const double PI
the constant pi
Various useful constants.
IMP::Vector< Float > Floats
Standard way to pass a bunch of Float values.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Storage of a model, its restraints, constraints and particles.
Various general useful macros for IMP.
Base class for probability distributions.
void update_sufficient_statistics(Floats vs)
Update cached sufficient statistics from data.