Learn R Programming

alR (version 2.2.0)

alE: Arc length estimation.

Description

A framework for arc length estimation.

Usage

alE(x, q1, q2, dc, type)

alEfitdist(x, q1, q2, dc, type, bootstraps)

alEfit(X, q1, q2, dc, type, bootstraps, ...)

# S3 method for default alEfit(X, q1, q2, dc, type, bootstraps, ...)

# S3 method for alEfit print(x, ...)

Arguments

x

An alEfit object.

q1, q2

Vectors specifying the quantiles over which arc length segments are to be computed.

dc

TRUE/FALSE: Should the discrete or continuous sample statistic be used.

type

The type of bandwidth estimator for the underlying KDE; see bw.

bootstraps

An integer specifying the size of the parametric bootstrap.

X

A vector of sample values.

...

Additional arguments passed to alEfit (not currently used).

Value

alE: A list with the following components (see optim):

  • par: The estimated parameters.

  • abstol: The absolute tolerance level (default 1e-15).

  • fail: An integer code indicating convergence.

  • fncount: Number of function evaluations.

alEfitdist: A matrix of parameter estimates resulting from the estimated arc lengths over the specified interval(s), i.e. the bootstrap distribution for the estimated parameters resulting from the chosen sample arc length statistic.

alEfit: A generic S3 object with class alEfit.

alEfit.default: A list with all components from alE, as well as :

  • dc: TRUE/FALSE Was the discrete or continuous sample arc length statistic used?

  • q1, q2: The segments over which the arc length(s) were calculated.

  • bw: The bandwidth for the kernel density estimator.

  • dist: A numeric matrix whose columns represent a bootstrap distribution for the corresponding parameter estimate.

  • se: A numeric vector with standard errors, obtained by a parametric bootstrap.

  • bootstraps: Number of bootstrap samples.

Methods (by class)

  • default: default method for alEfit.

  • alEfit: print method for alEfit.

Details

  • Estimate distributional parameters using the method of arc lengths.

  • Simulate bootstrap distributions for parameter estimates, resulting from sample arc length statistics.

This method is currently only implemented for the normal distribution. The underlying C code for the Nelder-Mead method of the optim function is used for optimising the objective function. The tolerance level is set at 1e-15, and a maximum number of 1000 iterations is allowed. The maximum likelihood estimates are used as initial values for the Nelder-Mead algorithm.

Examples

Run this code
# NOT RUN {
x <- rnorm(1000)
alE(x,0.025, 0.975, TRUE, -1)
alE(x,c(0.025, 0.5), c(0.5, 0.975), TRUE, -1)
alE(x,0.025, 0.975, FALSE, -1)
alE(x,c(0.025, 0.5), c(0.5, 0.975), FALSE, -1)

# }
# NOT RUN {
alEfitdist(x, 0.025, 0.975, TRUE, -1, 100)
alEfitdist(x, 0.025, 0.975, FALSE, -1, 100)
# }
# NOT RUN {
alEfit(x, q1=0.025, q2=0.975, dc=TRUE, type=-1, bootstraps=50)
alEfit(x, q1=0.025, q2=0.975, dc=FALSE, type=-1, bootstraps=50)

# }

Run the code above in your browser using DataLab