plot.dfrr {dfrr}R Documentation

Plot a dfrr fit

Description

Plot the regression coefficients, principal components, kernel function and residuals of a dfrr-object.

Usage

## S3 method for class 'dfrr'
plot(x, plot.kernel = TRUE, ...)

Arguments

x

the output of the function fitted.dfrr

plot.kernel

a boolean indicating whether plots the kernel function or not. ggplot2-package and plotly-package is required to plot contour and 3d surface of kernel function.

...

graphical parameters passed to plot.coef.dfrr

Details

The contour plot of the kernel function is produced if the package ggplot2 is installed. Plotting the 3d surface of the kernel function is also depends on the package plotly. To produce the qq-plot, the package car must be installed.

Value

This function generates a set of plots, including functional regression coefficients, principal components, 2-d contour and 3d-surface of kernel function, and QQ-plot of residuals.

Examples

set.seed(2000)
N<-50;M<-24

X<-rnorm(N,mean=0)
time<-seq(0,1,length.out=M)
Y<-simulate_simple_dfrr(beta0=function(t){cos(pi*t+pi)},
                        beta1=function(t){2*t},
                        X=X,time=time)

#The argument T_E indicates the number of EM algorithm.
#T_E is set to 1 for the demonstration purpose only.
#Remove this argument for the purpose of converging the EM algorithm.
dfrr_fit<-dfrr(Y~X,yind=time,T_E=1)
plot(dfrr_fit)



[Package dfrr version 0.1.5 Index]