mfpcaPlot: Plot multivariate functional pca

Description Usage Arguments Examples

View source: R/mfpcaPlot.R

Description

This function plots the functional pca.

Usage

1
  mfpcaPlot(pca, grid = c())

Arguments

pca

is the result of mfpca. In the univariate case mfpcaPlot use the package fda and will be similar to it's function "plot.pca.fd". In multivariate functional pca, we will make a graphic window for each dimension.

grid

specify how to divide the graphics window. grid=c(n,m) divided the widow in to n lines and m columns. If user don't specify grid then he must enter <Enter> to pass to the next graphic.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
# Multivariate
# ---------  CanadianWeather (data from the package fda) --------
CWtime<- 1:365
CWrange<-c(1,365)
CWbasis <- create.fourier.basis(CWrange, nbasis=65)
harmaccelLfd <- vec2Lfd(c(0,(2*pi/365)^2,0), rangeval=CWrange)

# -- Build the curves ---
temp=CanadianWeather$dailyAv[,,"Temperature.C"]
CWfd1 <- smooth.basisPar(
CWtime, CanadianWeather$dailyAv[,,"Temperature.C"],CWbasis,
Lfdobj=harmaccelLfd, lambda=1e-2)$fd
precip=CanadianWeather$dailyAv[,,"Precipitation.mm"]
CWfd2 <- smooth.basisPar(
CWtime, CanadianWeather$dailyAv[,,"Precipitation.mm"],CWbasis,
Lfdobj=harmaccelLfd, lambda=1e-2)$fd

CWfd=list(CWfd1,CWfd2)

pca=mfpca(CWfd,nharm=4)
mfpcaPlot(pca,grid=c(2,2))

Example output

Loading required package: fda
Loading required package: splines
Loading required package: Matrix

Attaching package: 'fda'

The following object is masked from 'package:graphics':

    matplot


 Dimension  1  of the functional data 

 Dimension  2  of the functional data 
dev.new(): using pdf(file="Rplots1.pdf")

Funclustering documentation built on Nov. 25, 2018, 1:04 a.m.