Learn R Programming

kernDeepStackNet (version 2.0.2)

randomFourierTrans: Random Fourier transformation

Description

Calculates the random Fourier transformation using a Gaussian kernel, given the original data.

Usage

randomFourierTrans(X, Dim, sigma, seedW=NULL)

Arguments

X

Original data design matrix. All factors have to be encoded, e.g. dummy coding.

Dim

Specifies the dimension of the random Fourier transformation (integer scalar).

sigma

Variance of the Gaussian kernel (positive numeric scalar).

seedW

Random seed for drawing from the multivariate normal distribution (integer scalar).

Value

Numeric transformed data matrix with dimension 2*Dim x n.

Details

First a random weight matrix is drawn from the multivariate normal distribution. Then the Data is linear transformed. The linear transformed data is mapped nonlinear by applying cosinus and sinus functions. The matrix multiplaction t(Z) Z approximates the Gaussian radial basis function kernel matrix. The dimension of t(Z) Z is always n x n. The higher the dimension argument Dim, the more accurate the results.

References

Po-Seng Huang and Li Deng and Mark Hasegawa-Johnson and Xiaodong He, (2013), Random Features for kernel deep convex network, Proceedings IEEE International Conference on Acoustics, Speech, and Signal Processing (ICASSP)

See Also

fourierTransPredict

Examples

Run this code
# Generate data matrix
X <- data.frame(rnorm(100), rnorm(100), rnorm(100), rnorm(100), rnorm(100), 
factor(sample(c("a", "b", "c", "d", "e"), 100, replace=TRUE)))
X <- model.matrix(object=~., data=X) 
# Exclude intercept
X <- X[, -1]

# Apply a random Fourier transformation of lower dimension
rft <- randomFourierTrans(X=X, Dim=2, sigma=1, seedW=0)

# Transformed data
rft$Z

# Used weight matrix
rft$rW

Run the code above in your browser using DataLab