weight_pow_dist: Generic weighted p-distance

Description Usage Arguments Value Author(s) Examples

View source: R/RcppExports.R

Description

Many isotropic models can be defined employing a distance. In particular this function implements a distance employing weights and different powers.

Usage

1
weight_pow_dist(x, y, w, p)

Arguments

x

First vector.

y

Second vector.

w

Weights for every coordinate in the vectors.

p

Powers for every coordinate in the vectors. To define a true norm every coordinate has to be greater than 1.

Value

Real value of the weighted p-distance.

Author(s)

Pedro Guarderas pedro.felipe.guarderas@gmail.com.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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

KRIG documentation built on May 2, 2019, 5:55 a.m.