plot.sparseDFM {sparseDFM}R Documentation

sparseDFM Plot Outputs

Description

Make plots for the output of sparseDFM(). Options include:

Usage

## S3 method for class 'sparseDFM'
plot(
  x,
  type = "factor",
  which.factors = 1:(dim(x$state$factors)[2]),
  scale.factors = TRUE,
  which.series = 1:(dim(x$params$Lambda)[1]),
  loading.factor = 1,
  series.col = "grey",
  factor.col = "black",
  factor.lwd = 2,
  factor.lab = NULL,
  use.series.names = FALSE,
  series.lab = NULL,
  series.labpos = NULL,
  colorkey = TRUE,
  col.regions = NULL,
  group.names = NULL,
  group.cols = NULL,
  group.legend = TRUE,
  residual.type = "boxplot",
  scatter.series = 1,
  min.bic.col = "red",
  alpha_index = "best",
  ...
)

Arguments

x

an object of class 'sparseDFM'.

type

character. The type of plot: "factor", "loading.heatmap", "loading.lineplot", "loading.grouplineplot" or "residual". Default is "factor".

which.factors

numeric vector of integers representing which factors should be plotted in "factor" and "loading.heatmap". Default is which.factors=1:(dim(x$state$factors)[2]), plotting them all. Accepts a single integer if just one factor required.

scale.factors

logical. Standardize the factor estimates when plotting in "factor". Default is TRUE.

which.series

numeric vector of integers representing which series should be plotted in "loading.heatmap", "loading.lineplot", "loading.grouplineplot" and "residual". Default is which.series = 1:(dim(x$params$Lambda)[1]), plotting them all.

loading.factor

integer. The factor to use in "loading.lineplot" and "loading.grouplineplot". Default is 1.

series.col

character. The colour of the background series plotted in "factor". Default is series.col = "grey".

factor.col

character. The colour of the factor estimate line in "factor". Default is factor.col = "black".

factor.lwd

integer. The line width of the factor estimate line in "factor". Default is factor.lwd = 2.

factor.lab

vector of characters to label each factor in "loading.heatmap". Default is NULL for standard labeling.

use.series.names

logical. Set to TRUE if plot should display series names in the data matrix X. Default is FALSE for numbered series.

series.lab

vector of characters to label each data series in "loading.heatmap". Default is NULL for standard labeling.

series.labpos

numeric vector of integers representing which series are labeled by series.lab. Default is NULL for standard labeling.

colorkey

logical. Display the colour key of the heatmap in "loading.heatmap". Default is TRUE.

col.regions

vector of gradually varying colors for "loading.heatmap", see levelplot package. Default is NULL for standard colours.

group.names

vector of characters of the same dimension as which.series to represent the name of the group for each series in "loading.grouplineplot".

group.cols

vector of characters of the same dimension as the number of different groups in "loading.grouplineplot" to represent the colours of the groups.

group.legend

logical. Display the legend. Default is TRUE.

residual.type

character. The type of residual plot: "boxplot" or "scatterplot". Default is "boxplot".

scatter.series

integer. The series to plot when residual.type = "scatterplot". Default is series 1.

min.bic.col

character. Colour for the best \alpha point. Default is 'red'.

alpha_index

Choose which L1 penalty parameter to display the results for. Default is 'best'. Otherwise, input a number between 1:length(alpha_grid) that indicates the required alpha parameter.

...

for plot.sparseDFM. Further plot arguments.

Value

Plots for the output of sparseDFM().


[Package sparseDFM version 1.0 Index]