Class EstimateByLogLikelihood


  • public class EstimateByLogLikelihood
    extends Object
    Result from maximum likelihood fitting algorithm, which contains:
    • the log-likelihood function,
    • the fitted parameters for the target model,
    • the variance-covariance matrix,
    • the standard errors,
    • the confidence intervals.
    • Constructor Detail

      • EstimateByLogLikelihood

        public EstimateByLogLikelihood​(Vector fittedParameters,
                                       RealScalarFunction logLikelihoodFunction)
    • Method Detail

      • getFittedParameters

        public ImmutableVector getFittedParameters()
        Get the fitted parameters. That is, the parameters that evaluate to the maximum log-likelihood.
        Returns:
        the fitted parameters for the model
      • getLogLikelihoodFunction

        public RealScalarFunction getLogLikelihoodFunction()
        Get the log-likelihood function. That is, \[ \ell(\theta | X_1,\ldots,X_n) = \sum_{i=1}^n \log f(X_i| \theta) \] where \(\theta\) is the parameter, \(X_i\) are the observations, \(f(.)\) is the probability density function.
        Returns:
        the log-likelihood function
      • logLikelihood

        public double logLikelihood()
        Compute the log-likelihood at the fitted value. That is, the maximum log-likelihood.
        Returns:
        the maximum log-likelihood computed at the fitted value
      • covarianceMatrix

        public Matrix covarianceMatrix()
        Get the covariance matrix, which is estimated as the inverse of negative Hessian matrix of the log-likelihood function valued at the fitted parameter.
        Returns:
        the covariance matrix
      • standardError

        public Vector standardError()
        Get the standard errors of the fitted parameters.
        Returns:
        the standard errors
      • confidenceInterval

        public ConfidenceInterval confidenceInterval​(double confidenceLevel)
        Compute the \((1 - \alpha)100\%\) confidence intervals for each element of the fitted parameter, given the required confidence level. That is, \[ CI = (\hat{\theta} \pm z_{\alpha/2} \hat{\sigma}_{\hat{\theta}}) \] where \(\hat{\theta}\) is the fitted parameter, \(\hat{\sigma}_{\hat{\theta}}\) is the standard error of the estimate.
        Parameters:
        confidenceLevel - the required confidence level
        Returns:
        the confidence interval