cSFM (version 1.1)

DFT.basis: Discrete Fourier Transformation (DFT) Basis System

Description

Generate an orthogonal Fourier basis system in the interval [0, 1]. The set of basis functions are used to be the eigenfunctions to generate the covariance matrix of a latent process.

Usage

DFT.basis(t, degree = 0, normalized = TRUE)

Arguments

t
the set of values to be evaluated, taking values from [0, 1]
degree
the degree of Fourier basis functions, taking values as $0, 1, 2, \ldots$; See 'Details'
normalized
logical value; If TRUE (default) then the values are normalized such that the $L2$ norm of the function values is 1

Value

  • A vector which are the evaluations of the Fourier basis function at t.

Details

The Fourier basis functions considered here are $${1, \sqrt{2}cos(2\pi t), \sqrt{2}sin(2\pi t), \sqrt{2}cos(4\pi t), \sqrt{2}sin(4\pi t), \ldots},$$ which corresponding to degree = 0, 1, 2, 3, 4 $\ldots$. Typically the degree is even.

See Also

legendre.polynomials

Examples

Run this code
# time points 
t <- seq(from = 0, to = 1, length = 100)
# basis matrix evaluated at the time points t
# an intercept column is included
Phi <- cbind(DFT.basis(t, degree = 0), DFT.basis(t, degree = 1),
             DFT.basis(t, degree = 2))
# check the orthogonality
crossprod(Phi) # is equal to I_3 up to rounding errors
# plot the basis system 
matplot(t, Phi, type = "l", lwd = 2, lty = 1:3, 
        ylab = "basis function", main = "Fourier Basis (normalized)")
legend("top", c("degree = 0", "degree = 1", "degree = 2"), 
       col = 1:3, lwd = 2, lty = 1:3)

Run the code above in your browser using DataLab