addvar: Insert a variable

Description Usage Arguments Value Examples

View source: R/FuzzyInferenceSystem.R

Description

Adds an input or output variable to a fis object.

Usage

1
2
3
4
5
6
7
8
9
addvar(
  fis,
  varType,
  varName,
  varBounds,
  method = NULL,
  params = NULL,
  firing.method = "tnorm.min.max"
)

Arguments

fis

A fis must be provided.

varType

Should be either 'input' or 'output' which represents the type of variable to be created and added.

varName

A string representing the name of the variable.

varBounds

Also known as the 'range', this should be a vector giving a range for the variable, such as 1:10.

method

fuzzification or defuzzification method.

  • fuzzification: 'gauss', 'gbell', 'tri', or user-defined.

  • defuzzification: 'centroid', 'cos', 'coh', 'csum' or user-defined.

params

the required parameters for the corresponding fuzzification or defuzzification method. For example, the required parameters for gbell.fuzzification are c(a,b)

firing.method

the chosen method for getting the firing strength (for non-singleton fuzzification).

  • 'tnorm.min.max' - minimum t-norm with maximum membership grade as the firing strength

  • 'tnorm.prod.max' - product t-norm with maximum membership grade as the firing strength

  • 'tnorm.min.defuzz.[method]' - the firing strength is based on minimum t-norm, and the chosen defuzzification method (e.g. tnorm.min.defuzz.centroid)

  • 'tnorm.prod.defuzz.[method] - the firing strength is based on product t-norm, and the chosen defuzzification method (e.g. tnorm.prod.defuzz.bisector)

  • 'similarity.set' - Set-theoretic similarity: the ratio between the intersection and the union of two fuzzy sets

Value

A fis with the new variable added.

Examples

1
2
3
fis <- newfis('tipper')
fis <- addvar(fis, 'input', 'service', c(0, 10))
fis <- addvar(fis, 'input', 'service', c(0, 10), 'gauss', 0.5, 'tnorm.min.max')

FuzzyR documentation built on May 19, 2021, 9:06 a.m.

Related to addvar in FuzzyR...