subboafit: Fit an Asymmetric Power Exponential density via maximum...

subboafitR Documentation

Fit an Asymmetric Power Exponential density via maximum likelihood

Description

subboafit returns the parameters, standard errors. negative log-likelihood and covariance matrix of the asymmetric power exponential for a sample. The process can execute two steps, dependending on the level of accuracy required. See details below.

Usage

subboafit(
  data,
  verb = 0L,
  method = 6L,
  interv_step = 10L,
  provided_m_ = NULL,
  par = as.numeric(c(2, 2, 1, 1, 0)),
  g_opt_par = as.numeric(c(0.1, 0.01, 100, 0.001, 1e-05, 2)),
  itv_opt_par = as.numeric(c(0.01, 0.001, 200, 0.001, 1e-05, 5))
)

Arguments

data

(NumericVector) - the sample used to fit the distribution.

verb

(int) - the level of verbosity. Select one of:

  • 0 just the final result

  • 1 headings and summary table

  • 2 intermediate steps results

  • 3 intermediate steps internals

  • 4+ details of optim. routine

method

int - the steps that should be used to estimate the parameters.

  • 0 no optimization perform - just return the log-likelihood from initial guess.

  • 1 global optimization not considering lack of smoothness in m

  • 2 interval optimization taking non-smoothness in m into consideration

interv_step

int - the number of intervals to be explored after the last minimum was found in the interval optimization. Default is 10.

provided_m_

NumericVector - if NULL, the m parameter is estimated by the routine. If numeric, the estimation fixes m to the given value.

par

NumericVector - vector containing the initial guess for parameters bl, br, al, ar and m, respectively. Default values of are c(2, 2, 1, 1, 0).

g_opt_par

NumericVector - vector containing the global optimization parameters. The optimization parameters are:

  • step - (num) initial step size of the searching algorithm.

  • tol - (num) line search tolerance.

  • iter - (int) maximum number of iterations.

  • eps - (num) gradient tolerance. The stopping criteria is ||\text{gradient}||<\text{eps}.

  • msize - (num) simplex max size. stopping criteria given by ||\text{max edge}||<\text{msize}

  • algo - (int) algorithm. the optimization method used:

    • 0 Fletcher-Reeves

    • 1 Polak-Ribiere

    • 2 Broyden-Fletcher-Goldfarb-Shanno

    • 3 Steepest descent

    • 4 Nelder-Mead simplex

    • 5 Broyden-Fletcher-Goldfarb-Shanno ver.2

Details for each algorithm are available on the 'GSL' Manual. Default values are c(.1, 1e-2, 100, 1e-3, 1e-5, 2).

itv_opt_par

NumericVector - interval optimization parameters. Fields are the same as the ones for the global optimization. Default values are c(.01, 1e-3, 200, 1e-3, 1e-5, 5).

Details

The AEP is a exponential power distribution controlled by five parameters, with formula:

f(x;a_l,a_r,b_l,b_r,m) = \frac{1}{A} e^{- \frac{1}{b_l} |\frac{x-m}{a_l}|^{b_l} }, x < m

f(x;a_l,a_r,b_l,b_r,m) = \frac{1}{A} e^{- \frac{1}{b_r} |\frac{x-m}{a_r}|^{b_r} }, x > m

with:

A = a_lb_l^{1/b_l}\Gamma(1+1/b_l) + a_rb_r^{1/b_r}\Gamma(1+1/b_r)

where l and r represent left and right tails, a* are scale parameters, b* control the tails (lower values represent fatter tails), and m is a location parameter. Due to its lack of simmetry, and differently from the Subbotin, there is no simple equations available to use the method of moments, so we start directly by minimizing the negative log-likelihood. This global optimization is executed without restricting any parameters. If required (default), after the global optimization is finished, the method proceeds to iterate over the intervals between several two observations, iterating the same algorithm of the global optimization. The last method happens because of the lack of smoothness on the m parameter, and intervals must be used since the likelihood function doesn't have a derivative whenever m equals a sample observation. Due to the cost, these iterations are capped at most interv_step (default 10) from the last minimum observed. Details on the method are available on the package vignette.

Value

a list containing the following items:

  • "dt" - dataset containing parameters estimations and standard deviations.

  • "log-likelihood" - negative log-likelihood value.

  • "matrix" - the covariance matrix for the parameters.

Examples

sample_subbo <- rpower(1000, 1, 2)
subboafit(sample_subbo)

Rsubbotools documentation built on April 16, 2025, 5:10 p.m.