# 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)
nbasis <- fdabasis$nbasis
# parameter object for coordinates
fdaPar = fdPar(fd(matrix(0,nbasis,1),fdabasis),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)
fdafd2 = fd(matrix(0,31,2),fdabasis2)
pdaPar = fdPar(fdafd2,1,1e-8)
pdaParlist = list(pdaPar, pdaPar)
bwtlist = list( list(pdaParlist,pdaParlist), list(pdaParlist,pdaParlist) )
Run the code above in your browser using DataLab