LogLikelihoodPrior

class LogLikelihoodPrior : public LogLikelihood

A subclass of the LogLikelihood. This version is run by the Root process from within the DescentFunctor object. This object is almost identical to the base class, with the exception of its ability to call Prior functions.

Public Functions

inline LogLikelihoodPrior(const std::vector<std::vector<Star>> &data)
double TransformPrior(EfficiencyVector &x, int effectiveBatches)

Executes the Prior in transform space. Calls the TemporalBetaPrior on all x_t which lie within one of the pre-catalogued gaps, and hence ensures that our variance model expands to capture those gaps, rather than attempting to smooth over them.

Parameters
  • x – The current efficiency vector

  • effectiveBatches – the current number of minibatches

Returns

The value of the prior. The associated gradients are loaded into EfficiencyVector::TransformedGradient

double RawPrior(EfficiencyVector &x, int effectiveBatches)

Executes the Prior in Raw space. By design, the priors here are very simple (either Normal() or StudentT()) with zero mean and unit variance. The transform enforces any correlations or smoothing.

Parameters
Returns

The value of the prior. The associated gradients are loaded into EfficiencyVector::RawGradient

Prior Functions

Because the priors are often very small, repeatedble sections of code which we might want to swap out trivially, there are several small snippets designed to allow this.

Holder Struct

struct F_dF

A holder struct for the value and derivative of functions of a single variable. Useful in non-correlated priors

Public Functions

inline F_dF()

Default constructor: zero-initialised values.

inline F_dF(double f, double df)

In-place constructor function. Sets the passed values to their stored counterparts.

Public Members

double F

Functional value.

double dF

Functional derivative.

Predefined Priors

inline F_dF Normal(double x, double mu, double sigma)

Implementation of (the logarithm of) the Gaussian-normal prior N(X = x | mu, sigma)

Parameters
  • x – The parameter value

  • mu – The mean value of the prior on the parameter

  • sigma – The standard deviation of the prior on the parameter

inline F_dF StudentT(double x, double mu, double nu)

Implementation of (logarithm of) the Student-T prior S(X = x | mu, nu)

Parameters
  • x – The parameter value

  • mu – The mean value of the prior on the parameter

  • nu – The student-T parameter

inline F_dF TemporalBetaPrior(double x, double alpha, double beta)

Implementation of (the logarithm of) the Beta-Distribution prior B(P = p | alpha, beta) where p is the probability associated with the temporal efficiency parameter x_t

Parameters
  • x – The temporal efficiency parameter x_t (given by p_t = sigmoid(double x_t) )

  • alpha – The Beta distribution alpha-parameter (often set to gapPriorAlpha)

  • sigma – The Beta distribution beta-parameter (often set to gapPriorBeta)