plot_decomposed: Plot decomposed time series from comp_tsout_ens or...

View source: R/plot_decomposed.R

plot_decomposedR Documentation

Plot decomposed time series from comp_tsout_ens or mv_tsout_ens output.

Description

Plot decomposed time series from comp_tsout_ens or mv_tsout_ens output.

Usage

plot_decomposed(obj, X = NULL, method = "pca")

Arguments

obj

The output from comp_tsout_ens or mv_tsout_ens functions.

X

The data matrix used as input to mv_tsout_ens (not needed if obj is output from comp_tsout_ens).

method

The decomposition method, choose between "pca" (default), "dobin", "ics", "ica" or "all" for complete set of methods.

Value

A ggplot showing the time series from the selected decomposition method.

Examples

## Not run: 
set.seed(100)
n <- 600
x <- sample(1:100, n, replace=TRUE)
x[25] <- 200
x[320] <- 300
x2 <- sample(1:100, n, replace=TRUE)
x3 <- sample(1:100, n, replace=TRUE)
x4 <- sample(1:100, n, replace=TRUE)
X <- cbind.data.frame(x, x2, x3, x4)

out1 <- mv_tsout_ens(X, compr=2, fast=FALSE)
plot_decomposed(out1, X = X, method = "pca")
plot_decomposed(out1, X = X, method = "all")

X <- X/rowSums(X)
out2 <- comp_tsout_ens(X, compr=2, fast=FALSE)
plot_decomposed(out2)

## End(Not run)


composits documentation built on May 25, 2022, 9:11 a.m.