Products & Services Solutions Academia Support User Community Company

Learn more about Statistics Toolbox   

betalike - Beta negative log-likelihood

Syntax

nlogL = betalike(params,data)
[nlogL,AVAR] = betalike(params,data)

Description

nlogL = betalike(params,data) returns the negative of the beta log-likelihood function for the beta parameters a and b specified in vector params and the observations specified in the column vector data. The length of nlogL is the length of data.

[nlogL,AVAR] = betalike(params,data) also returns AVAR, which is the asymptotic variance-covariance matrix of the parameter estimates if the values in params are the maximum likelihood estimates. AVAR is the inverse of Fisher's information matrix. The diagonal elements of AVAR are the asymptotic variances of their respective parameters.

betalike is a utility function for maximum likelihood estimation of the beta distribution. The likelihood assumes that all the elements in the data sample are mutually independent. Since betalike returns the negative beta log-likelihood function, minimizing betalike using fminsearch is the same as maximizing the likelihood.

Examples

This example continues the betafit example, which calculates estimates of the beta parameters for some randomly generated beta distributed data.

r = betarnd(4,3,100,1);
[nlogl,AVAR] = betalike(betafit(r),r)
nlogl =
 -39.1615
AVAR =
  0.3717  0.2644
  0.2644  0.2414

See Also

betacdf | betafit | betainv | betapdf | betarnd | betastat

How To

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS