Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

trafoEst

Function trafoEst in Package ‘distrMod’


Description

trafoEst takes a tau like function (compare trafo-methods) and transforms an existing estimator by means of this transformation.

Usage

trafoEst(fct, estimator)

Arguments

fct

a tau like function, i.e., a function in the main part theta of the parameter returning a list list(fval, mat) where fval is the function value tau(theta) of the transformation, and mat, its derivative matrix at theta.

estimator

an object of class Estimator.

Details

The disadvantage of this proceeding is that the transformation is not accounted for in determining the estimate (e.g. in a corresponding optimality); it simply transforms an existing estimator, without reapplying it to data. This becomes important in optimally robust estimation.

Value

exactly the argument estimator, but with modified slots estimate, asvar, and trafo.

Examples

## Gaussian location and scale
NS <- NormLocationScaleFamily(mean=2, sd=3)
## generate data out of this situation
x <- r(distribution(NS))(30)

## want to estimate mu/sigma, sigma^2
## -> without new trafo slot:
mtrafo <- function(param){
  mu <- param["mean"]
  sd <- param["sd"]
  fval <- c(mu/sd, sd^2)
  nfval <- c("mu/sig", "sig^2")
  names(fval) <- nfval
  mat <- matrix(c(1/sd,0,-mu/sd^2,2*sd),2,2)
  dimnames(mat) <- list(nfval,c("mean","sd"))
  return(list(fval=fval, mat=mat))
}

## Maximum likelihood estimator in the original problem
res0 <- MLEstimator(x = x, ParamFamily = NS)
## transformation
res <- trafoEst(mtrafo, res0)
## confidence interval
 confint(res)

distrMod

Object Oriented Implementation of Probability Models

v2.8.4
LGPL-3
Authors
Matthias Kohl [aut, cph], Peter Ruckdeschel [cre, cph], R Core Team [ctb, cph] (for source file 'format.perc')
Initial release
2020-03-06

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.