R/l2.norm.R

Defines functions l2.norm

Documented in l2.norm

l2.norm <-
function(s, datafd, M)
{

  L2norm <- matrix(0,nrow=s,ncol=s)
  coef <- datafd$coef

  for (i in 1:(s-1)){
    coef.i <- coef[,i]
    for (j in (i+1):s){
      coef.j <- coef[,j]
      L2norm[i,j] <- t(coef.i-coef.j) %*% M %*% (coef.i-coef.j)
      L2norm[j,i] <- L2norm[i,j]
    }
  }

##################################################################
# Return:
##################################################################

  return(L2norm)

}

Try the geofd package in your browser

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

geofd documentation built on Jan. 29, 2020, 5:08 p.m.