Package 'MultipleBreakpoints'

Title: Estimating Multiple Breakpoints for a Sequence of Realizations of Bernoulli Variables
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 probability of the different sequences between the breakpoints. In addition, it provides a graphical illustration of the result.
Authors: Nicolas Froelich
Maintainer: Nicolas Froelich <[email protected]>
License: GPL-3
Version: 0.1.0
Built: 2024-12-08 06:48:39 UTC
Source: CRAN

Help Index


Estimating Multiple Breakpoints for a Sequence of Realizations of Bernoulli Variables

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

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

Nicolas Froelich (2021). Multiple Breakpoint Estimation for Structural Changes in Bernoulli Mixture Models with Application in Credit Risk. Ph.D. thesis, TU Dresden. https://nbn-resolving.org/urn:nbn:de:bsz:14-qucosa2-764622.

See Also

S3 method plot for the class "mBP".

Examples

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)

Plotting the Results of the multiple_breakpoints function

Description

Plotting the empirical processes, the success probabilities and breakpoints estimated by the multiple_breakpoints function

Usage

## S3 method for class 'mBP'
plot(x, ask=TRUE, ...)

Arguments

x

The result of a call to multiple_breakpoints

ask

logical value. If TRUE (and the R session is interactive) the user is asked for input, before a new figure is drawn (see devAskNewPage).

...

Further arguments are currently ignored. Only for compatibility with generic functions.

Author(s)

Nicolas Froelich

References

Nicolas Froelich (2021). Multiple Breakpoint Estimation for Structural Changes in Bernoulli Mixture Models with Application in Credit Risk. Ph.D. thesis, TU Dresden. https://nbn-resolving.org/urn:nbn:de:bsz:14-qucosa2-764622.

Examples

mBP <- multiple_breakpoints(matrix(c(sort(rnorm(2000)),
                            rbinom(1000, 1, 0.2),
                            rbinom(1000, 1, 0.6)), ncol = 2))
plot(mBP)