views:

138

answers:

4

Is there any package in R that contains algorithm for feature selection using Gram-Schmidt orthogonalization?

A: 

See Appendix A here, for a Matlab code implementation of Forward selection with Gram-Schmidt orthogonalization. If nothing else is found, at least you could rewrite it in R.

gd047
Looks like that there is no other option, so I go for it...
pixel
A: 

The "far" package has it.

Use Rseek. It's the second thing that came up in a search.

John
"far" package has only orthogonalization method which is easy to find. Actually I can use QR decomposition to orthogonalize a matrix, but it isn't aim of my question. What I'm looking for is algorithm using this orthogonalization method.
pixel
I guess I was thrown in this from the documentation for far ----- "orthonormalization - Orthonormalization of a set of a matrixDescription: Gram-Schmidt orthogonalization of a matrix considering its columns as vectors. Normalization is provided as will."
John
A: 

See "A New Method for Generating the Design Matrix of a Linear Regression Model" by Adel M. Hallawa and Abdul-Mordy H. Azzam in The Egyptian Statistical Journal, ISSR, Cairo University

Mohamed Ali
A: 

My Name: Mohamed Ali

My phone: 002-0113300093

n is number of observations, p is number of regressors

n = 10 p = 3

Generate a set of p, (n×1) vectors ~ N(0,1)

v1 <- array (c(rnorm(n, mean = 0, sd = 1))) v2 <- array (c(rnorm(n, mean = 0, sd = 1))) v3 <- array (c(rnorm(n, mean = 0, sd = 1)))

define v as a matrix, its columns is the generated p vectors

and make the matrix H equal v

v<-matrix(c(v1,v2,v3), nrow = n, ncol = p) H<-matrix(c(v), nrow = n, ncol = p)

orthogonalize the p vectors by Gram-Schmidt process

numerator1 <- sum(H[,1]*v[,2]) denominator1 <- sum(H[,1]*H[,1]) proj1 <- (numerator1 / denominator1) * H[,1]

H[,2] <- v2 - (proj1)

numerator2 <- sum(H[,2]*v[,3]) denominator2 <- sum(H[,2]*H[,2]) proj2 <- (numerator2 / denominator2) * H[,2] H[,3] <- v3 - (proj1) - (proj2)

cor(H[,1],H[,2])

define R as a correlation matrix

R<-matrix(c(1,0.2,0.2, 0.2,1,0.2, 0.2,0.2,1), nrow = p, ncol = p, byrow=TRUE)

Calc the eigenvalues and normalized eigenvectots of R

eigen(R) eigen(R)$values eigen(R)$vector

Mohamed Ali