Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Library: math
See also: FDApca Fouriereval

Quantlet: Fouriertrans
Description: Calculates the coefficient in applying a basis expansion by using Fourier series. In this case, it is assumed that the data unit can be expressed by a linear combination of finite terms of sine and cosine functions.

Reference(s):

Usage: coef = Fouriertrans(tmat ,nbasis)
Input:
tmat T x N matrix, the original data matrix
nbasis scalar, the number of basis functions on which the expansion is computed
Output:
coef K x N matrix, the coefficient applying a Fourier basis expansion

Example:
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")

Result:
Produces a plot of functional data.



Author: W. Haerdle, Y. Yamanishi, 20021109 license MD*Tech
(C) MD*TECH Method and Data Technologies, 05.02.2006