| fit_control | R Documentation |
feglm Control ParametersSet and change parameters used for fitting feglm, felm, and fenegbin. Termination conditions are similar to glm.
fit_control(
dev_tol = 1e-06,
center_tol = 1e-06,
collin_tol = 1e-08,
step_halving_factor = 0.5,
alpha_tol = 1e-05,
iter_max = 50L,
iter_center_max = 10000L,
iter_inner_max = 50L,
iter_alpha_max = 10000L,
step_halving_memory = 0.9,
max_step_halving = 2L,
start_inner_tol = 1e-05,
grand_acc_period = 4L,
centering = "berge",
sep_tol = 1e-08,
sep_zero_tol = 1e-08,
sep_mu_tol = 1e-06,
sep_max_iter = 200L,
sep_simplex_max_iter = 2000L,
sep_use_relu = TRUE,
sep_use_simplex = TRUE,
sep_use_mu = TRUE,
return_fe = TRUE,
keep_tx = FALSE,
keep_data = FALSE,
return_hessian = FALSE,
check_separation = TRUE,
init_theta = 0,
vcov_type = NULL,
expectile = NULL,
expectile_tol = 1e-12,
expectile_iter_max = 50L,
expectile_glm_iter_max = NULL,
expectile_trace = FALSE
)
dev_tol |
tolerance level for the first stopping condition of the maximization routine. The stopping condition
is based on the relative change of the deviance in iteration |
center_tol |
tolerance level for the stopping condition of the centering algorithm. The stopping condition is
based on the relative change of the centered variable similar to the |
collin_tol |
tolerance level for detecting collinearity. The default is |
step_halving_factor |
numeric indicating the factor by which the step size is halved to iterate towards
convergence. This is used to control the step size during optimization. The default is |
alpha_tol |
tolerance for fixed effects (alpha) convergence. The default is |
iter_max |
integer indicating the maximum number of iterations in the maximization routine. The default is
|
iter_center_max |
integer indicating the maximum number of iterations in the centering algorithm. The default is
|
iter_inner_max |
integer indicating the maximum number of iterations in the inner loop of the centering
algorithm. The default is |
iter_alpha_max |
maximum iterations for fixed effects computation. The default is |
step_halving_memory |
numeric memory factor for step-halving algorithm. Controls how much of the previous
iteration is retained. The default is |
max_step_halving |
maximum number of post-convergence step-halving attempts. The default is |
start_inner_tol |
starting tolerance for inner solver iterations. The default is |
grand_acc_period |
integer indicating the period (in iterations) for grand acceleration in the centering
algorithm. Grand acceleration applies a second-level Irons-Tuck extrapolation on the overall convergence
trajectory. Lower values (e.g., 4-10) may speed up convergence for difficult problems. Set to a very large
value (e.g., 10000) to effectively disable. The default is |
centering |
character string indicating the centering algorithm to use for demeaning fixed effects.
|
sep_tol |
tolerance for separation detection. The default is |
sep_zero_tol |
tolerance for treating values as zero in separation detection. The default is |
sep_mu_tol |
tolerance for mu-based separation detection during IRLS iterations. Observations with
|
sep_max_iter |
maximum iterations for ReLU separation detection algorithm. The default is |
sep_simplex_max_iter |
maximum iterations for simplex separation detection algorithm. The default is |
sep_use_relu |
logical indicating whether to use the ReLU algorithm for separation detection. The default is |
sep_use_simplex |
logical indicating whether to use the simplex algorithm for separation detection. The default is |
sep_use_mu |
logical indicating whether to use mu-based separation detection during IRLS iterations.
This catches observations where predicted values become extremely small (suggesting perfect prediction
of zeros). Following ppmlhdfe methodology. The default is |
return_fe |
logical indicating if the fixed effects should be returned. This can be useful when fitting general
equilibrium models where skipping the fixed effects for intermediate steps speeds up computation. Set it to
|
keep_tx |
logical indicating if the centered regressor matrix should be stored. The default is |
keep_data |
logical indicating if the filtered data should be stored in the result object. Required for
|
return_hessian |
logical indicating if the Hessian matrix should be returned. The Hessian is a P*P
matrix used to compute the variance-covariance matrix. The default is |
check_separation |
logical indicating whether to perform separation detection for Poisson models. When |
init_theta |
Initial value for the negative binomial dispersion parameter (theta). The default is |
vcov_type |
Optional character string specifying the type of variance-covariance estimator to be used.
When |
expectile |
numeric value between 0 and 1 (exclusive) specifying the expectile for asymmetric
Poisson pseudo-maximum likelihood (APPML) estimation. When |
expectile_tol |
tolerance level for the stopping condition of the expectile iteration algorithm. The convergence criterion uses a hybrid approach: the algorithm converges when the squared norm
of coefficient changes |
expectile_iter_max |
integer indicating the maximum number of iterations for the expectile
reweighting algorithm. The default is |
expectile_glm_iter_max |
integer indicating the maximum number of inner GLM (IRLS) iterations
per APPML outer iteration. When |
expectile_trace |
logical indicating whether to print iteration information during expectile
estimation. The default is |
A named list of control parameters.
By default, fit_control() returns "thin" model objects with minimal memory footprint:
keep_data = FALSE - data not stored
return_fe = FALSE - fixed effects not stored
return_hessian = FALSE - Hessian not stored
keep_tx = FALSE - centered matrix not stored
feglm, felm, and fenegbin
ross2004_subset <- ross2004[ross2004$year == 1999, ]
ross2004_subset <- ross2004_subset[ross2004_subset$ltrade >
quantile(ross2004_subset$ltrade, 0.75), ]
felm(ltrade ~ ldist | ctry1, ross2004_subset,
control = fit_control(dev_tol = 1e-10, center_tol = 1e-10)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.