WOLFRAM

LogLikelihood[dist,{x1,x2,}]

gives the loglikelihood function for observations x1, x2, from the distribution dist.

LogLikelihood[proc,{{t1,x1},{t2,x2},}]

gives the log-likelihood function for the observations xi at time ti from the process proc.

LogLikelihood[proc,{path1,path2,}]

gives the log-likelihood function for the observations from path1, path2, from the process proc.

Details

  • The loglikelihood function LogLikelihood[dist,{x1,x2,}] is given by , where is the probability density function at xi, PDF[dist,xi].
  • For a scalarvalued process proc, the log-likelihood function LogLikelihood[proc,{{t1,x1},{t2,x2},}] is given by LogLikelihood[SliceDistribution[proc,{t1,t2,}],{{x1,x2,}}].
  • For a vectorvalued process proc, the log-likelihood function LogLikelihood[proc,{{t1,{x1,,z1},{t2,{x2,,z2}},}] is given by LogLikelihood[SliceDistribution[proc,{t1,t2,}],{{x1,,z1,x2,,z2,}}].
  • The log-likelihood function for a collection of paths LogLikelihood[proc,{path1,path2,}] is given by sum_iLogLikelihood[proc,pathi].

Examples

open allclose all

Basic Examples  (4)Summary of the most common use cases

Get the loglikelihood function for a normal distribution:

Out[2]=2

Compute a loglikelihood for numeric data:

Out[2]=2

Plot loglikelihood contours as a function of and :

Out[3]=3

Compute the loglikelihood for multivariate data:

Out[2]=2

Compute the log-likelihood for a process:

Out[2]=2

Scope  (12)Survey of the scope of standard use cases

Univariate Parametric Distributions  (2)

Compute the loglikelihood for a continuous distribution:

Out[2]=2

Compute the loglikelihood for a discrete distribution:

Out[1]=1

Plot the loglikelihood, assuming is unknown:

Out[2]=2

Multivariate Parametric Distributions  (2)

Obtain the loglikelihood for a continuous multivariate distribution with unknown parameters:

Out[14]=14

Visualize the loglikelihood surface, assuming :

Out[15]=15

For a multivariate discrete distribution with known parameters:

Out[2]=2

Derived Distributions  (5)

Compute the loglikelihood for a truncated standard normal:

Out[3]=3

Plot the loglikelihood contours as a function of the truncation points:

Out[4]=4

Compute the loglikelihood for a constructed distribution:

Out[1]=1
Out[2]=2

Compute the loglikelihood for a product distribution:

Out[3]=3

Obtain the result as a sum of the independent componentwise loglikelihoods:

Out[4]=4

Compute the loglikelihood for a copula distribution:

Plot the loglikelihood as a function of the kernel parameter:

Out[3]=3

Compute the loglikelihood for a component mixture:

Out[3]=3

Random Processes  (3)

Compute the log-likelihood of a continuous parametric process:

Out[3]=3

Compute the log-likelihood of a scalar-valued discrete parametric process:

Out[2]=2

Plot the loglikelihood as a function of the process parameter:

Out[3]=3

Compute the log-likelihood of a scalar-valued time series process:

Out[2]=2

Compute the log-likelihood of a vector-valued time series process:

Out[4]=4

Applications  (4)Sample problems that can be solved with this function

Visualize the loglikelihood surface for a distribution of two parameters:

Out[2]=2

Visualize as contours of equal loglikelihood:

Out[2]=2

Show log-likelihood functions with mixed continuous and discrete parameters:

Out[2]=2
Out[3]=3

Solve for the Poisson maximum log-likelihood estimate in closed form:

Out[1]=1
Out[2]=2

Compute a maximum log-likelihood estimate directly:

Maximize:

Out[3]=3

Label the optimal point on a plot of the log-likelihood function:

Out[4]=4

Estimate the variance of the MLE estimator as the reciprocal of the expectation of second derivative of the log-likelihood function with respect to parameters:

Out[5]=5

Properties & Relations  (5)Properties of the function, and connections to other functions

LogLikelihood is the sum of logs of PDF values for data:

Out[6]=6
Out[7]=7

LogLikelihood is the log of Likelihood:

Out[2]=2
Out[3]=3
Out[4]=4

EstimatedDistribution estimates parameters by maximizing the loglikelihood:

Out[2]=2

FindDistributionParameters gives the parameter estimates as rules:

Out[3]=3

Visualize the loglikelihood function near the optimal value:

Out[4]=4

Log-likelihood of a process can be computed using its slice distribution:

Out[2]=2

Use the slice distribution:

Out[4]=4

For a vector-valued process:

Out[6]=6

Use the slice distribution:

Vectorize the path values for use in the LogLikelihood of the time slice distribution:

Out[8]=8

Given a sample from a distribution , the difference between values of LogLikelihood for and the MLE estimated distribution doubled is random and follows ChiSquareDistribution with degrees of freedom equal to the number of distribution parameters:

Draw samples from a 5-parameter binormal distribution in 1000 batches:

Compute the difference of log-likelihoods for each batch:

Check that the log-likelihood differences are consistent with distribution:

Out[4]=4
Out[5]=5

Possible Issues  (1)Common pitfalls and unexpected behavior

Log-likelihood of a continuous parametric process may be undefined:

Out[3]=3

This is due to degenerate slice distribution at time 0:

Out[4]=4

Start at positive time:

Out[6]=6

Neat Examples  (2)Surprising or curious use cases

Visualize isosurfaces for an exponential power loglikelihood:

Out[2]=2

Visualize isosurfaces for a bivariate normal loglikelihood:

Out[2]=2
Wolfram Research (2010), LogLikelihood, Wolfram Language function, https://reference.wolfram.com/language/ref/LogLikelihood.html (updated 2014).
Wolfram Research (2010), LogLikelihood, Wolfram Language function, https://reference.wolfram.com/language/ref/LogLikelihood.html (updated 2014).

Text

Wolfram Research (2010), LogLikelihood, Wolfram Language function, https://reference.wolfram.com/language/ref/LogLikelihood.html (updated 2014).

Wolfram Research (2010), LogLikelihood, Wolfram Language function, https://reference.wolfram.com/language/ref/LogLikelihood.html (updated 2014).

CMS

Wolfram Language. 2010. "LogLikelihood." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/LogLikelihood.html.

Wolfram Language. 2010. "LogLikelihood." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/LogLikelihood.html.

APA

Wolfram Language. (2010). LogLikelihood. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/LogLikelihood.html

Wolfram Language. (2010). LogLikelihood. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/LogLikelihood.html

BibTeX

@misc{reference.wolfram_2025_loglikelihood, author="Wolfram Research", title="{LogLikelihood}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/LogLikelihood.html}", note=[Accessed: 16-April-2025 ]}

@misc{reference.wolfram_2025_loglikelihood, author="Wolfram Research", title="{LogLikelihood}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/LogLikelihood.html}", note=[Accessed: 16-April-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_loglikelihood, organization={Wolfram Research}, title={LogLikelihood}, year={2014}, url={https://reference.wolfram.com/language/ref/LogLikelihood.html}, note=[Accessed: 16-April-2025 ]}

@online{reference.wolfram_2025_loglikelihood, organization={Wolfram Research}, title={LogLikelihood}, year={2014}, url={https://reference.wolfram.com/language/ref/LogLikelihood.html}, note=[Accessed: 16-April-2025 ]}