lengthest {LeArEst} | R Documentation |
Performs width estimation for a numerical data set.
Description
Function lengthest()
computes the length of an interval which is the
domain of uniform distribution from data contaminated with additive error.
The additive error can be chosen as Laplace, Gauss or scaled Student
distribution with 1 - 5 degrees of freedom.
Usage
lengthest(x, error = c("laplace", "gauss", "t1", "t2", "t3", "t4", "t5"),
sd = NULL, sd.est = c("MM", "ML"), conf.level = 0.95)
Arguments
x |
Vector of input data. |
error |
A character string specifying the error distribution. Must be one of "laplace", "gauss", "t1", "t2", "t3", "t4", "t5". Can be abbreviated. |
sd |
Explicit error standard deviation. Needs to be given if
|
sd.est |
A character string specifying the method of error standard
deviation estimation. Must be given if |
conf.level |
Confidence level of the confidence interval. |
Value
List containing:
error.type: A character string describing the type of the error distribution.
radius: Estimated half-width of uniform distribution.
sd.error: Error standard deviation, estimated or given.
conf.level: Confidence level of the confidence interval.
method: A character string indicating what method for computing a confidence interval was used (asymptotic distribution of ML or likelihood ratio statistic).
conf.int: The confidence interval for half-width.
Examples
# generate uniform data with additive error and run a length estimation on it
sample_1 <- runif(1000, -1, 1)
sample_2 <- rnorm(1000, 0, 0.1)
sample <- sample_1 + sample_2
out <- lengthest(x = sample, error = "gauss", sd.est = "MM", conf.level = 0.90)