alEtest: Arc length estimation.

Description Usage Arguments Details Value Methods (by class) Examples

View source: R/alEtest.R

Description

Goodness-of-fit using arc lengths.

Usage

1
2
3
4
5
6
7
8
9
alEdist(n, bootstraps, mu, sigma, q1, q2, quantile, dc, type)

alEtest(X, mu, sigma, q1, q2, type, bootstraps, ...)

## Default S3 method:
alEtest(X, mu, sigma, q1, q2, type, bootstraps, ...)

## S3 method for class 'alEtest'
print(x, ...)

Arguments

n

An integer specifying the sample size.

bootstraps

An integer specifying the size of the parametric bootstrap.

mu

A real value specifying the mean of the normal distribution.

sigma

A positive real number specifying the scale parameter of the normal distribution.

q1, q2

Vectors specifying the quantiles (or points if quantile=FALSE) over which arc length segments are to be computed.

quantile

TRUE/FALSE whether q1 and q2 are quantiles, or elements of the domain of x.

dc

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

type

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

X

A vector of sample values.

...

Additional arguments passed to alEtest (not currently used).

x

An alEtest object.

Details

First the distributional parameters of a sample is estimated using the continuous arc length sample statistic (see alE). The calculated sample arc length statistic is then compared to the distribution of that particular sample statistic, obtained by a parametric bootstrap, using the estimated parameters (see alEdist). This finally leads to the calculation of a p-value for a goodness-of-fit test, based on the simulated distribution.

This method is currently only implemented for the normal distribution, and for a single arc length segment.

Value

alEdist: A vector (matrix) of arc lengths over the specified interval(s), i.e. the simulated distribution for the chosen sample arc length statistic.

alEtest: A generic S3 object with class alEtest.

alEtest.default: A list with the following components:

Methods (by class)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## Not run: 
alEdist(50, 100, 2, 3.5, 0.025, 0.975, TRUE, TRUE, -1)
alEdist(50, 100, 2, 3.5, c(0.025,0.5), c(0.5,0.975), TRUE, TRUE, -1)
alEdist(50, 100, 2, 3.5, 0.025, 0.975, TRUE, FALSE, -1)
alEdist(50, 100, 2, 3.5, c(0.025,0.5), c(0.5,0.975), TRUE, FALSE, -1)
alEdist(50, 100, 2, 3.5, qnorm(0.025,2,3.5),
qnorm(0.975, 2, 3.5), FALSE, FALSE, -1)
alEdist(50, 100, 2, 3.5, c(qnorm(0.025, 2, 3.5),2),
c(2,qnorm(0.975, 2, 3.5)), FALSE, FALSE, -1)

## End(Not run)
## Not run: 
x <- rnorm(1000)
s1 <- alE(x, 0.025, 0.975, TRUE, -1)
alEtest(x, mu=s1$par[1], sigma=s1$par[2], q1=0.025, q2=0.975,
type=-1, bootstraps=50)
s2 <- alE(x, 0.025, 0.975, FALSE, -1)
alEtest(x, mu=s2$par[1], sigma=s2$par[2], q1=0.025, q2=0.975,
type=-1, bootstraps=50)

## End(Not run)

alR documentation built on Dec. 7, 2017, 5:03 p.m.

Related to alEtest in alR...