linear_contr_one: Calculate the contrast function for the continuous...

View source: R/Finalised_coding.R

linear_contr_oneR Documentation

Calculate the contrast function for the continuous piecewise-linear mean case at specific values

Description

This function returns, at predefined positions, the values of the contrast function for a given data sequence with under the scenario of continuous, piecewise-linear mean signals. The routine is typically not called directly by the user; its result is used in the derivation of the solution path in the case of a piecewise-linear mean signal, which is carried out in sol_path_plm.

Usage

linear_contr_one(x, s, e, b)

Arguments

x

A numeric vector containing the data.

s, e, b

Positive integer vectors, all of the same length l_b, with s_j \le b_j < e_j, j=1,2,...,l_b. They indicate that for each j=1,2,...,l_b, the function needs to calculate the contrast function value at position b_j, with start- and end-points at positions s_j and e_j, respectively.

Value

A numeric vector of length l_b, of which the j^{th} element is the contrast function value at b_j, when the start- and end-points are s_j and e_j, respectively.

Author(s)

Andreas Anastasiou, anastasiou.andreas@ucy.ac.cy

See Also

cumsum_lin for the calculation of the contrast function for all data points of x. Also, see cusum_one for a function that has the same purpose, but for the case of the CUSUM statistic, which is used in piecewise-constant mean signals.

Examples

noise <- rnorm(2000)
ex.lin <- IDetect:::linear_contr_one(noise, s = c(1, 5, 9), e = c(6, 56, 71), b = c(4, 40, 45))

IDetect documentation built on May 7, 2026, 5:09 p.m.