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)
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);
81 return JA_ / (sqrt(2 *
IMP::PI) * sigma_) *
82 exp(-square(FA_ - FM_) / (2 * square(sigma_)));
85 IMPISD_DEPRECATED_FUNCTION_DECL(2.8)
86 virtual double density()
const {
87 IMPISD_DEPRECATED_FUNCTION_DEF(2.8,
"Use get_density() instead");
92 void set_FA(
double f) { FA_ = f; }
93 void set_JA(
double f) { JA_ = f; }
94 void set_FM(
double f) { FM_ = f; }
95 void set_sigma(
double f) { sigma_ = f; }
102 double FA_, JA_, FM_, sigma_;
Declare an efficient stl-compatible map.
Base class for single-variate distributions that cache sufficient statistics.
OneDimensionalSufficientDistribution(std::string name="OneDimensionalSufficientDistribution %1%")
Constructor.
double get_density() const
Get probability density using cached sufficient statistics.
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.
#define IMP_OVERRIDE
Cause a compile error if this method does not override a parent method.