plot.mocca {fdaMocca}R Documentation

mocca plotting

Description

The function takes a mocca object produced by mocca() and creates cluster means plots or covariance structure within each cluster.

Usage

## S3 method for class '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, ...)

Arguments

x

a mocca object as produced by mocca().

type

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.

select

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.

transform

logical, informs whether svd back-transformation of the spline model matrix should be applied (see Arnqvist and Sjöstedt de Luna, 2019).

covariance

logical, informs whether covariance (TRUE) or correlation (FALSE) matrices should be plotted

covariates

logical, informs whether covariates should be added when printing the covariance structure of the spline coefficients

lwd

defines the line width.

ylab

If supplied then this will be used as the y label for all plots.

xlab

If supplied then this will be used as the x label for all plots.

main

Used as title for plots if supplied.

ylim

If supplied then this pair of numbers are used as the y limits for each plot. Default ylim=c(-45, 55).

ncolors

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.

probs

logical, used with type=2, informs whether the mean probabilites should be printed.

pts

logical, used with type=2, if TRUE (default) points of the frequency trend are shown.

size

the bin size used with type=2 (default: 50 years), the bin size of how many of those years belong to a specific cluster.

years

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.

years.names

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.

Value

The function generates plots.

Author(s)

Per Arnqvist, Sara Sjöstedt de Luna, Natalya Pya Arnqvist

References

Arnqvist, P., and Sjöstedt de Luna, S. (2019). Model based functional clustering of varved lake sediments. arXiv preprint arXiv:1904.10265.

See Also

mocca

Examples

## see ?mocca help files

[Package fdaMocca version 0.1-1 Index]