Windham {scorematchingad} | R Documentation |
Windham Robustification of Point Estimators for Exponential Family Distributions
Description
Performs a generalisation of Windham's robustifying method (Windham 1995) for exponential models with natural parameters that are a linear function of the parameters for estimation. Estimators must solve estimating equations of the form
The estimate is found iteratively through a fixed point method as suggested by Windham (1995).
Usage
Windham(
Y,
estimator,
ldenfun,
cW,
...,
fpcontrol = list(Method = "Simple", ConvergenceMetricThreshold = 1e-10),
paramvec_start = NULL,
alternative_populationinverse = FALSE
)
Arguments
Y |
A matrix of measurements. Each row is a measurement, each component is a dimension of the measurement. |
estimator |
A function that estimates parameters from weighted observations.
It must have arguments |
ldenfun |
A function that returns a vector of values proportional to the log-density for a matrix of observations |
cW |
A vector of robustness tuning constants. When computing the weight for an observation the parameter vector is multiplied element-wise with |
... |
Arguments passed to |
fpcontrol |
A named list of control arguments to pass to |
paramvec_start |
Initially used to check the function |
alternative_populationinverse |
The default is to use |
Details
For any family of models with density , Windham's method finds the parameter set
such that the estimator applied to observations weighted by
returns an estimate that matches the theoretical effect of weighting the full population of the model.
When
is proportional to
and
is linear, these weights are equivalent to
and the theoretical effect of the weighting on the full population is to scale the parameter vector
by
.
The function Windham()
assumes that is proportional to
and
is linear. It allows a generalisation where
is a vector so the weight for an observation
is
where is the parameter vector,
is a vector of tuning constants, and
is the element-wise product (Hadamard product).
The solution is found iteratively (Windham 1995).
Given a parameter set ,
Windham()
first computes weights for each observation
.
Then, a new parameter set
is estimated by
estimator
with the computed weights.
This new parameter set is element-wise-multiplied by the (element-wise) reciprocal of to obtain an adjusted parameter set
.
The estimate returned by
Windham()
is the parameter set such that
.
Value
A list:
-
paramvec
the estimated parameter vector -
optim
information about the fixed point iterations and optimisation process. Including a slotfinalweights
for the weights in the final iteration.
See Also
Other generic score matching tools:
cppad_closed()
,
cppad_search()
Other Windham robustness functions:
ppi_robust()
,
vMF_robust()
Examples
if (requireNamespace("movMF")){
Y <- movMF::rmovMF(1000, 100 * c(1, 1) / sqrt(2))
} else {
Y <- matrix(rnorm(1000 * 2, sd = 0.01), ncol = 2)
Y <- Y / sqrt(rowSums(Y^2))
}
Windham(Y = Y,
estimator = vMF,
ldenfun = function(Y, theta){ #here theta is km
return(drop(Y %*% theta))
},
cW = c(0.01, 0.01),
method = "Mardia")