Learn R Programming

Rfssa (version 2.1.0)

-.fts: Subtraction of Functional Time Series

Description

A method for functional time series (fts) subtraction and fts-scalar subtraction. Note that if the fts is multivariate then a vector of numerics may be provided allowing for subtraction of different scalars from different variables. For example, multivariate fts-numeric subtraction follows the form of Y-c(1,2) if Y is a bivariate fts.

Usage

# S3 method for fts
-(Y1, Y2)

Value

An object of class fts.

Arguments

Y1

An object of class fts or numeric.

Y2

An object of class fts or numeric.

See Also

fts

Examples

Run this code
if (FALSE) {
require(Rfssa)
load_github_data("https://github.com/haghbinh/Rfssa/blob/master/data/Callcenter.RData")
D <- matrix(sqrt(Callcenter$calls), nrow = 240)
u <- seq(0, 1, length.out = 240) # Define domain of functional data
d <- 22 # number of basis elements
Y <- Rfssa::fts(list(D), list(list(d, "bspline")), list(u))
plot(Y)
Yminus <- Y[1:4] - Y[5:8] # subtract the functional time series to itself
plot(Yminus)
Yminus2 <- Y - 2 # subtract 2 to every term in the functional time series
plot(Yminus2)
}

Run the code above in your browser using DataLab