DpqDistance: Function to calculate D(p,q) distance.

View source: R/DpqDistance.R

DpqDistanceR Documentation

Function to calculate D(p,q) distance.

Description

DpqDistance calculates the generalized D(p,q) distance between two fuzzy numbers.

Usage

DpqDistance(value1, value2, p = 2, q = 1/2)

Arguments

value1

First fuzzy number.

value2

Second fuzzy number.

p

Value of the power (and the the root) applied in the distance calculation.

q

Value of the weight for the second fuzzy number (for the first one this weight is calculated as 1-q, respectively).

Details

The function calculates the generalized D(p,q) distance between two fuzzy numbers value1 and value2, where p is the value of the applied power, and q is the weight between these two fuzzy numbers.

All of the input values should be given by fuzzy numbers described by classes from FuzzyNumbers package.

Value

The output is a numerical value (the calculated distance).

Examples



library(FuzzyNumbers)

# prepare two fuzzy numbers

A <- TrapezoidalFuzzyNumber(0,1,2,3)

B <- TrapezoidalFuzzyNumber(1,3,4,6)

# calculate the distance

DpqDistance (A,B)



ZEP documentation built on June 23, 2025, 9:07 a.m.