distrectw {lazy.tools}R Documentation

Calculation of Weighted Distance Matrix between the rows of F and A

Description

This program calculated weighted distance between the rows of F matrix and the rows of A matrix
by applying the j-th row as a set of dimensional weights. dij = sqrt( (f[i,]-a[j,])' diag(Wa[j,]) (f[i,]-a[j,]) )

Usage

distrectw(F, A, Wa = matrix(1, nrow(A), ncol(A)))

Arguments

F

n x r matrix

A

p x r matrix

Wa

p x r maatrix

Value

A matrices of size n x p

Examples

F <- matrix( c(0,0,  3,0,  0,4), 3,2,  byrow=1 )
A <- matrix( c(0,0,  3,4 ), 2,2, byrow=1 )
distrectw( F,A )
Wa <- matrix( c(1,1,  1,2 ), 2,2, byrow=1 )
distrectw( F,A, Wa )


[Package lazy.tools version 0.1.3 Index]