IMP logo
IMP Reference Guide  2.10.0
The Integrative Modeling Platform
StudentTRestraint.h
Go to the documentation of this file.
1 /**
2  * \file IMP/isd/StudentTRestraint.h
3  * \brief A Student-t distribution restraint
4  *
5  * Copyright 2007-2018 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPISD_STUDENT_T_RESTRAINT_H
10 #define IMPISD_STUDENT_T_RESTRAINT_H
11 
12 #include <IMP/isd/isd_config.h>
13 #include <IMP/isd/FStudentT.h>
14 #include <IMP/Particle.h>
15 #include <IMP/Restraint.h>
16 
17 IMPISD_BEGIN_NAMESPACE
18 
19 //! A Student-t distribution restraint
20 /** It restraints 1 to 3 particles, with the mean \f$\mu\f$, standard deviation
21  \f$\sigma\f$ and degrees of freedom \f$\nu\f$ able to be constants or
22  Nuisance particles.
23 
24  \see FStudentT
25 */
26 class IMPISDEXPORT StudentTRestraint : public Restraint {
27  private:
28  Pointer<FStudentT> studentt_;
29  ParticleIndex px_, pmu_, psigma_, pnu_;
30  double x_, mu_, sigma_, nu_;
31  bool isx_, ismu_, issigma_, isnu_; // true if it's a particle
32 
33  private:
34  double get_x() const;
35  double get_mu() const;
36  double get_sigma() const;
37  double get_nu() const;
38  void initialize();
39  void update_distribution();
40 
41  public:
47  double sigma, ParticleIndexAdaptor nu);
49  ParticleIndexAdaptor sigma, double nu);
50  StudentTRestraint(Model *m, ParticleIndexAdaptor x, double mu, double sigma,
53  ParticleIndexAdaptor sigma, double nu);
55  double sigma, double nu);
56  StudentTRestraint(Model *m, ParticleIndexAdaptor x, double mu, double sigma,
57  double nu);
60  StudentTRestraint(Model *m, double x, double mu, ParticleIndexAdaptor sigma,
62  StudentTRestraint(Model *m, double x, ParticleIndexAdaptor mu, double sigma,
65  ParticleIndexAdaptor sigma, double nu);
66  StudentTRestraint(Model *m, double x, double mu, double sigma,
68  StudentTRestraint(Model *m, double x, double mu, ParticleIndexAdaptor sigma,
69  double nu);
70  StudentTRestraint(Model *m, double x, ParticleIndexAdaptor mu, double sigma,
71  double nu);
72 
73  //! Get probability (-log score)
74  double get_probability() const { return exp(-unprotected_evaluate(nullptr)); }
75 
76  virtual double unprotected_evaluate(IMP::DerivativeAccumulator *accum)
77  const IMP_OVERRIDE;
78 
80 
82 };
83 
84 IMPISD_END_NAMESPACE
85 
86 #endif /* IMPISD_STUDENT_T_RESTRAINT_H */
double get_probability() const
Get probability (-log score)
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
A more IMP-like version of the std::vector.
Definition: Vector.h:39
A smart pointer to a reference counted object.
Definition: Pointer.h:87
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:72
A Student-t distribution restraint.
Classes to handle individual model particles. (Note that implementation of inline functions is in int...
Abstract base class for all restraints.
Joint Student's t-distribution of Function.
virtual ModelObjectsTemp do_get_inputs() const =0
#define IMP_OVERRIDE
Cause a compile error if this method does not override a parent method.
Class for adding derivatives from restraints to the model.
A restraint is a term in an IMP ScoringFunction.
Definition: Restraint.h:54