Learn R Programming

mosum (version 1.2.7)

Moving Sum Based Procedures for Changes in the Mean

Description

Implementations of MOSUM-based statistical procedures and algorithms for detecting multiple changes in the mean. This comprises the MOSUM procedure for estimating multiple mean changes from Eichinger and Kirch (2018) and the multiscale algorithmic extension from Cho and Kirch (2022) , as well as the bootstrap procedure for generating confidence intervals about the locations of change points as proposed in Cho and Kirch (2022) . See also Meier, Kirch and Cho (2021) which accompanies the R package.

Copy Link

Version

Install

install.packages('mosum')

Monthly Downloads

315

Version

1.2.7

License

GPL (>= 3)

Maintainer

Haeran Cho

Last Published

October 22nd, 2022

Functions in mosum (1.2.7)

get_local_costs

Compute the Local cost terms of combination icomb (for RSS resp. sBIC). Use pre-computed partial sum matrix sub_sums (see extract_sub) for speedup
is_child

Is index i_child a child of index i_parent? ASSERT: i_child is of the form (i_parent XOR i_help), with i_help having exactly one non-zero bit
exhaust_sc

Algorithm II (Local change-point search with SC)
local.env

Identify the local environment for exhaustive search
local.prune

Localised pruning algorithm
extract_sub

Helping function for algorithm 2: Pre-compute the partial sums S_i = sumj=k_i+1^k_i+1x_i and the partial sums of squared T_i = sumj=k_i+1^k_i+1x_i^2 between the (sorted) candidates k_i and k_i+1 in cand. Output: data frame with 4 columns k_i | k_i+1 | S_i | T_i
get_comb_ind

Get integer vector of changepoint indices, based on bool-field representation of combinations. E.g. for combination index 11 [=1011]: get_comb_ind(c(T,F,T,T))=11
get_k_star

Compute bootstrapped mosum statistic and return maximum position thereof
mean_help

helping function for bootstrap (compute local means)
modelSignal.blocks

Creating Time-Series according to example model
mosum.pValue

MOSUM asymptotic p-value
mosum.stat

MOSUM statistic
mosum

MOSUM procedure for multiple change point estimation
mosum.asymptoticA

Help function: asymptotic scaling.
modelSignal.mix

Creating Time-Series according to example model
modelSignal.fms

Creating Time-Series according to example model
modelSignal.stairs10

Creating Time-Series according to example model
modelSignal.teeth10

Creating Time-Series according to example model
plot.mosum.cpts

Plotting the output from MOSUM procedure
plot.mosum.stat

Plotting MOSUM statistics
plot.multiscale.cpts

Plotting the output from multiscale MOSUM procedure
print.mosum.cpts

Change points estimated by MOSUM procedure
mosum.asymptoticB

Help function: asymptotic shift
print.multiscale.cpts

Change points estimated by multiscale MOSUM procedure
mosum.criticalValue

MOSUM asymptotic critical value
rolling_sum

equivalent to rollsum(x, k=G, fill=NA, align="left") in the package zoo, but optimized for speed
multiscale.localPrune

Multiscale MOSUM algorithm with localised pruning
next_bit_permutation

Next value to iterate (in lexicographical order) over all bit permutaions having l bits set to 1. Example sequence (2 bits): 0011, 0101, 0110, 1001, 1010, 1100. Source: https://stackoverflow.com/questions/1851134/generate-all-binary-strings-of-length-n-with-k-bits-set
start_bit_permutations

Starting value to iterate (in lexicographical order) over all bit permutaions having l bits set to 1. E.g.: start_bit_permutations(2) = 3 [=0..011].
setBitNumber

where is leftmost one? https://www.geeksforgeeks.org/find-significant-set-bit-number/
testSignal

Piecewise constant test signal
testData

Test data with piecewise constant mean
multiscale.bottomUp

Multiscale MOSUM algorithm with bottom-up merging
multiscale.grid

Multiscale bandwidth grids
numberOfSetBits

Get number of non-zero bits of a 32bit integer Source: https://stackoverflow.com/questions/109023/how-to-count-the-number-of-set-bits-in-a-32-bit-integer
persp3D.multiscaleMosum

3D Visualisation of multiscale MOSUM statistics
summary.mosum.cpts

Summary of change points estimated by MOSUM procedure
summary.multiscale.cpts

Summary of change points estimated by multiscale MOSUM procedure
bootstrapped_timeSeries

Obtain bootstrap replicate of time series
bandwidths.default

Default choice for the set of multiple bandwidths
confint.multiscale.cpts

Confidence intervals for change points
confint.mosum.cpts

Confidence intervals for change points
eta_criterion_help

extract changepoints from candidates with eta criterion
detect.interval

Final detection interval
cpts_bootstrap_help

Helping function to get bootstrap replicates of change point estimates
cpts_bootstrap

Helping/wrapper fuction for C++ calls
dup.merge

Remove duplicated from all.cpts data frame: In case one change being added multiple times, choose the one with smallest p-value
comb_contains_cpt

Does the combination comb of changepoints contain the changepoint k_ind?