>  Docs Center  >  Libraries  >  Beaumont  >  LN_LIKE




  This function calculates the log-likelihood of the data, under a
  lognormal model. This distribution is given by
  f(x) = C * 1 / x * exp(-(ln(x) - mu)^2 / sigma^2)
    C = sqrt(2) / (sigma sqrt(pi)) /
          erfc( (ln(xmin) - mu) / sqrt(2 sigma) )
    C simplifies to 1 / sqrt(2 pi sigma^2) if xmin = 0



Calling Sequence

  result = ln_like([params, derivs, data = data, xmin = xmin, sigma =
          sigma, mu = mu])

Optional Inputs

  params: A two element vector specifying [alpha, xmin].
  derivs: A named variable to hold the partial derivative of the
          log-likelihood with respect to alpha and xmin.

Keyword Parameters

  data: A vector of data values, assumed to be >= xmin
  alpha: Another way to specify alpha. This takes precedence over any
        variable stored in params[0].
  xmin: Another way to specify xmin. This takes precedence over any
        variable stored in params[1].


  Ln(Product( f(data_i) ) )


  To maximize speed, the function does not check for values of data <
  xmin. However, the output is useless when any data are < xmin.

Modification History

  June 2009 Written by Chris Beaumont

© 2022 Harris Geospatial Solutions, Inc. |  Legal
My Account    |    Store    |    Contact Us