home
about
news
download
doc
source
systems
tests
bugs
contact
IMP Reference Guide
2.11.0
The Integrative Modeling Platform
IMP Manual
Reference Guide
Tutorial Index
Modules
Classes
Examples
include
IMP
isd
version 2.11.0
NormalSigmaPCRestraint.h
Go to the documentation of this file.
1
/**
2
* \file IMP/isd/NormalSigmaPCRestraint.h
3
* \brief A Penalized Complexity prior on sigma of a normal distribution.
4
*
5
* Copyright 2007-2019 IMP Inventors. All rights reserved.
6
*
7
*/
8
9
#ifndef IMPISD_NORMAL_SIGMA_PC_RESTRAINT_H
10
#define IMPISD_NORMAL_SIGMA_PC_RESTRAINT_H
11
12
#include <IMP/isd/isd_config.h>
13
#include <
IMP/isd/PenalizedComplexityPrior.h
>
14
#include <
IMP/isd/Scale.h
>
15
#include <
IMP/Particle.h
>
16
#include <
IMP/Restraint.h
>
17
18
IMPISD_BEGIN_NAMESPACE
19
20
//! A Penalized Complexity prior on sigma of a normal distribution.
21
/** The Penalized Complexity (PC) prior on sigma minimizes the complexity (and
22
resulting risk of over-fitting) introduced by deviation from a delta
23
function (\f$\sigma=0\f$) to a normal distribution. Its density is
24
25
\f[ p(\sigma) = \frac{-\log\alpha}{\sigma_u} \alpha^{\sigma / \sigma_u},\f]
26
27
where \f$\sigma_u\f$ is a user-specified value of \f$\sigma\f$ that
28
indicates a 'tail event', a value that it is unexpected to exceed, and
29
\f$\alpha = p(\sigma > \sigma_u)\f$ is the density in the tail.
30
31
\see PenalizedComplexityPrior
32
33
\note The prior is related by a change of variables to the PC prior on the
34
precision tau in Simpson et al. Stat Sci. (2017) 32(1): 1. arXiv: 1403.4630,
35
which is a type 2 Gumbel distribution.
36
*/
37
class
IMPISDEXPORT
NormalSigmaPCRestraint
:
public
Restraint
{
38
39
private
:
40
Pointer<PenalizedComplexityPrior>
pcp_;
41
ParticleIndex
spi_;
42
double
su_, nloga_;
43
44
void
create_distribution(
double
alpha);
45
46
public
:
47
NormalSigmaPCRestraint
(
Model
*m,
ParticleIndex
spi,
double
su,
double
alpha,
48
std::string name =
"NormalSigmaPCRestraint%1%"
);
49
50
NormalSigmaPCRestraint
(
Scale
s,
double
su,
double
alpha,
51
std::string name =
"NormalSigmaPCRestraint%1%"
);
52
53
Scale
get_sigma()
const
;
54
55
double
get_alpha()
const
{
return
std::exp(-nloga_); }
56
57
double
get_sigma_upper()
const
{
return
su_; }
58
59
double
get_probability()
const
{
return
std::exp(-unprotected_evaluate(
nullptr
)); }
60
61
virtual
double
unprotected_evaluate(
IMP::DerivativeAccumulator
*accum)
62
const
IMP_OVERRIDE
;
63
64
virtual
IMP::ModelObjectsTemp
do_get_inputs
()
const
IMP_OVERRIDE
;
65
66
IMP_OBJECT_METHODS
(
NormalSigmaPCRestraint
);
67
};
68
69
IMPISD_END_NAMESPACE
70
71
#endif
/* IMPISD_NORMAL_SIGMA_PC_RESTRAINT_H */
IMP_OBJECT_METHODS
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition:
object_macros.h:25
IMP::Index< ParticleIndexTag >
Scale.h
A decorator for scale parameters particles.
IMP::isd::Scale
Add scale parameter to particle.
Definition:
Scale.h:24
IMP::Vector
A more IMP-like version of the std::vector.
Definition:
Vector.h:39
IMP::Pointer
A smart pointer to a reference counted object.
Definition:
Pointer.h:87
IMP::Model
Class for storing model, its restraints, constraints, and particles.
Definition:
Model.h:72
PenalizedComplexityPrior.h
Penalized complexity prior.
Particle.h
Classes to handle individual model particles. (Note that implementation of inline functions is in int...
IMP::isd::NormalSigmaPCRestraint
A Penalized Complexity prior on sigma of a normal distribution.
Definition:
NormalSigmaPCRestraint.h:37
Restraint.h
Abstract base class for all restraints.
IMP::ModelObject::do_get_inputs
virtual ModelObjectsTemp do_get_inputs() const =0
IMP_OVERRIDE
#define IMP_OVERRIDE
Cause a compile error if this method does not override a parent method.
Definition:
compiler_macros.h:78
IMP::DerivativeAccumulator
Class for adding derivatives from restraints to the model.
Definition:
DerivativeAccumulator.h:25
IMP::Restraint
A restraint is a term in an IMP ScoringFunction.
Definition:
Restraint.h:54