Functions

loglikelihood Namespace Reference

Functions

def loglikelihood
 Simply computes the log of the probability.
def mixedloglikelihood
 Compute a simulated loglikelihood function.
def likelihoodregression
 Computes likelihood function of a regression model.

Function Documentation

def loglikelihood::likelihoodregression (   meas,
  model,
  sigma 
)

Computes likelihood function of a regression model.

Parameters:
measAn expression providing the value $y$ of the measure for the current observation.
modelAn expression providing the output $m$ of the model for the current observation.
sigmaAn expression (typically, a parameter) providing the standard error $\sigma$ of the error term.
Returns:
The likelihood of the regression, assuming a normal distribution, that is

\[ \frac{1}{\sigma} \phi\left( \frac{y-m}{\sigma} \right) \]

where $ \phi(\cdot)$ is the pdf of the normal distribution.
 def likelihoodregression(meas,model,sigma):
     t = (meas - model) / sigma
     f = bioNormalPdf(t) / sigma
     return f
def loglikelihood::loglikelihood (   prob )

Simply computes the log of the probability.

Parameters:
probAn expression providing the value of the probability.
Returns:
The logarithm of the probability.
 def loglikelihood(prob):
     loglikelihood = log(prob)
     return loglikelihood
def loglikelihood::mixedloglikelihood (   prob )

Compute a simulated loglikelihood function.

Parameters:
probAn expression providing the value of the probability. Although it is not formally necessary, the expression should contain one or more random variables of a given distribution, and therefore write

\[ P(i|\xi_1,\ldots,\xi_L)\]

Returns:
The simulated loglikelihood, given by

\[ \ln\left(\sum_{r=1}^R P(i|\xi^r_1,\ldots,\xi^r_L) \right)\]

where $R$ is the number of draws, and $\xi_j^r$ is the rth draw of the random variable $\xi_j$.
 def mixedloglikelihood(prob):
     drawIterator('drawIter')
     l = Sum(prob,'drawIter')
     return log(l)
 All Classes Namespaces Files Functions Variables