Description Usage Arguments Value See Also Examples
View source: R/LastPointVSQuantile.R
This function LastPointVSQuantile
is used to determine
the relationship between the last observation of ts
and the sample
quantile calculated using the rest of the points in ts
. If argument
exclude
is specified, elements at those designated positions are
further removed from the sample quantile calculation.
1 | LastPointVSQuantile(ts, exclude = NULL, probT = 0.9, direction = "pos")
|
ts |
A numeric vector whose
|
exclude |
A logical vector with length equals to |
probT |
probability threshold with values in [0, 1]. The sample
quantile corresponds to this probability is calculated. Depends on the
. |
direction |
Directionality of the anomalies to be deteted. Options are: 'pos', 'neg' and 'both'. Defaults to be 'pos'. |
returns TRUE
if the last element of ts
is above or below the
sample quantiles, FALSE
otherwise.
1 2 3 4 5 6 | set.seed(1)
ts <- c(rnorm(1000), 5)
exclude <- sample(c(T, F), 1000, replace = T, prob = c(0.005, 0.995))
LastPointVSQuantile(ts, exclude, 0.95, "pos")
LastPointVSQuantile(ts, exclude, 0.95, "neg")
LastPointVSQuantile(ts, exclude, c(0.1, 0.9), "both")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.