plot: Plot functions for functional coefficients

Description Usage Arguments Details Value References Examples

Description

It plot the estimated functional coefficients with confidence bands. The coefficients are estimated by funcreg.

Usage

1
2
3
4
plotCoef(obj, which, n = c(50, 50), fixeds=NULL, fixedt=NULL, plotWF=TRUE, ...)

plotConfInt(obj, which, type = c("beta_t", "beta_s", "beta_st"),
                       n = c(50, 50), level = 0.95, plotWF = TRUE, beta=NULL)

Arguments

obj

An object of class "funcreg"

which

Which functional coefficient we want to plot. 0 for the intercept, 1 for the first functional slope and so on.

n

The number of grid points for the plot. The first element is for the t dimension and the second for the s dimension.

fixeds

If NULL, a three dimensional plot is produced. Alternatively, we can set a value for s and plot beta(t,s) for a given s. It has no effect when which=0.

fixedt

If NULL, a three dimensional plot is produced. Alternatively, we can set a value for t and plot beta(t,s) for a given t. It has no effect when which=0.

plotWF

If FALSE, the wireframe is not shown. In that case, only the output of the function is returned. Only applicable for three dimensional plot.

type

The type of plot (see details).

level

The level for the confidence interval

beta

A one or two argument function (see details).

...

Other argument. to pass to either plot or wireframe.

Details

If type="beta_t", the default, the integral with respect to s is shown with pointwise confidence bands. It is simply the functional intercept with its pointwise confidence bands if which=0.

If type="beta_s" (not applicable for which=0), the integral with respect to t is shown with its pointwise confidence bands.

If type="beta_st" (not applicable for which=0), the whole three dimensional curve is shown with its pointwise confidence surfaces.

If beta is provided, the estimated curve is replaced by the one produced by the function beta, but the same confidence bands are produced. Useful for pointwise hypothesis testing. If type="beta_s" or type="beta_t", beta must be a function of t or s. If type="beta_st", it must be a function of both.

Value

If plotWF=FALSE and the expected plot is a surface, it returns an object of class "trellis" produced by wireframe.

References

Ramsay, James O., & Silverman, Bernard W. (2005), Functional Data Analysis, Springer, New York.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
data(GDPv56) 

## We just create response and a covariate artificialy from the GDP
## series

y <- GDPv56[,1:30]
x <- GDPv56[,31:60]
t <- seq(0,1,len=nrow(y))

## First we create the "myfda" objects
yfd <- coefEst(y, t, .0004, 15, 2)
xfd <- coefEst(x, t, .0004, 15, 2)


## we just set lambda and k to arbitrary values
res <- funcreg(yfd~xfd, k=c(5,5), lambda=c(.001,.001,.001))

plotCoef(res, 1, type="beta_st")

plotConfInt(res, 1, type="beta_t")

## Assume we what to do pointwise hypothesis testing
plotConfInt(res, 1, type="beta_t", beta=function(t) .6-.7*t)

## Nice 3-D confidence interval
plotConfInt(res, 1, type="beta_st")

funcreg documentation built on May 2, 2019, 5:45 p.m.

Related to plot in funcreg...