Gadget
Public Member Functions | Protected Attributes | List of all members
Likelihood Class Referenceabstract

This is the base class used to calculate the likelihood scores used to compare the modelled data in the input data. More...

#include <likelihood.h>

Inheritance diagram for Likelihood:
Inheritance graph
Collaboration diagram for Likelihood:
Collaboration graph

Public Member Functions

 Likelihood (LikelihoodType T, double w, const char *givenname)
 This is the default Likelihood constructor. More...
 
virtual ~Likelihood ()
 This is the default Likelihood destructor. More...
 
virtual void addLikelihood (const TimeClass *const TimeInfo)=0
 This function will calculate the likelihood score for the current model. More...
 
virtual void addLikelihoodKeeper (const TimeClass *const TimeInfo, Keeper *const keeper)
 This function will calculate the likelihood score for the current model after adjusting the parameters. More...
 
virtual void Reset (const Keeper *const keeper)
 This function will reset the likelihood information. More...
 
virtual void Reset (const TimeClass *const TimeInfo)
 This function will reset the likelihood information. More...
 
virtual void Print (ofstream &outfile) const =0
 This function will print the summary likelihood information. More...
 
virtual void printLikelihood (ofstream &outfile, const TimeClass *const TimeInfo)
 This function will print information from each likelihood calculation. More...
 
virtual void printSummary (ofstream &outfile)
 This function will print summary information from each likelihood calculation. More...
 
double getLikelihood () const
 This will return the weighted likelihood score for the likelihood component. More...
 
LikelihoodType getType () const
 This will return the type of likelihood class. More...
 
double getUnweightedLikelihood () const
 This will return the unweighted likelihood score for the likelihood component. More...
 
double getWeight () const
 This will return the weight applied to the likelihood component. More...
 
virtual void setFleetsAndStocks (FleetPtrVector &Fleets, StockPtrVector &Stocks)
 This will select the fleets and stocks required to calculate the likelihood score. More...
 
- Public Member Functions inherited from HasName
 HasName ()
 This is the default HasName constructor. More...
 
virtual ~HasName ()
 This is the default HasName destructor. More...
 
 HasName (const char *givenname)
 This is the HasName constructor for a specified name. More...
 
const char * getName () const
 This will return a null terminated text string containing the name of the object. More...
 

Protected Attributes

double likelihood
 This stores the calculated score for the likelihood component. More...
 
double weight
 This stores the weight to be applied to the likelihood component. More...
 

Detailed Description

This is the base class used to calculate the likelihood scores used to compare the modelled data in the input data.

Note
This will always be overridden by the derived classes that actually calculate the likelihood scores

Constructor & Destructor Documentation

◆ Likelihood()

Likelihood::Likelihood ( LikelihoodType  T,
double  w,
const char *  givenname 
)
inline

This is the default Likelihood constructor.

Parameters
Tis the LikelihoodType for the likelihood component
wis the weight for the likelihood component
givennameis the name of the likelihood component

◆ ~Likelihood()

virtual Likelihood::~Likelihood ( )
inlinevirtual

This is the default Likelihood destructor.

Member Function Documentation

◆ addLikelihood()

virtual void Likelihood::addLikelihood ( const TimeClass *const  TimeInfo)
pure virtual

This function will calculate the likelihood score for the current model.

Parameters
TimeInfois the TimeClass for the current model

Implemented in UnderStocking, SurveyIndices, SurveyDistribution, StomachContent, StockDistribution, RecStatistics, Recaptures, ProgLikelihood, MigrationProportion, MigrationPenalty, CatchStatistics, CatchInKilos, CatchDistribution, and BoundLikelihood.

◆ addLikelihoodKeeper()

virtual void Likelihood::addLikelihoodKeeper ( const TimeClass *const  TimeInfo,
Keeper *const  keeper 
)
inlinevirtual

This function will calculate the likelihood score for the current model after adjusting the parameters.

Parameters
TimeInfois the TimeClass for the current model
keeperis the Keeper for the current model

Reimplemented in BoundLikelihood.

◆ getLikelihood()

double Likelihood::getLikelihood ( ) const
inline

This will return the weighted likelihood score for the likelihood component.

Returns
weight*likelihood

◆ getType()

LikelihoodType Likelihood::getType ( ) const
inline

This will return the type of likelihood class.

Returns
type

◆ getUnweightedLikelihood()

double Likelihood::getUnweightedLikelihood ( ) const
inline

This will return the unweighted likelihood score for the likelihood component.

Returns
likelihood

◆ getWeight()

double Likelihood::getWeight ( ) const
inline

This will return the weight applied to the likelihood component.

Returns
weight

◆ Print()

virtual void Likelihood::Print ( ofstream &  outfile) const
pure virtual

This function will print the summary likelihood information.

Parameters
outfileis the ofstream that all the model information gets sent to

Implemented in UnderStocking, SurveyIndices, SurveyDistribution, StomachContent, StockDistribution, RecStatistics, Recaptures, ProgLikelihood, MigrationProportion, MigrationPenalty, CatchStatistics, CatchInKilos, CatchDistribution, and BoundLikelihood.

◆ printLikelihood()

virtual void Likelihood::printLikelihood ( ofstream &  outfile,
const TimeClass *const  TimeInfo 
)
inlinevirtual

This function will print information from each likelihood calculation.

Parameters
outfileis the ofstream that all the model likelihood information gets sent to
TimeInfois the TimeClass for the current model

Reimplemented in SurveyIndices, SurveyDistribution, StomachContent, StockDistribution, RecStatistics, Recaptures, ProgLikelihood, MigrationProportion, CatchStatistics, CatchInKilos, and CatchDistribution.

◆ printSummary()

virtual void Likelihood::printSummary ( ofstream &  outfile)
inlinevirtual

This function will print summary information from each likelihood calculation.

Parameters
outfileis the ofstream that all the model likelihood information gets sent to

Reimplemented in UnderStocking, SurveyIndices, SurveyDistribution, StomachContent, StockDistribution, RecStatistics, Recaptures, MigrationProportion, MigrationPenalty, CatchStatistics, CatchInKilos, CatchDistribution, and BoundLikelihood.

◆ Reset() [1/2]

virtual void Likelihood::Reset ( const Keeper *const  keeper)
inlinevirtual

This function will reset the likelihood information.

Parameters
keeperis the Keeper for the current model

Reimplemented in UnderStocking, SurveyIndices, SurveyDistribution, StomachContent, StockDistribution, RecStatistics, Recaptures, ProgLikelihood, MigrationProportion, MigrationPenalty, CatchStatistics, CatchInKilos, CatchDistribution, and BoundLikelihood.

◆ Reset() [2/2]

virtual void Likelihood::Reset ( const TimeClass *const  TimeInfo)
inlinevirtual

This function will reset the likelihood information.

Parameters
keeperis the Keeper for the current model

Reimplemented in ProgLikelihood.

◆ setFleetsAndStocks()

virtual void Likelihood::setFleetsAndStocks ( FleetPtrVector Fleets,
StockPtrVector Stocks 
)
inlinevirtual

This will select the fleets and stocks required to calculate the likelihood score.

Parameters
Fleetsis the FleetPtrVector of all the available fleets
Stocksis the StockPtrVector of all the available stocks

Reimplemented in SurveyIndices, SurveyDistribution, StockDistribution, RecStatistics, Recaptures, ProgLikelihood, MigrationProportion, MigrationPenalty, CatchStatistics, CatchInKilos, and CatchDistribution.

Member Data Documentation

◆ likelihood

double Likelihood::likelihood
protected

This stores the calculated score for the likelihood component.

◆ weight

double Likelihood::weight
protected

This stores the weight to be applied to the likelihood component.


The documentation for this class was generated from the following file: