powered by
Many isotropic models can be defined employing a distance. In particular this function implements a distance employing weights and different powers.
weight_pow_dist(x, y, w, p)
First vector.
Second vector.
Weights for every coordinate in the vectors.
Powers for every coordinate in the vectors. To define a true norm every coordinate has to be greater than 1.
Real value of the weighted p-distance.
# NOT RUN { library(KRIG) n<-1e5 x<-runif( n ) y<-runif( n ) p<-rep(2.5,n) w<-runif(n) kw<-weight_pow_dist( x, y, w, p ) nw<-sum( w * abs( x - y )^p ) nw == kw # }
Run the code above in your browser using DataLab