onestep {OneStep} | R Documentation |
Executing Le Cam's one-step estimation
Description
Executing Le Cam's one-step estimation based on Le Cam (1956) and Kamatani and Uchida (2015).
Usage
onestep(data, distr, method, init, weights = NULL,
keepdata = TRUE, keepdata.nb=100, control=list(), ...)
Arguments
data |
A numeric vector of length |
distr |
A character string |
method |
A character string coding for the fitting method:
|
init |
A named list for the user initial guess estimation. |
weights |
an optional vector of weights to compute the final likelihood.
Should be |
keepdata |
a logical. If |
keepdata.nb |
When |
control |
a list of control parameters. Currently,
|
... |
further arguments passe to |
Details
The Le Cam one-step estimation procedure is based on an initial sequence of guess estimators and a Fisher scoring step or a single Newton step on the loglikelihood function. For the user, the function onestep chooses automatically the best procedure to be used. The function OneStep presents internally several procedures depending on whether the sequence of initial guess estimators is in a closed form or not, and on whether the score and the Fisher information matrix can be elicited in a closed form. "Closed formula" distributions are treated with explicit score and Fisher information matrix (or Hessian matrix). For all other distributions, if the density function is well defined, the numerical computation (NumDeriv
) of the Newton step in Le Cam’s one-step is proposed with an initial sequence of guess estimators which is the sequence of maximum likelihood estimators computed on a subsample.
Value
onestep
returns an object of class "onestep"
inheriting from "fitdist"
So, it is a list with the following components:
estimate |
the parameter estimates. |
method |
the character string coding for the fitting method :
|
sd |
the estimated standard errors, |
cor |
the estimated correlation matrix, |
vcov |
the estimated variance-covariance matrix, |
loglik |
the log-likelihood. |
aic |
the Akaike information criterion. |
bic |
the the so-called BIC or SBC (Schwarz Bayesian criterion). |
n |
the length of the data set. |
data |
the data set. |
distname |
the name of the distribution. |
dots |
the list of further arguments passed in ... to be used . |
convergence |
an integer code for the convergence:
|
discrete |
the input argument or the automatic definition by the function to be passed
to functions |
weights |
the vector of weigths used in the estimation process or |
nbstep |
the number of Newton step, 0 for closed-form MLE, 1 for one-step estimators and 2 for two-step estimators. |
delta |
delta parameter (used for sub-sample guess estimator). |
Generic functions inheriting from "fitdist"
objects:
print
-
The print of a
"onestep"
object shows few traces about the fitting method and the fitted distribution. summary
-
The summary provides the parameter estimates of the fitted distribution, the log-likelihood, AIC and BIC statistics and when the maximum likelihood is used, the standard errors of the parameter estimates and the correlation matrix between parameter estimates.
plot
-
The plot of an object of class "onestep" returned by
fitdist
uses the functionplotdist
. An object of class "onestep" or a list of objects of class "onestep" corresponding to various fits using the same data set may also be plotted using a cdf plot (functioncdfcomp
), a density plot(functiondenscomp
), a density Q-Q plot (functionqqcomp
), or a P-P plot (functionppcomp
). logLik
Extracts the estimated log-likelihood from the
"onestep"
object.vcov
Extracts the estimated var-covariance matrix from the
"onestep"
object.coef
Extracts the fitted coefficients from the
"onestep"
object.
Author(s)
Alexandre Brouste, Christophe Dutang, Darel Noutsa Mieniedou
References
L. Le Cam (1956). On the asymptotic theory of estimation and testing hypothesis, In: Proceedings of 3rd Berkeley Symposium I, 355-368.
I.A. Koutrouvelis (1982). Estimation of Location and Scale in Cauchy Distributions Using the Empirical Characteristic Function, Biometrika, 69(1), 205-213.
U. Grenander (1965). Some direct estimates of the mode, Annals of Mathematical Statistics, 36, 131-138.
K. Kamatani and M. Uchida (2015). Hybrid multi-step estimators for stochastic differential equations based on sampled data, Stat Inference Stoch Process, 18(2), 177-204.
Z.-S. Ye and N. Chen (2017). Closed-Form Estimators for the Gamma Distribution Derived From Likelihood Equations, The American Statistician, 71(2), 177-181.
See Also
See Also as mledist
and fitdist
in fitdistrplus.
Examples
n <- 1000
set.seed(1234)
##1. Gamma
theta <- c(2, 3)
o.sample <- rgamma(n, shape=theta[1], rate=theta[2])
#Default method
onestep(o.sample, "gamma")
#User initial sequence of guess estimator
# See : Ye and Chen (2017)
qtmp <- sum(o.sample*log(o.sample))-sum(log(o.sample))*mean(o.sample)
alphastar <- sum(o.sample)/qtmp
betastar <- qtmp/length(o.sample)
thetastar <- list(shape=alphastar,rate=1/betastar)
onestep(o.sample, "gamma", init=thetastar)
#Numerical method (for comparison)
onestep(o.sample, "gamma", method="numeric")
##2.Beta
theta <- c(0.5, 1.5)
o.sample <- rbeta(n, shape1=theta[1], shape2=theta[2])
onestep(o.sample, "beta")
##3. Cauchy
theta <- c(2, 3)
o.sample <- rcauchy(n, location=theta[1], scale=theta[2])
onestep(o.sample, "cauchy")
#User initial sequence of guess estimator
#See Koutrouvelis (1982).
t <- 1/4
Phi <- mean(exp(1i*t*o.sample))
S <- Re(Phi)
Z <- Im(Phi)
thetastar <- list(location=atan(Z/S)/t,scale=-log(sqrt(S^2+Z^2))/t)
onestep(o.sample, "cauchy", init=thetastar)
##Chi2
theta <- 5
o.sample <- rchisq(n,df=theta)
onestep(o.sample,"chisq")
#User initial sequence of guess estimator
#See Grenander (1965).
p <- n^(2/7)
k <- floor(n^(3/5))
Dstar <- sort(o.sample)
Dk1 <- Dstar[(1+k):n]
Dk2 <- Dstar[1:(n-k)]
sigma.star <- 1/2*sum((Dk1+Dk2)*(Dk1-Dk2)^(-p))/sum((Dk1-Dk2)^(-p))+2
onestep(o.sample,"chisq",init=list(df=sigma.star))
#Negative Binomial
theta <- c(1, 5)
o.sample <- rnbinom(n, size=theta[1], mu=theta[2])
onestep(o.sample, "nbinom")
#Generic (dweibull2)
theta <- c(0.8, 3)
dweibull2 <- function(x, shape, scale, log=FALSE)
dweibull(x = x, shape = shape, scale = scale, log = log)
o.sample <- rweibull(n, shape = theta[1], scale = 1/theta[2])
onestep(o.sample, "weibull2", method="numeric",
init=list(shape=1, scale=1))