Return a discrete representation of y by binning the observed values and returning the transfer probabilities.

ts_discrete(y, nbins = ceiling(2 * NROW(y)^(1/3)), keepNA = TRUE)

Arguments

y

Numeric vector or time series to be discretised.

nbins

Number of bins to use for calculating transfer probabilities (default = ceiling(2*length(y)^(1/3)))

keepNA

If TRUE, any NA values will first be removed and later re-inserted into the discretised time series.

Value

A discretised version of y