Public documentation
Contents
Index
GEEBRA.estimating_function_template
GEEBRA.objective_function_template
GEEBRA.estimating_function
GEEBRA.get_estimating_function
GEEBRA.objective_function
GEEBRA.tic
StatsBase.aic
StatsBase.coef
StatsBase.coeftable
StatsBase.fit
StatsBase.fit
StatsBase.stderror
StatsBase.vcov
Public interface
GEEBRA.estimating_function_template
— Typeestimating_function_template(nobs::Function, ef_contribution::Function)
Define an estimating_function_template
by supplying:
nobs
: a function ofdata
that computes the number of observations of the particular data type,ef_contribution
: a function of the parameterstheta
, thedata
and the observation indexi
that returns a vector of lengthlength(theta)
.
GEEBRA.get_estimating_function
— Functionget_estimating_function(data::Any, template::estimating_function_template, br::Bool = false)
Construct the estimating function by adding up all contributions in the data
according to estimating_function_template
. If br = true
then automatic differentiation is used to compute the empirical bias-reducing adjustments and add them to the estimating function. The result is a function that stores the estimating functions values at its second argument, in a preallocated vector passed as its first argument, ready to be used withing NLsolve.nlsolve
.
GEEBRA.estimating_function
— Functionestimating_function(theta::Vector, data::Any, template::estimating_function_template, br::Bool = false)
Construct the estimating function by adding up all contributions in the data
according to estimating_function_template
, and evaluate it at theta
. If br = true
then automatic differentiation is used to compute the empirical bias-reducing adjustments and add them to the estimating function.
GEEBRA.objective_function_template
— Typeobjective_function_template(nobs::Function, obj_contribution::Function)
Define an objective_function_template
by supplying:
nobs
: a function ofdata
that computes the number of observations of the particular data type,obj_contribution
: a function of the parameterstheta
, thedata
and the observation indexi
that returns a real.
GEEBRA.objective_function
— Functionobjective_function(theta::Vector, data::Any, template::objective_function_template, br::Bool = false)
Construct the objective function by adding up all contributions in the data
according to objective_function_template
, and evaluate it at theta
. If br = true
then automatic differentiation is used to compute the empirical bias-reducing penalty and add it to the objective function.
StatsBase.fit
— Methodfit(template::objective_function_template, data::Any, theta::Vector; estimation_method::String = "M", br_method::String = "implicit_trace", optim_method = LBFGS(), optim_options = Optim.Options())
Fit an objective_function_template
on data
using M-estimation (keyword argumentestimation_method = "M"
; default) or RBM-estimation (reduced-bias M estimation; Kosmidis & Lunardon, 2020; keyword argumentestimation_method = "RBM"
). Bias reduction is either through the maximization of the bias-reducing penalized objective in Kosmidis & Lunardon (2020) (keyword argumentbr_method = "implicit_trace"
; default) or by subtracting an estimate of the bias from the M-estimates (keyword argumentbr_method = "explicit_trace"
). The bias-reducing penalty is constructed internally using automatic differentiation (using the ForwardDiff package), and the bias estimate using a combination of automatic differentiation (using the ForwardDiff package) and numerical differentiation (using the FiniteDiff package).
The maximization of the objective or the penalized objective is done using the Optim package. Optimization methods and options can be supplied directly through the keyword argumentsoptim_method
and optim_options
, respectively. optim_options
expects an object of class Optim.Options
. See the Optim documentation for more details on the available options.
StatsBase.fit
— Methodfit(template::estimating_function_template, data::Any, theta::Vector; estimation_method::String = "M", br_method::String = "implicit_trace", nlsolve_arguments...)
Fit an estimating_function_template
on data
using M-estimation (keyword argumentestimation_method = "M"
; default) or RBM-estimation (reduced-bias M estimation; Kosmidis & Lunardon, 2020; keyword argumentestimation_method = "RBM"
). Bias reduction is either through the solution of the empirically adjusted estimating functions in Kosmidis & Lunardon (2020) (keyword argumentbr_method = "implicit_trace"
; default) or by subtracting an estimate of the bias from the M-estimates (keyword argumentbr_method = "explicit_trace"
). The bias-reducing adjustments and the bias estimate are constructed internally using automatic differentiation (using the ForwardDiff package).
The solution of the estimating equations or the adjusted estimating equations is done using the NLsolve package. Arguments can be passed directly to NLsolve.nlsolve
through keyword arguments. See the NLsolve README for more information on available options.
StatsBase.coef
— Functioncoef(results::GEEBRA_results)
Extract the M
-estimates or their reduced-bias versions from the output of fit
for an objective_function_template
or an estimating_function_template
.
StatsBase.vcov
— Functionvcov(results::GEEBRA_results)
Compute an esitmate of the variance-covariance matrix of the M
-estimator or its reduced-bias version from the output of fit
for an objective_function_template
or an estimating_function_template
.
StatsBase.stderror
— Functionstderror(results::GEEBRA_results)
Compute esitmated standard errors for the M
-estimator or its reduced-bias version from the output of fit
for an objective_function_template
or an estimating_function_template
.
StatsBase.coeftable
— Functioncoeftable(results::GEEBRA_results; level::Real=0.95)
Return a StatsBase.CoefTable
for the M
-estimator or its reduced-bias version from the output of fit
for an objective_function_template
or an estimating_function_template
. level
can be used to set the level of the reported Wald-type confidence intervals (using quantiles of the standard normal distribution).
GEEBRA.tic
— Functiontic(results::GEEBRA_results)
Compute the Takeuchi Information Criterion at the M
-estimator or its reduced-bias version from the output of fit
for an objective_function_template
. nothing
is returned if results
is the output of fit
for an estimating_function_template
.
StatsBase.aic
— Functionaic(results::GEEBRA_results)
Compute the Akaike Information Criterion at the M
-estimator or its reduced-bias version from the output of fit
for an objective_function_template
. nothing
is returned if results
is the output of fit
for an estimating_function_template
.