multiple_breakpoints: Estimating Multiple Breakpoints for a Sequence of...

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/MultipleBreakpoints.R

Description

The iterative procedure estimates structural changes in the success probability of Bernoulli variables. It estimates the number and location of the breakpoints as well as the success probabilities of the sequences between each pair of neighbouring breakpoints.

Usage

1
2
3
4
5
6
7
multiple_breakpoints(
  data,
  number_bp = "Unknown",
  max_bp = 80,
  inf_crit = "BIC",
  ext_out = "TRUE"
)

Arguments

data

A two-column matrix with the location in the first column and the corresponding realizations of the Bernoulli variables in the second column, a vector with the ordered, realizations of the Bernoulli variables or an equivalent data frame. Note that the realizations of the vector respectively the second column of the matrix or the data frame must be zero or one for each element.

number_bp

Number of breakpoints if known a priori. By default, the number of breakpoints is unknown.

max_bp

The maximum number of breakpoints to be estimated (just for the case, where the number of breakpoints is unknown a priori and the chosen information criterion does not stop the procedure before)

inf_crit

Must be one of "BIC" (Bayesian Information Criterion, default), "HQC" (Hannan-Quinn Criterion) or "AIC" (Akaike Information Criterion)

ext_out

If TRUE (default), all function values are stored in the iterative procedure and hidden printed in the output afterwards. This may take additional computing time in large data sets or simulation studies. For the method plot, the default setting is required.

Value

A list containing the following elements:

Breakpoints

A vector containing the estimated breakpoints in increasing order.

Probabilities

A vector containing the estimated success probabilities in each class.

Information Criterion

A vector containing the values of the chosen Information Criterion before the first iteration (thus without a breakpoint) and after each new estimated breakpoint

S

Only available, if ext_out set to TRUE. A matrix containing the function values, each column representing one iteration

Author(s)

Nicolas Froelich

References

\insertRef

froelichMultipleBreakpoints

See Also

S3 method plot for the class "mBP".

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
mBP <- multiple_breakpoints(c(rbinom(1000, 1, 0.5),
                            rbinom(1000, 1, 0.1),
                            rbinom(1000, 1, 0.2)))
plot(mBP)
multiple_breakpoints(matrix(c(sort(rnorm(1000)),
                            rbinom(500, 1, 0.5),
                            rbinom(500, 1, 0.1)), ncol = 2),
                            inf_crit = "HQC")
multiple_breakpoints(matrix(c(sort(rnorm(1500)),
                            rbinom(500, 1, 0.1),
                            rbinom(500, 1, 0.3),
                            rbinom(500, 1, 0.4)), ncol = 2), number_bp = 2)
multiple_breakpoints(matrix(c(1:200, rep(201,5), 202:396,
                            rbinom(250,1,0.9), rbinom(150,1,0.75)),
                            ncol = 2), number_bp = 1)

MultipleBreakpoints documentation built on Nov. 16, 2021, 1:07 a.m.