Learn R Programming

ocd (version 1.1)

getData: Processing a new data point

Description

This is the main function for the 'ChangepointDetector' class.

Usage

getData(detector, x_new)

# S3 method for OCD getData(detector, x_new)

# S3 method for Mei getData(detector, x_new)

# S3 method for XS getData(detector, x_new)

# S3 method for Chan getData(detector, x_new)

Arguments

detector

Object of class 'Changepoint Detector'

x_new

A new data point. It must be of the same dimension as specified in the data_dim attribute of detector.

Value

Updated object detector

Methods (by class)

  • OCD: Process a new data for subclass 'OCD'

  • Mei: Process a new data for subclass 'Mei'

  • XS: Process a new data for subclass 'XS'

  • Chan: Process a new data for subclass 'Chan'

Details

If the status of the detector object is 'estimating', the new data point is used to update the current estimate of pre-change mean and standard deviation. If the status of the detector object is monitoring', the new data point is used to detect if a mean change has occurred.

See Also

setBaselineMean for updating the pre-change mean estimate, setBaselineSD for updating the standard deviation estimate, checkChange for checking for change.