R/matdistl2dpar.R

Defines functions matdistl2dpar

Documented in matdistl2dpar

matdistl2dpar <-
function(meanL, varL)
{
# Computing of the inner products
  W = diag(0, nrow = length(meanL))
  dimnames(W) = list(names(meanL), names(meanL))
  W = matipl2dpar(meanL, varL)

# Computing of the distances  
  distances = diag(0, nrow = length(meanL))
  dimnames(distances) = list(names(meanL), names(meanL))

  for (i in 2:length(meanL))  for (j in 1:(i-1))  {
      distances[i, j] = distances[j, i] = sqrt( W[i, i] + W[j, j] - 2 * W[i, j] )
    }
  as.dist(distances)
}

Try the dad package in your browser

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

dad documentation built on Aug. 30, 2023, 5:06 p.m.