Learn R Programming

mkin (version 0.9.49.5)

logLik.mkinfit: Calculated the log-likelihood of a fitted mkinfit object

Description

This function simply calculates the product of the likelihood densities calculated using dnorm, i.e. assuming normal distribution, with of the mean predicted by the degradation model, and the standard deviation predicted by the error model.

The total number of estimated parameters returned with the value of the likelihood is calculated as the sum of fitted degradation model parameters and the fitted error model parameters.

Usage

# S3 method for mkinfit
logLik(object, ...)

Arguments

object

An object of class mkinfit.

For compatibility with the generic method

Value

An object of class logLik with the number of estimated parameters (degradation model parameters plus variance model parameters) as attribute.

See Also

Compare the AIC of columns of mmkin objects using AIC.mmkin.

Examples

Run this code
# NOT RUN {
  
# }
# NOT RUN {
  sfo_sfo <- mkinmod(
    parent = mkinsub("SFO", to = "m1"),
    m1 = mkinsub("SFO")
  )
  d_t <- FOCUS_2006_D
  f_nw <- mkinfit(sfo_sfo, d_t, quiet = TRUE) # no weighting (weights are unity)
  f_obs <- mkinfit(sfo_sfo, d_t, error_model = "obs", quiet = TRUE)
  f_tc <- mkinfit(sfo_sfo, d_t, error_model = "tc", quiet = TRUE)
  AIC(f_nw, f_obs, f_tc)
  
# }

Run the code above in your browser using DataLab