IMP  2.0.0
The Integrative Modeling Platform
vonMisesKappaConjugateRestraint.h
Go to the documentation of this file.
1 /**
2  * \file IMP/isd/vonMisesKappaConjugateRestraint.h
3  * \brief Conjugate prior for \f$\kappa\f$ in the von Mises distribution.
4  *
5  * Copyright 2007-2013 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPISD_VON_MISES_KAPPA_CONJUGATE_RESTRAINT_H
10 #define IMPISD_VON_MISES_KAPPA_CONJUGATE_RESTRAINT_H
11 
12 #include <IMP/isd/isd_config.h>
13 #include <IMP/SingletonScore.h>
14 #include "ISDRestraint.h"
15 #include <IMP/restraint_macros.h>
16 
17 IMPISD_BEGIN_NAMESPACE
18 
19 //! Conjugate prior for the concentration parameter of a von Mises distribution.
20 /** \f[ p(\kappa|c,R_0) = \frac{\exp(\kappa R_0)}{I_0(\kappa)^c} \f]
21  \f$0 < R_0 \le c\f$
22  where \f$kappa\f$ is the concentration parameter.
23  Default values: \f$R_0=1\f$ and \f$c=10\f$
24  */
25 class IMPISDEXPORT vonMisesKappaConjugateRestraint : public ISDRestraint
26 {
27  Pointer<Particle> kappa_;
28  double old_kappaval;
29  bool bessel_init_;
30  double I0_,I1_;
31  double c_,R0_;
32 
33 public:
34  //! Create the restraint.
35  vonMisesKappaConjugateRestraint(Particle *kappa, double c=10.0,
36  double R0=0.0);
37 
38  /** This macro declares the basic needed methods: evaluate and show
39  */
41 
42  virtual double get_probability() const;
43 
44 private:
45 
46  void update_bessel(double kappaval); // update memoized bessel value
47  double get_kappa() const;
48 
49 };
50 
51 IMPISD_END_NAMESPACE
52 
53 #endif /* IMPISD_VON_MISES_KAPPA_CONJUGATE_RESTRAINT_H */