Learn R Programming

distrMod (version 2.1.1)

mceCalc-methods: Methods for functions mceCalc and mleCalc in Package `distrMod'

Description

Methods for functions mceCalc and mleCalc in package distrMod;

Usage

mceCalc(x, PFam, ...)
mleCalc(x, PFam, ...)
## S3 method for class 'numeric,ParamFamily':
mceCalc(x, PFam, criterion, 
                   startPar = NULL, penalty = 0, crit.name,
                   Infos = NULL, \dots)
## S3 method for class 'numeric,ParamFamily':
mleCalc(x, PFam, startPar = NULL, 
                   penalty = 0, Infos = NULL, \dots)
## S3 method for class 'numeric,BinomFamily':
mleCalc(x, PFam, \dots)
## S3 method for class 'numeric,PoisFamily':
mleCalc(x, PFam, \dots)
## S3 method for class 'numeric,NormLocationFamily':
mleCalc(x, PFam, \dots)
## S3 method for class 'numeric,NormScaleFamily':
mleCalc(x, PFam, \dots)
## S3 method for class 'numeric,NormLocationScaleFamily':
mleCalc(x, PFam, \dots)

Arguments

x
numeric; data at which to evaluate the estimator
PFam
an object of class ParamFamily; the parametric family at which to evaluate the estimator
criterion
a function measuring the ``goodness of fit''
startPar
in case optim is used: a starting value for the parameter fit; in case optimize is used: a vector containing a search interval for the (one-dim) parameter
penalty
numeric; penalizes non-permitted parameter values
crit.name
character; the name of the criterion; may be missing
Infos
matrix; info slot to be filled in object of class MCEstimate; may be missing
...
additional argument(s) for optim / optimize

Value

  • a list with components
  • estimate--- the estimate as a named vector of numeric
  • criterion--- the criterion value (i.e.; a numeric of length 1); e.g. the neg. log likelihood
  • est.name--- the name of the estimator
  • param--- estimate coerced to class ParamFamParameter
  • crit.fct--- a function with the named components of theta as arguments returning the criterion value; used for profiling / coercing to class mle
  • method--- a character reporting how the estimate was obtained, i.e., by optim, by optimize or by explicit calculations
  • crit.namecharacter; the name of the criterion; may be ""
  • Infosmatrix; info slot to be filled in object of class MCEstimate; may be NULL
  • samplesizenumeric; sample size of x

Details

mceCalc is used internally by function MCEstimator to allow for method dispatch according to argument PFam; similarly, and for the same purpose mleCalc is used internally by function MLEstimator. This way we / or any other developper can write particular methods for special cases where we may avoid using numerical optimization without interfering with existing code. For programming one's own mleCalc / mceCalc methods, there is the helper function meRes to produce consistent return values.