Title: | One-Step Estimation |
---|---|
Description: | Provide principally an eponymic function that numerically computes the Le Cam's one-step estimator for an independent and identically distributed sample. One-step estimation is asymptotically efficient (see L. Le Cam (1956) <https://projecteuclid.org/euclid.bsmsp/1200501652>) and can be computed faster than the maximum likelihood estimator for large observation samples, see e.g. Brouste et al. (2021) <doi:10.32614/RJ-2021-044>. |
Authors: | Alexandre Brouste [aut] , Christophe Dutang [aut, cre] , Darel Noutsa Mieniedou [ctb] |
Maintainer: | Christophe Dutang <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.9.4 |
Built: | 2024-11-17 05:10:20 UTC |
Source: | https://github.com/cran/OneStep |
Provide principally an eponymic function that numerically computes the Le Cam's one-step estimator for an independent and identically distributed sample. One-step estimation is asymptotically efficient (see L. Le Cam (1956) <https://projecteuclid.org/euclid.bsmsp/1200501652>) and can be computed faster than the maximum likelihood estimator for large observation samples, see e.g. Brouste et al. (2021) <doi:10.32614/RJ-2021-044>.
The DESCRIPTION file:
Package: | OneStep |
Type: | Package |
Title: | One-Step Estimation |
Version: | 0.9.4 |
Authors@R: | c(person("Alexandre", "Brouste", role = "aut", email = "[email protected]", comment = c(ORCID = "0000-0001-6719-7432")), person("Christophe", "Dutang", role = c("aut", "cre"), email = "[email protected]", comment = c(ORCID = "0000-0001-6732-1501")), person("Darel", "Noutsa Mieniedou", role = "ctb")) |
Contact: | Alexandre Brouste, Christophe Dutang <[email protected]> |
Description: | Provide principally an eponymic function that numerically computes the Le Cam's one-step estimator for an independent and identically distributed sample. One-step estimation is asymptotically efficient (see L. Le Cam (1956) <https://projecteuclid.org/euclid.bsmsp/1200501652>) and can be computed faster than the maximum likelihood estimator for large observation samples, see e.g. Brouste et al. (2021) <doi:10.32614/RJ-2021-044>. |
License: | GPL (>= 2) |
Encoding: | UTF-8 |
Depends: | fitdistrplus, numDeriv, parallel, extraDistr |
Suggests: | actuar |
URL: | https://journal.r-project.org/archive/2021/RJ-2021-044/ |
Classification/MSC-2010: | 62F10 |
NeedsCompilation: | no |
Packaged: | 2024-10-17 13:49:08 UTC; dutang |
Author: | Alexandre Brouste [aut] (<https://orcid.org/0000-0001-6719-7432>), Christophe Dutang [aut, cre] (<https://orcid.org/0000-0001-6732-1501>), Darel Noutsa Mieniedou [ctb] |
Maintainer: | Christophe Dutang <[email protected]> |
Date/Publication: | 2024-10-17 16:50:09 UTC |
Repository: | https://dutangc.r-universe.dev |
RemoteUrl: | https://github.com/cran/OneStep |
RemoteRef: | HEAD |
RemoteSha: | 42fd01175d506d07b74d186257089ee1466aeeb6 |
Index of help topics:
OneStep-package One-Step Estimation benchonestep Performing benchmark of one-step MLE against other methods onestep Executing Le Cam's one-step estimation
Alexandre Brouste [aut] (<https://orcid.org/0000-0001-6719-7432>), Christophe Dutang [aut, cre] (<https://orcid.org/0000-0001-6732-1501>), Darel Noutsa Mieniedou [ctb]
Maintainer: Christophe Dutang <[email protected]>
L. LeCam (1956). On the asymptotic theory of estimation and testing hypothesis. In: Proceedings of 3rd Berkeley Symposium I, pages 355-368.
See fitdistrplus
for classic MLE, MME,...
benchonestep
performs a benchmark of one-step MLE against other methods on a given dataset.
benchonestep.replicate
repeats several times the procedure: data random generation and benchmark through benchonestep
.
benchonestep(data, distr, methods, init, weights=NULL,...) benchonestep.replicate(nsample, nbsimu, distr, methods=NULL, echo=FALSE, ncpus=1, ...)
benchonestep(data, distr, methods, init, weights=NULL,...) benchonestep.replicate(nsample, nbsimu, distr, methods=NULL, echo=FALSE, ncpus=1, ...)
data |
A numeric vector of length |
distr |
A character string |
methods |
A vector of methods: character among
|
init |
A named list for the intial guess method. |
weights |
An optional vector of weights to be used in the fitting process.
Should be |
... |
unused for |
nsample |
a numeric for the sample size. |
nbsimu |
a numeric for the replication number. |
echo |
a logical to display or not some traces of benchmarking. |
ncpus |
Number of processes to be used in parallel operation: typically one would fix it to the number of available CPUs. |
A matrix with estimate and time in seconds per method for benchonestep
;
an array with estimates, times, errors in seconds per method, per simulation for benchonestep.replicate
.
Alexandre Brouste, Darel Noutsa Mieniedou, Christophe Dutang
L. LeCam (1956). On the asymptotic theory of estimation and testing hypothesis. In: Proceedings of 3rd Berkeley Symposium I, pages 355-368.
n <- 1000 set.seed(1234) x <- rbeta(n, 3, 2) benchonestep(x, "beta", c("mle", "one"))
n <- 1000 set.seed(1234) x <- rbeta(n, 3, 2) benchonestep(x, "beta", c("mle", "one"))
Executing Le Cam's one-step estimation based on Le Cam (1956) and Kamatani and Uchida (2015).
onestep(data, distr, method, init, weights = NULL, keepdata = TRUE, keepdata.nb=100, control=list(), ...)
onestep(data, distr, method, init, weights = NULL, keepdata = TRUE, keepdata.nb=100, control=list(), ...)
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 |
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.
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 function
plotdist
. 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 (function cdfcomp
),
a density plot(function denscomp
),
a density Q-Q plot (function qqcomp
),
or a P-P plot (function ppcomp
).
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.
Alexandre Brouste, Christophe Dutang, Darel Noutsa Mieniedou
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 as mledist
and fitdist
in fitdistrplus.
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))
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))