PlotZFunction: Plot input and output for the Zadeh's principle

View source: R/PlotZFunction.R

PlotZFunctionR Documentation

Plot input and output for the Zadeh's principle

Description

PlotZFunction applies the selected function to a fuzzy number using the Zadeh's principle, and plots the input and output.

Usage

PlotZFunction(
  value,
  FUN,
  knots = 10,
  grid = TRUE,
  alternate = FALSE,
  approximation = FALSE,
  method = "NearestEuclidean",
  ...
)

Arguments

value

Input fuzzy number.

FUN

Function used for the input fuzzy number with the help of the Zadeh's principle.

knots

Number of the alpha-cuts used during calculation of the output.

grid

If TRUE, then additional grid is plotted.

alternate

If TRUE, the second type of the layout of figures is used.

approximation

If TRUE, the approximated output is calculated.

method

The selected approximation method.

...

Additional parameters passed to other functions.

Details

The function takes the input fuzzy number value (which should be described by one of the classes from FuzzyNumbers package) and applies the function FUN using the Zadeh's principle. The output is given by a fuzzy number or its approximation (when approximation is set to TRUE and the respective method is selected). To properly find the output, value of FUN is calculated for many alpha-cuts of value. The number of these alpha-cuts is equal to knots (plus 2 for the support and the core). The input and output fuzzy numbers are plotted together with the applied function. If the approximation is used, then also the approximated fuzzy number is shown (green line).

The input fuzzy number value should be given by fuzzy number described by classes from FuzzyNumbers package.

Value

Three (or four) figures are plotted: the input fuzzy number, the respective output (for the Zadeh's principle and the applied function), and the function. The output fuzzy number can be approximated with the selected method and also plotted.

Examples


library(FuzzyNumbers)

# prepare complex fuzzy number

A <- FuzzyNumber(-5, 3, 6, 20, left=function(x)
pbeta(x,0.4,3),
right=function(x) 1-x^(1/4),
lower=function(alpha) qbeta(alpha,0.4,3),
upper=function(alpha) (1-alpha)^4)

# plot the figures

PlotZFunction(A,FUN=function(x)x^3+2*x^2-1)

# find and plot the approximated output via the Zadeh's principle

PlotZFunction(A,FUN=function(x)x^3+2*x^2-1,approximation=TRUE)



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