IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
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-2022 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
17IMPISD_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*/
26class 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:
42 StudentTRestraint(Model *m, ParticleIndexAdaptor x, ParticleIndexAdaptor mu,
44 StudentTRestraint(Model *m, ParticleIndexAdaptor x, double mu,
46 StudentTRestraint(Model *m, ParticleIndexAdaptor x, ParticleIndexAdaptor mu,
47 double sigma, ParticleIndexAdaptor nu);
48 StudentTRestraint(Model *m, ParticleIndexAdaptor x, ParticleIndexAdaptor mu,
49 ParticleIndexAdaptor sigma, double nu);
50 StudentTRestraint(Model *m, ParticleIndexAdaptor x, double mu, double sigma,
52 StudentTRestraint(Model *m, ParticleIndexAdaptor x, double mu,
53 ParticleIndexAdaptor sigma, double nu);
54 StudentTRestraint(Model *m, ParticleIndexAdaptor x, ParticleIndexAdaptor mu,
55 double sigma, double nu);
56 StudentTRestraint(Model *m, ParticleIndexAdaptor x, double mu, double sigma,
57 double nu);
58 StudentTRestraint(Model *m, double x, ParticleIndexAdaptor mu,
60 StudentTRestraint(Model *m, double x, double mu, ParticleIndexAdaptor sigma,
62 StudentTRestraint(Model *m, double x, ParticleIndexAdaptor mu, double sigma,
64 StudentTRestraint(Model *m, double x, ParticleIndexAdaptor mu,
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
77 const override;
78
79 virtual IMP::ModelObjectsTemp do_get_inputs() const override;
80
81 IMP_OBJECT_METHODS(StudentTRestraint);
82};
83
84IMPISD_END_NAMESPACE
85
86#endif /* IMPISD_STUDENT_T_RESTRAINT_H */
Joint Student's t-distribution of Function.
Classes to handle individual model particles. (Note that implementation of inline functions is in int...
Abstract base class for all restraints.
Class for adding derivatives from restraints to the model.
Take Decorator, Particle or ParticleIndex.
Restraint(Model *m, std::string name)
Create a restraint and register it with the model.
double get_probability() const
Get probability (-log score).
virtual double unprotected_evaluate(IMP::DerivativeAccumulator *accum) const override
Return the unweighted score for the restraint.
virtual IMP::ModelObjectsTemp do_get_inputs() const override
Index< ParticleIndexTag > ParticleIndex
Definition base_types.h:196
IMP::Vector< IMP::WeakPointer< ModelObject > > ModelObjectsTemp
Definition base_types.h:122
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
A smart pointer to a reference counted object.
Definition Pointer.h:88