posterior_estimate.DetectCpObj: Estimate the change points of the data

View source: R/DetectCpObj.R

posterior_estimate.DetectCpObjR Documentation

Estimate the change points of the data

Description

The posterior_estimate method estimates the change points of the data making use of the salso algorithm, for a DetectCPObj class object.

Usage

## S3 method for class 'DetectCpObj'
posterior_estimate(
  object,
  loss = "VI",
  maxNClusters = 0,
  nRuns = 16,
  maxZealousAttempts = 10,
  ...
)

Arguments

object

an object of class DetectCPObj.

loss

The loss function used to estimate the final partition, it can be "VI", "binder", "omARI", "NVI", "ID", "NID".

maxNClusters

maximum number of clusters in salso procedure.

nRuns

number of runs in salso procedure.

maxZealousAttempts

maximum number of zealous attempts in salso procedure.

...

parameter of the generic method.

Details

put details here

Value

The function returns a vector with the cluster assignment of each observation.

References

D. B. Dahl, D. J. Johnson, and P. Müller (2022), Search Algorithms and Loss Functions for Bayesian Clustering, Journal of Computational and Graphical Statistics, 31(4), 1189-1201, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/10618600.2022.2069779")}.

Examples


data_vec <- as.numeric(c(rnorm(50,0,0.1), rnorm(50,1,0.25)))


out <- detect_cp(data = data_vec, n_iterations = 1000, n_burnin = 100,
                 params = list(q = 0.25, phi = 0.1, a = 1, b = 1, c = 0.1), kernel = "ts")

posterior_estimate(out)


BayesChange documentation built on June 10, 2025, 9:09 a.m.