anfis.plotmf: Plot membership functions for an ANFIS object

Description Usage Arguments Value Examples

View source: R/FuzzyInferenceSystem.R

Description

Plots a 2D graph of all membership functions from the specified variable which must be part of an anfis object.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
anfis.plotmf(
  anfis,
  varType,
  varIndex,
  xx = NULL,
  timelimit = 0,
  xlab = NULL,
  ylab = NULL,
  main = NULL
)

Arguments

anfis

Requires an existing anfis as an argument.

varType

Can be either 'input' or 'output', representing the type of variable.

varIndex

A numerical integer, representing the index of the input or output variable whose membership functions shall be plotted (base 1).

xx

primary inputs for extra lines

timelimit

for perturbation

xlab

X axis label using font, size and color

ylab

Y axis label, same font attributes as xlab

main

The main title (on top)

Value

A two dimensional graph displaying all the membership functions of a given variable.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
fis <- anfis.tipper()
anfis <- anfis.builder(fis)
data.num <- 5
input.num <- length(fis$input)
input.stack <- matrix(rnorm(data.num*input.num), ncol=input.num)
y <- matrix(rnorm(data.num))
data.trn <- cbind(input.stack, y)
anfis.eval(anfis, input.stack)
anfis.final <- anfis.optimise(anfis, data.trn, epoch.total=500,
                                 stepsize=0.01, rate.inc=1.1, rate.dec=0.9)
anfis.plotmf(anfis, 'input', 1)
anfis.plotmf(anfis.final, 'input', 1)

Example output

          [,1]
[1,] -9.284054
[2,]  9.562075
[3,] 33.911771
[4,] 20.065332
[5,] 15.039003
  [1] 2.920810e-04 2.494331e-04 2.134054e-04 1.829378e-04 1.571451e-04
  [6] 1.332931e-04 1.133869e-04 9.675350e-05 8.283789e-05 7.012670e-05
 [11] 5.965354e-05 5.101391e-05 4.387846e-05 3.744958e-05 3.223048e-05
 [16] 2.799127e-05 2.454752e-05 2.150203e-05 1.908261e-05 1.716391e-05
 [21] 1.564587e-05 1.434178e-05 1.333446e-05 1.254936e-05 1.192332e-05
 [26] 1.135828e-05 1.087618e-05 1.044843e-05 1.006046e-05 9.670123e-06
 [31] 9.312420e-06 8.983280e-06 8.678922e-06 8.370271e-06 8.085581e-06
 [36] 7.822639e-06 7.579051e-06 7.331029e-06 7.101993e-06 6.889612e-06
 [41] 6.692418e-06 6.491118e-06 6.304614e-06 6.131210e-06 5.969567e-06
 [46] 5.804290e-06 5.650540e-06 5.507112e-06 5.373206e-06 5.235692e-06
 [51] 5.107344e-06 4.987474e-06 4.874880e-06 4.759140e-06 4.650739e-06
 [56] 4.549509e-06 4.454269e-06 4.355897e-06 4.263790e-06 4.177587e-06
 [61] 4.096446e-06 4.011956e-06 3.934563e-06 3.859281e-06 3.798815e-06
 [66] 3.736254e-06 3.728220e-06 3.665445e-06 3.660832e-06 3.608710e-06
 [71] 3.607079e-06 3.550127e-06 3.497594e-06 3.443410e-06 3.400794e-06
 [76] 3.356628e-06 3.320471e-06 3.283698e-06 3.253076e-06 3.221833e-06
 [81] 3.221365e-06 3.195052e-06 3.194336e-06 3.172661e-06 3.172034e-06
 [86] 3.148284e-06 3.126043e-06 3.102017e-06 3.082739e-06 3.062244e-06
 [91] 3.044893e-06 3.027031e-06 3.025935e-06 3.011639e-06 3.010407e-06
 [96] 2.998378e-06 2.997177e-06 2.983994e-06 2.983979e-06 2.972480e-06
[101] 2.972227e-06 2.959327e-06 2.947179e-06 2.933382e-06 2.923101e-06
[106] 2.911485e-06 2.901673e-06 2.891738e-06 2.891179e-06 2.883223e-06
[111] 2.882455e-06 2.876095e-06 2.875197e-06 2.868057e-06 2.867760e-06
[116] 2.862051e-06 2.861268e-06 2.854592e-06 2.847647e-06 2.840299e-06
[121] 2.834460e-06 2.828474e-06 2.828431e-06 2.823132e-06 2.823121e-06
[126] 2.819258e-06 2.818721e-06 2.814509e-06 2.810186e-06 2.805651e-06
[131] 2.802284e-06 2.798355e-06 2.795745e-06 2.795545e-06 2.792991e-06
[136] 2.790999e-06 2.788847e-06 2.787592e-06 2.786575e-06 2.785758e-06
[141] 2.785009e-06 2.784825e-06 2.784192e-06 2.784182e-06 2.783930e-06
[146] 2.783594e-06 2.783046e-06 2.782942e-06 2.782745e-06 2.782658e-06
[151] 2.782618e-06 2.782399e-06 2.782023e-06 2.781812e-06 2.781538e-06
[156] 2.781514e-06 2.781123e-06 2.781105e-06 2.780824e-06 2.780535e-06
[161] 2.780320e-06 2.780103e-06 2.779978e-06 2.779896e-06 2.779813e-06
[166] 2.779769e-06 2.779703e-06 2.779639e-06 2.779471e-06 2.779345e-06
[171] 2.779223e-06 2.779179e-06 2.779093e-06 2.778902e-06 2.778893e-06
[176] 2.778602e-06 2.778556e-06 2.778519e-06 2.778043e-06 2.777997e-06
[181] 2.777879e-06 2.777670e-06 2.777557e-06 2.777403e-06 2.777376e-06
[186] 2.777098e-06 2.777081e-06 2.776871e-06 2.776675e-06 2.776595e-06
[191] 2.776560e-06 2.776530e-06 2.776333e-06 2.776271e-06 2.776190e-06
[196] 2.776130e-06 2.775957e-06 2.775752e-06 2.775702e-06 2.775603e-06
[201] 2.775524e-06 2.775303e-06 2.775191e-06 2.775181e-06 2.775078e-06
[206] 2.775024e-06 2.774946e-06 2.774923e-06 2.774916e-06 2.774816e-06
[211] 2.774790e-06 2.774726e-06 2.774658e-06 2.774641e-06 2.774633e-06
[216] 2.774578e-06 2.774573e-06 2.774461e-06 2.774438e-06 2.774404e-06
[221] 2.774377e-06 2.774349e-06 2.774206e-06 2.774194e-06 2.774160e-06

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

Related to anfis.plotmf in FuzzyR...