Semi-nonparametric (SNP) approach has been implemented via
densities hermite polynomial approximation
Densities hermite polynomial approximation approach has been
proposed by A. Gallant and D. W. Nychka in 1987. The main idea is to
approximate unknown distribution density with hermite polynomial of
degree pol_degree
. In this framework hermite polynomial represents
adjusted (to insure integration to 1) product of squared polynomial and
normal distribution densities. Parameters mean
and sd
determine means and standard deviations of normal distribution density
functions which are parts of this polynomial.
For more information please refer to the literature listed below.
Parameters mean
, sd
, given_ind
,
omit_ind
should have the same length as pol_degrees
parameter.
The first polynomial coefficient (zero powers)
set to 1 for identification reasons.
Note that if is_z_coef_first_fixed
value is TRUE
then the coefficient for the first
independent variable in formula
will be fixed to 1.
If is_x0_probit = TRUE
then parameter sd
will be
scale adjusted in order to provide better initial point for optimization
routine. Please, extract sd
adjusted value from this function's
output list.
All variables mentioned in formula
should be numeric vectors.
The function calculates standard errors via sandwich estimator
and significance levels are reported taking into account quasi maximum
likelihood estimator (QMLE) asymptotic normality. If ones wants to switch
from QMLE to semi-nonparametric estimator (SNPE) during hypothesis testing
then covariance matrix should be estimated again using bootstrap.
This function maximizes (quasi) log-likelihood function
via optim
function setting it's method
argument to "BFGS". If opt_type = "GA"
then genetic
algorithm from ga
function
will be additionally (after optim
putting it's
solution (par
) to suggestions
matrix) applied in order to
perform global optimization. Note that global optimization takes
much more time (usually minutes but sometimes hours or even days).
The number of iterations and population size of the genetic algorithm
will grow linearly along with the number of estimated parameters.
If it is seems that global maximum has not been found than it
is possible to continue the search restarting the function setting
it's input argument x0
to x1
output value. Note that
if cov_type = "bootstrap"
then ga
function will not be used for bootstrap iterations since it
may be extremely time consuming.
If opt_type = "GA"
then opt_control
should be the
list containing the values to be passed to ga
function. It is possible to pass arguments lower
, upper
,
popSize
, pcrossover
, pmutation
, elitism
,
maxiter
, suggestions
, optim
, optimArgs
,
seed
and monitor
.
Note that it is possible to set population
,
selection
, crossover
and mutation
arguments changing
ga
default parameters via gaControl
function. These arguments information reported in ga
.
In order to provide manual values for lower
and upper
bounds
please follow parameters ordering mentioned above for the
x0
argument. If these bonds are not provided manually then
they (except those related to the polynomial coefficients)
will depend on the estimates obtained
by local optimization via optim
function
(this estimates will be in the middle
between lower
and upper
).
Specifically for each sd parameter lower
(upper
) bound
is 5 times lower (higher) then this
parameter optim
estimate.
For each mean and regression coefficient parameter it's lower and upper
bounds deviate from corresponding optim
estimate
by two absolute value of this estimate.
Finally, lower and upper bounds for each polynomial
coefficient are -10
and 10
correspondingly (do not depend
on their optim
estimates).
The following arguments are differ from their defaults in
ga
:
pmutation = 0.2
,
optim = TRUE
,
optimArgs =
list("method" = "Nelder-Mead", "poptim" = 0.2, "pressel" = 0.5)
,
seed = 8
,
elitism = 2 + round(popSize * 0.1)
.
Let's denote by n_reg
the number of regressors
included to the formula
.
The arguments popSize
and maxiter
of
ga
function have been set proportional to the number of
estimated polynomial coefficients and independent variables: