coef: Extract functional coefficients

Description Usage Arguments Details Value See Also Examples

Description

Obtain the coefficients component from a functional object (functional data, class fd, functional parameter, class fdPar, a functional smooth, class fdSmooth, or a Taylor spline representation, class Taylor.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## S3 method for class 'fd'
coef(object, ...)
## S3 method for class 'fdPar'
coef(object, ...)
## S3 method for class 'fdSmooth'
coef(object, ...)
## S3 method for class 'Taylor'
coef(object, ...)
## S3 method for class 'fd'
coefficients(object, ...)
## S3 method for class 'fdPar'
coefficients(object, ...)
## S3 method for class 'fdSmooth'
coefficients(object, ...)
## S3 method for class 'Taylor'
coefficients(object, ...)

Arguments

object

An object whose functional coefficients are desired

...

other arguments

Details

Functional representations are evaluated by multiplying a basis function matrix times a coefficient vector, matrix or 3-dimensional array. (The basis function matrix contains the basis functions as columns evaluated at the evalarg values as rows.)

Value

A numeric vector or array of the coefficients.

See Also

coef fd fdPar smooth.basisPar smooth.basis

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
27
28
29
30
31
32
33
34
35
36
37
38
39
##
## coef.fd
##
bspl1.1 <- create.bspline.basis(norder=1, breaks=0:1)
fd.bspl1.1 <- fd(0, basisobj=bspl1.1)
coef(fd.bspl1.1)


##
## coef.fdPar 
##
rangeval <- c(-3,3)
#  set up some standard normal data
x <- rnorm(50)
#  make sure values within the range
x[x < -3] <- -2.99
x[x >  3] <-  2.99
#  set up basis for W(x)
basisobj <- create.bspline.basis(rangeval, 11)
#  set up initial value for Wfdobj
Wfd0 <- fd(matrix(0,11,1), basisobj)
WfdParobj <- fdPar(Wfd0)

coef(WfdParobj)


##
## coef.fdSmooth
##

girlGrowthSm <- with(growth, smooth.basisPar(argvals=age, y=hgtf, 
                                             lambda=0.1)$fd)
coef(girlGrowthSm)


##
## coef.Taylor 
##
# coming soon.

fda documentation built on May 2, 2019, 5:12 p.m.