segment.length.control {envoutliers} | R Documentation |
Segment length control - Only intended for developer use
Description
Control of a number of data values on individual segments. In case a number of data values on a segment is too small, the segment is (under the presumption of meeting certain conditions) merged with the previous one. The first segment can be merged with the previous one.
Usage
segment.length.control(index, x, cp.segment, min.segment.length,
segment.length.for.merge)
Arguments
index |
a numeric vector of design points. |
x |
a numeric vector of data. |
cp.segment |
an integer membership vector for individual segments. |
min.segment.length |
a numeric value giving minimal required number of observations on segments from changepoint analysis.
If a segment contains less than |
segment.length.for.merge |
a numeric value giving giving minimal required number of observations on segments for performing the homogeneity test within changepoint split control.
A segment with fewer data than |
Details
Control of data splitting into segments.
If a segment contains less than a given number of observations specified by the user and the variances of data on the segment and the previous one are equally based on the robust version of Levene's test, the segment is merged with previous one.
Analogous, the first segment can be merged with the second one.
The user can also specify a minimum length of a segment for performing the homogeneity test. A segment with fewer data than this minimal length is merged with the previous one without testing the homogeneity of variances.
The function is called by KRDetect.outliers.changepoint
and is not intended for use by regular users of the package.
Value
An integer membership vector for individual segments
References
Fox J (2016). Applied regression analysis and generalized linear models. 3 edition. Los Angeles: SAGE. ISBN 9781452205663.