R/weightedGramSchmidt.R

Defines functions `weightedGramSchmidt`

`weightedGramSchmidt` <-
function(x,w) {
  ss<-NULL;
  for (j in 1:dim(x)[2]) {
  if (j > 1) {xx<-x[,1:(j-1)]; x[,j]<-x[,j]-xx%*%(crossprod(xx,(w*x[,j])))}
  s<-sqrt(sum(w*x[,j]^2)); ss<-c(ss,s); x[,j]<-x[,j]/s;}
  list(pol=x,fac=ss)
}

Try the aspect package in your browser

Any scripts or data that you put into this service are public.

aspect documentation built on May 4, 2022, 3 a.m.