Learn R Programming

Rssa (version 0.11)

plot: Plot SSA object

Description

This function plots various sorts of figures related to the SSA method.

Usage

## S3 method for class 'ssa':
plot(x,
     type = c("values", "vectors", "paired", "series", "wcor"),
     ...,
     vectors = c("eigen", "factor"),
     plot.contrib = TRUE,
     numvalues = nsigma(x),
     numvectors = min(nsigma(x), 10),
     idx = 1:numvectors,
     idy,
     groups)

Arguments

x
SSA object holding the decomposition
type
Type of the plot (see 'Details' for more information)
...
Arguments to be passed to methods, such as graphical parameters
vectors
For type = 'vectors', choose the vectors to plot
plot.contrib
logical. If 'TRUE' (the default), the contribution of the component to the total variance is plotted. For `ossa' class, Frobenius orthogonality checking of elementary matrices is performed. If not all matrices are orthogonal, corresponding war
numvalues
Number of eigenvalues to plot (for type = 'values')
numvectors
Total number of eigenvectors to plot (for type = 'vectors')
idx
Indices of eigenvectors to plot (for type = 'vectors')
idy
Second set of indices of eigenvectors to plot (for type = 'paired')
groups
Grouping used for the decomposition (see reconstruct)

Details

This function is the single entry to various plots of SSA objects. Right now this includes: [object Object],[object Object],[object Object],[object Object],[object Object]

Additional (non-standard) graphical parameters which can be transfered via ...: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

Examples

Run this code
# Decompose 'co2' series with default parameters
s <- ssa(co2)
# Plot the eigenvalues
plot(s, type = "values")
# Plot W-cor matrix for first 10 reconstructed components
plot(s, type = "wcor", groups = 1:10)
# Plot the paired plot for first 6 eigenvectors
plot(s, type = "paired", idx = 1:6)
# Plot eigenvectors for first 6 components
plot(s, type = "vectors", idx = 1:6)
# Plot the first 4 reconstructed components
plot(s, type = "series", groups = list(1:4))
# Plot the eigenvalues by points only
plot(s, type = "values", plot.type = "p")

# Artificial image for 2dSSA
mx <- outer(1:50, 1:50,
            function(i, j) sin(2*pi * i/17) * cos(2*pi * j/7) + exp(i/25 - j/20)) +
      rnorm(50^2, sd = 0.1)
# Decompose 'mx' with default parameters
s <- ssa(mx, kind = "2d-ssa")
# Plot the eigenvalues
plot(s, type = "values")
# Plot eigenvectors for first 6 components
plot(s, type = "vectors", idx = 1:6,
     ref = TRUE, at = "same", cuts = 50,
     plot.contrib = TRUE, symmetric = TRUE)
# Plot factor vectors for first 6 components
plot(s, type = "vectors", vectors = "factor", idx = 1:6,
     ref = TRUE, at = "same", cuts = 50,
     plot.contrib = TRUE, symmetric = TRUE)
# Plot wcor for first 12 components
plot(s, type = "wcor", groups = 1:12, grid = c(2, 6))

Run the code above in your browser using DataLab