The function
takes a mocca object produced by mocca() and creates cluster means plots or covariance structure within each cluster.
# S3 method for mocca
plot(x,type=1, select =NULL,transform=FALSE,covariance=TRUE,
covariates =FALSE,lwd=2,ylab="",xlab="",main="",ylim=NULL,
ncolors=NULL,probs=FALSE,pts=FALSE,size=50,
years=NULL, years.names=NULL, ...)The function generates plots.
a mocca object as produced by mocca().
determines what type of plots to print. For type=1 (default) cluster mean curves are shown in one plot on one page together with the overall mean curve; type=2 produces the trend of the frequencies of the different clusters, together with mean probabilites (if probs=TRUE), the mean value of the included covariates (if present) within each cluster (not the model estimated covariate values) are also shown, if pts=TRUE points of the frequency trend are plotted, cluster means are shown on separate plots; type=3 illustrates the covariance (or correlation) structure within each cluster. type=2 is used with annual data.
allows the plot for a single cluster mean to be selected for printing with type=1 or type=2. it can also be the order of the cluster means to be printed. If NULL (default), the cluster mean curves are in {1,2,...,K} order, where K is the number of clusters. If you just want the plot for the cluster mean of the second cluster set select=2.
logical, informs whether svd back-transformation of the spline model matrix should be applied (see Arnqvist and Sjöstedt de Luna, 2019).
logical, informs whether covariance (TRUE) or correlation (FALSE) matrices should be plotted
logical, informs whether covariates should be added when printing the covariance structure of the spline coefficients
defines the line width.
If supplied then this will be used as the y label for all plots.
If supplied then this will be used as the x label for all plots.
Used as title for plots if supplied.
If supplied then this pair of numbers are used as the y limits for each plot. Default ylim=c(-45, 55).
defines the number of colors (\(\geq 1\)) to be in the palette, used with the rainbow() function.
If NULL (default), ncolors equals the number of clusters K.
logical, used with type=2, informs whether the mean probabilites should be printed.
logical, used with type=2, if TRUE (default) points of the frequency trend are shown.
the bin size used with type=2 (default: 50 years), the bin size of how many of those years belong to a specific cluster.
a vector of years used with annual data and needed for type=2 plot to calculate frequencies in the bins of size provided by the size argument.
a character vector that gives names of the years needed for type=2 plot. This can be also supplied with data. With varve data years.names are supplied as rownames of the matrix of covariates. if years.names=NULL (default) then years are converted to the character vector and used as years.names.
other graphics parameters to pass on to plotting commands.
Per Arnqvist, Sara Sjöstedt de Luna, Natalya Pya Arnqvist
Arnqvist, P., and Sjöstedt de Luna, S. (2019). Model based functional clustering of varved lake sediments. arXiv preprint arXiv:1904.10265.
mocca