get_deviates: Return a set of vectors with chosen shapes

Description Usage Arguments Details Value References Examples

View source: R/deviates.R

Description

This function returns an rkhist object containing vectors with chosen shapes or trends. This is intended to be used to apply the Jolliffe-Primo flatness tests of rank histograms (see Jolliffe and Primo, 2008).

Usage

1
get_deviates(k, shapes = c("linear", "U", "wave"), constrain = FALSE)

Arguments

k

an integer. The number of possible ranks.

shapes

a vector of character strings. The required shapes of the vectors.

constrain

a logical. If TRUE the returned set of vectors is constrained to be orthonormal, with each vector having components summing to 0. This is required to use the vectors in the Jolliffe-Primo flatness test.

Details

The convention is that each row of the rkhist object contains a vector. It is not required that the set be a basis.

For each shape in shapes this function calls a function named 'deviate_shape' with one argument k. Some pre-coded functions already exist but the user can easily add its own by following this naming convention. The added function must have only one argument k and return an rkhist object. It is advised that the returned deviate vector's components should sum to 0 and have a unit module. But this can be imposed by setting the argument constrain to TRUE.

If constrain == TRUE the vector set is modified to have the right properties to be used in the Jolliffe-Primo test, through the Grahm-Schmidt method. It is strongly advised to plot the resulting set with function flatness::plot, since this transformation may greatly change the shape of the original vectors.

Value

An rkhist object with each row representing a vector of deviation from flatness.

References

Examples

1
2
3
4
5
6
deviates <- get_deviates(k = 36, shapes = c("linear", "U", "V", "ends", "wave"))
plot(deviates)
isJPOK <- is_JP_ready(deviates)
JPdeviates <- make_JP_ready(deviates)
plot(JPdeviates)
JPcheck <- is_JP_ready(JPdeviates)

flatness documentation built on June 29, 2021, 9:08 a.m.