Learn R Programming

distrMod (version 2.9.4)

meRes: helper functions for mceCalc and mleCalc

Description

helper functions to produce consistent lists to be digested in functions mceCalc and mleCalc

Usage

meRes(x, estimate, criterion.value, param, crit.fct, method = "explicit solution",
      crit.name = "Maximum Likelihood", Infos, warns = "", startPar = NULL,
      optReturn = NULL)
get.criterion.fct(theta, Data, ParamFam, criterion.ff, fun, ...)
# S4 method for numeric
samplesize(object)

Value

meRes

a list of prescribed structure to be digested in functions mceCalc and mleCalc by the internal helper function .process.meCalcRes.

get.criterion.fct

a function; see details below;

samplesize

numeric

Arguments

x

numeric; the data at which to evaluate the estimate

estimate

numeric; the estimate

criterion.value

numeric; the value of the criterion

param

object of class ParamFamParameter; the parameter value

crit.fct

a function to fill slot minuslogl when an object of class MCEstimate is coerced to class mle (from package stats4); to this end function get.criterion.fct (also see details below) is helpful (at least if the dimension of the estimator is larger than 1).

method

character; describes how the estimate was obtained

crit.name

character; name of the criterion

Infos

optional matrix of characters in two columns; information to be attached to the estimate

warns

collected warnings in optimization

samplesize

numeric; the sample size at which the estimator was evaluated

theta

the parameter value as named numeric vector

Data

numeric; the data at which to evaluate the MCE

ParamFam

an object of class ParamFamily; the parametric family at which to evaluate the MCE

criterion.ff

the criterion function used in the MCE

fun

wrapper to the criterion function used in the MCE (with certain checking whether parameter value is permitted and possibly penalizing if not; see code to , for example.)

startPar

value of argument StartPar --- starting parameter used.

optReturn

object of class "ANY" the return value of the optimizer (or NULL if, e.g., closed form solutions are used).

...

further arguments to be passed to optim / optimize

object

numeric; the data at which to evaluate the estimate

Author

Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de

Details

get.criterion.fct produces a function criterion.fct to fill slot minuslogl when an object of class MCEstimate is coerced to class mle (from package stats4); this way we may use profiling methods introduced there also for objects of our classes. More specifically, we produce a function where all coordinates/components of theta appear as separate named arguments, which then calls fun with these separate arguments again stacked to one (named) vector argument;

samplesize determines the samplesize of argument object,i.e.; if object has an attribute dim, it returns dim(object)[2], else length(object).