Learn R Programming

fda (version 6.2.0)

plot.pda.fd: Plot Principle Differential Analysis Components

Description

Plots the results of pda.fd, allows the user to group coefficient functions by variable, equation, derivative or combination of them.

Usage


# S3 method for pda.fd
plot(x,whichdim=1,npts=501,...)

Value

invisible(NULL)

Arguments

x

an object of class pda.fd.

whichdim

which dimension to use as grouping variables

1

coefficients of each variable differential equation

2

coefficient functions for each equation

3

coefficients of derivatives of each variable

whichdim should be an ordered vector of length between 1 and 3.

npts

number of points to use for plotting.

...

other arguments for 'plot'.

Details

Produces one plot for each coefficient function in a principle differential analysis.

References

Ramsay, James O., Hooker, Giles, and Graves, Spencer (2009), Functional data analysis with R and Matlab, Springer, New York.

Ramsay, James O., and Silverman, Bernard W. (2005), Functional Data Analysis, 2nd ed., Springer, New York.

Ramsay, James O., and Silverman, Bernard W. (2002), Applied Functional Data Analysis, Springer, New York.

See Also

pda.fd eigen.pda

Examples

Run this code
oldpar <- par(no.readonly=TRUE)
#  A pda analysis of the handwriting data

# reduce the size to reduce the compute time for the example
ni <- 281
indx <- seq(1, 1401, length=ni)
fdaarray <- handwrit[indx,,]
fdatime  <- seq(0, 2.3, len=ni)

#  basis for coordinates

fdarange <- c(0, 2.3)
breaks   <- seq(0,2.3,length.out=116)
norder   <- 6
fdabasis <- create.bspline.basis(fdarange,norder=norder,breaks=breaks)

#  parameter object for coordinates

fdafd0 <- fd(matrix(0,fdabasis$nbasis,1), fdabasis)
fdaPar <- fdPar(fdafd0,int2Lfd(4),1e-8)

#  coordinate functions and a list tontaining them

Xfd <- smooth.basis(fdatime, fdaarray[,,1], fdaPar)$fd
Yfd <- smooth.basis(fdatime, fdaarray[,,2], fdaPar)$fd

xfdlist <- list(Xfd, Yfd)

#  basis and parameter object for weight functions

fdabasis2 <- create.bspline.basis(fdarange,norder=norder,nbasis=31)
fdafd0    <- fd(matrix(0,fdabasis2$nbasis,1), fdabasis2)
pdaPar    <- fdPar(fdafd0,1,1e-8)

pdaParlist <- list(pdaPar, pdaPar)

bwtlist <- list( list(pdaParlist,pdaParlist), list(pdaParlist,pdaParlist) )

#  do the second order pda

pdaList <- pda.fd(xfdlist, bwtlist)

# plot the results

plot(pdaList,whichdim=1)
plot(pdaList,whichdim=2)
plot(pdaList,whichdim=3)

plot(pdaList,whichdim=c(1,2))
plot(pdaList,whichdim=c(1,3))
plot(pdaList,whichdim=c(2,3))

plot(pdaList,whichdim=1:3)
par(oldpar)

Run the code above in your browser using DataLab