library("math")
library("smoother")
temp=read("dailtemp") ; read daily temperature data
nbasis = 30 ; set the number of basis functions
tempcoef = Fouriertrans(temp,nbasis); calculation of coefficient matrix
K = rows(tempcoef) ; number of basis functions in algorithm
nresol = 100 ; number of grid points
period = 365 ; period
phi = Fouriereval(K,nresol,period) ; evaluation of basis functions
tempfdval = tempcoef' * phi ; evaluation of data functions
bp = grpcp(tempfdval,0) ; parallel cordinates plot
dispfd = createdisplay(1,1) ; create display
show(dispfd, 1, 1, bp) ; plots lines
setgopt(dispfd,1,1,"title","Temperature Functions")