Learn R Programming

blockcpd (version 1.0.0)

compute_hierseg: Block segmentation using hierarchical algorithm

Description

Uses binary splitting to obtain a greedy solution to the regularized loss optimization problem. Should be called within fit_blockcpd

Usage

compute_hierseg(
  suff_stats,
  family,
  lambda = 1,
  nrow,
  ncol,
  pen_func = bic_loss,
  min_block_size = min_block_size,
  max_blocks = NULL
)

Arguments

suff_stats

Sufficient statistics to perform change point analysis

family

The name of the family used to fit the model

lambda

Penalization constant

nrow

Number of rows or samples

ncol

Number of columns or variables

pen_func

A penalization function defined i integer intervals The function signature should be pen(left_index, right_index, nrow, ncol), where the left_index:right_index is the integer interval, nrow the sample size and ncol the number of variables/columns.

min_block_size

Minimum block size allowed. Default is 0, and the value must be smaller or equal to ncol.

max_blocks

Threshold on the number of block segments to fit the model. Set low values for this parameters if having performance issues on large data sets.