class_input: Input all required arguments into pcpt class - Only intended...

View source: R/class_input.R

class_inputR Documentation

Input all required arguments into pcpt class - Only intended for developer use.

Description

This function helps to input all the necessary information into the correct format for the pcpt class.

This function is called by PeriodCPT and its distribution specific functions. This is not intended for use by regular users of the package. It is exported for developers to call directly for speed and convenience.

WARNING: Checks on inputs may not be comprehensive!

Usage

class_input(data, periodlength, minseglen, distribution, nsegparam,
                        Mprior, Mhyp, spread, inits, ...)

Arguments

data

A vector or ts object containing the data within which you which to find within period changepoint events. If not specified, the period length is taken from the ts object.

periodlength

Positive integer specifying the period length. Information is obtained from data ts-object if not specified.

minseglen

Positive integer giving the minumum segment length (no. of observations between within-period changes).

distribution

Character specifying the sampling distribution/statistic to investigate within period changepoint events.

nsegparam

Number of segment parameters per segment.

Mprior

Character specifying the prior for the number of within period changepoint events.

Mhyp

Numeric vector giving the hyper-parameters for the number of within period chagepoint prior.

spread

Positive number specifying the prior degree of spread around the period for the changepoint positions.

inits

Initial values for the chains.

...

Additional optional arguments that specifies prior details, MCMC parameters and output format.

Details

This function takes all the input required for the pcpt class and enters it into the object.

This function is exported for developer use only. It perform some checks on inputs, but it is simply a convenience function for converting the output of the worker functions into a nice format for the pcpt class.

Value

An object of class pcpt filled with the given attributes.

Author(s)

Simon Taylor Rebecca Killick

See Also

PeriodCPT,pcpt

Examples

#This function should only be used by developers.
#See its use in PeriodCPT and distribution specific variations.

taylors2/PeriodCPT documentation built on June 28, 2024, 12:32 p.m.