Make plots for the output of sparseDFM(). Options include:
factor - plot factor estimate series on top of the original standardized stationary data
loading.heatmap - make a heatmap of the loadings matrix
loading.lineplot - make a lineplot of variable loadings for a given factor
loading.grouplineplot - separate variable groups into colours for better visualisation
residual - boxplot or scatterplot of residuals
lasso.bic - BIC values for the LASSO tuning parameter
em.convergence - log-likelihood convergence of EM iterations
# S3 method for 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",
...
)Plots for the output of sparseDFM().
an object of class 'sparseDFM'.
character. The type of plot: "factor", "loading.heatmap", "loading.lineplot", "loading.grouplineplot" or "residual". Default is "factor".
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.
logical. Standardize the factor estimates when plotting in "factor". Default is TRUE.
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.
integer. The factor to use in "loading.lineplot" and "loading.grouplineplot". Default is 1.
character. The colour of the background series plotted in "factor". Default is series.col = "grey".
character. The colour of the factor estimate line in "factor". Default is factor.col = "black".
integer. The line width of the factor estimate line in "factor". Default is factor.lwd = 2.
vector of characters to label each factor in "loading.heatmap". Default is NULL for standard labeling.
logical. Set to TRUE if plot should display series names in the data matrix X. Default is FALSE for numbered series.
vector of characters to label each data series in "loading.heatmap". Default is NULL for standard labeling.
numeric vector of integers representing which series are labeled by series.lab. Default is NULL for standard labeling.
logical. Display the colour key of the heatmap in "loading.heatmap". Default is TRUE.
vector of gradually varying colors for "loading.heatmap", see levelplot package. Default is NULL for standard colours.
vector of characters of the same dimension as which.series to represent the name of the group for each series in "loading.grouplineplot".
vector of characters of the same dimension as the number of different groups in "loading.grouplineplot" to represent the colours of the groups.
logical. Display the legend. Default is TRUE.
character. The type of residual plot: "boxplot" or "scatterplot". Default is "boxplot".
integer. The series to plot when residual.type = "scatterplot". Default is series 1.
character. Colour for the best \(\alpha\) point. Default is 'red'.
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.