A likelihood object, consisting of parameters. More...
#include <XeStat.h>
Public Member Functions | |
void | activateParameter (LKParameter *param, bool active=true) |
Activate (add or remove) a parameter with its own id. | |
void | addParameter (LKParameter *param, int id=SAME) |
add an existing parameter | |
void | addParameter (int id, int type, string nam, double initialVal, double step, double mi, double ma) |
Add a parameter. | |
void | addParameterTolerant (LKParameter *param) |
Add a parameter with its own id, wheter already added or not. | |
bool | checkConsistency () |
void | clearTheParameters () |
virtual double | computeTheLogLikelihood ()=0 |
void | forceNParametersOfInterest (int nF) |
int | getNActiveParameters () |
int | getNMinuitParameters () |
int | getNNuisanceParameters () |
int | getNParameters (int type) |
int | getNParametersForChi2 () |
int | getNParametersOfInterest () |
int | getNTotalParameters () |
LKParameter * | getParameter (int id) |
map< int, LKParameter * > * | getParameters () |
double | getParameterValue (int id) |
void | ignoreParameter (int id) |
bool | inCombinedMode () |
Likelihood () | |
Empty constructor for root. | |
Likelihood (string name) | |
Constructor. | |
void | listParameters () |
int | mapMinuitParameters (bool freezeParametersOfInterest) |
double | maximize (bool freezeParametersOfInterest) |
bool | parameterExists (int p) |
Check wheher a parameter exists. | |
void | printCurrentHeader () |
void | printCurrentParameters () |
void | printInitialHeader () |
void | printInitialParameters () |
void | printResultParameters () |
void | removeParameter (int id, bool tolerant=false) |
Remove a parameter giving its id. | |
void | removeParameter (LKParameter *param, bool tolerant=false) |
Remove a parameter with its own id. | |
void | replaceParameter (LKParameter *param, int id=SAME) |
Replace a parameter. | |
void | resetParameters () |
void | setCombinedMode (bool mode=true) |
void | setCurrentValues (const double *v, const double *ers=NULL) |
void | setCurrentValuesInMinuitUnits (const double *v, const double *e=NULL) |
void | setInitialValue (int id, double v) |
void | setParameterType (int id, int type) |
void | setParameterValue (int id, double v) |
void | setTheExperiment () |
pass the experiment number to whoever needs it after it was set. | |
Static Public Member Functions | |
static double | shapeLikelihood (vector< int > *bins, int nDist, double **dists, double *norm) |
return the shape LL that a set of values comes from a mixture of tabulated parent distribution. | |
static double | shapeLikelihood (vector< double > *values, vector< XeDist * > &dists, vector< double > &weights) |
return the shape LL that a set of values comes from a mixture of parent distributions. | |
static double | shapeLikelihood (vector< double > *values, XeDist *dist) |
return the shape LL that a set of values comes from a parent distribution | |
Protected Member Functions | |
bool | checkParameter (int p, bool shouldExist) |
void | clear () |
void | setup () |
Technical routine for constructors. | |
Protected Attributes | |
bool | combinedMode |
int | currentId |
int | forcedNParametersOfInterest |
vector< LKParameter * > | MinuitParameters |
int | nActiveParameters |
int | nNuisanceParameters |
int | nParametersOfInterest |
map< int, LKParameter * > | parameters |
A likelihood object, consisting of parameters.
This is a virtual class
Likelihood::Likelihood | ( | string | name | ) |
Constructor.
name | name of the object |
void Likelihood::activateParameter | ( | LKParameter * | param, | |
bool | active = true | |||
) |
Activate (add or remove) a parameter with its own id.
param | pointer to existing LKParameter | |
active | activate(true) or disable (true) |
void Likelihood::addParameter | ( | LKParameter * | param, | |
int | id = SAME | |||
) |
add an existing parameter
param | pointer to existing LKParameter | |
id | requested id, or SAME (the one coded in the parameter), or AUTO |
void Likelihood::addParameter | ( | int | id, | |
int | type, | |||
string | nam, | |||
double | initialVal, | |||
double | step, | |||
double | mi, | |||
double | ma | |||
) |
Add a parameter.
id | either its hard coded id or the keyword AUTO | |
type | NUISANCE_PARAMETER,PARAMETER_OF_INTEREST or FIXED_PARAMETER | |
name | parameter name | |
initialVal | initial value | |
step | step for minimisation | |
mi | minimum value | |
ma | maximum value |
void Likelihood::addParameterTolerant | ( | LKParameter * | param | ) |
Add a parameter with its own id, wheter already added or not.
param | pointer to existing LKParameter |
virtual double Likelihood::computeTheLogLikelihood | ( | ) | [pure virtual] |
none | All parameters values set thru LKParameter |
Implemented in S1S2PL, LikelihoodFromDataSet, CombinedProfileLikelihood, and PLcountingSB.
void Likelihood::removeParameter | ( | int | id, | |
bool | tolerant = false | |||
) |
Remove a parameter giving its id.
id | identifier | |
tolerant | don't issue a warning if it does not exist |
void Likelihood::removeParameter | ( | LKParameter * | param, | |
bool | tolerant = false | |||
) |
Remove a parameter with its own id.
param | pointer to existing LKParameter | |
tolerant | don't issue a warning if it does not exist |
void Likelihood::replaceParameter | ( | LKParameter * | param, | |
int | id = SAME | |||
) |
Replace a parameter.
If exists, delete the existing one
param | pointer to existing LKParameter | |
id | requested id, or SAME (the one coded in the parameter) |
static double Likelihood::shapeLikelihood | ( | vector< int > * | bins, | |
int | nDist, | |||
double ** | dists, | |||
double * | norm | |||
) | [static] |
return the shape LL that a set of values comes from a mixture of tabulated parent distribution.
Makes sure that no bin has a negative expetancy!
bins | list of bin number of input values | |
nDists | number of distributions | |
dists | tabulated distributions | |
norm | normalized weights (i.e. normalized to 1.) |
static double Likelihood::shapeLikelihood | ( | vector< double > * | values, | |
vector< XeDist * > & | dists, | |||
vector< double > & | weights | |||
) | [static] |
return the shape LL that a set of values comes from a mixture of parent distributions.
values | values | |
dists | parent distributions | |
weights | relative weight of distrubtions (needs not be normalized to 1) |
static double Likelihood::shapeLikelihood | ( | vector< double > * | values, | |
XeDist * | dist | |||
) | [static] |
return the shape LL that a set of values comes from a parent distribution
values | values | |
dist | parent distribution |