Learn R Programming

fsr (version 2.0.1)

fsi_create: Create an empty fuzzy spatial inference model

Description

fsi_create() builds a fuzzy spatial inference (FSI) model without elements of the data source component (i.e., spatial plateau objects, fuzzy rules set, and fuzzy sets).

Usage

fsi_create(name, and_method = "min", or_method = "max",
           imp_method = "min", agg_method = "max", 
           defuzz_method = "centroid", default_conseq = NULL)

Value

An empty named FSI model that is ready to be populated with data source component (i.e., spatial plateau objects, fuzzy rules set, and fuzzy sets).

Arguments

name

A character value that specifies the name of the FSI model.

and_method

A character value that defines the operator for the logical connective AND. Default value is "min".

or_method

A character value that defines the operator for the logical connective OR. Default value is "max".

imp_method

A character value that defines the implication operator. Default value is "min".

agg_method

A character value that defines the aggregation operator. Default value is "max".

defuzz_method

A character value that determines the defuzzification technique. Default value is the centroid technique.

default_conseq

A function object that corresponds to a membership function of the consequent.

Details

The fsi_create() function creates an empty FSI model and its default parameter values will implement a model using Mamdani's method.

The possible values for the parameters and_method and imp_method are: "min", "prod". The name of a user-defined t-norm function can also be informed here. The possible value for the parameters or_method and agg_method is: "max". The name of a user-defined t-conorm function can also be informed here. The possible values for the parameter defuzz_method are "centroid" (default value), "bisector", "mom", "som", and "lom". The parameter default_conseq defines the default behavior of the FSI model when there is no fuzzy rule with a degree of fulfillment greater than 0 returned by the FSI model.

After creating an empty FSI model, you have to call the functions fsi_add_fsa(), fsi_add_cs(), and fsi_add_rules() to fulfill the FSI model with the needed information before performing inferences.

References

Carniel, A. C.; Galdino, F.; Philippsen, J. S.; Schneider, M. Handling Fuzzy Spatial Data in R Using the fsr Package. In Proceedings of the 29th International Conference on Advances in Geographic Information Systems (AM SIGSPATIAL 2021), pp. 526-535, 2021.

Underlying concepts and formal definitions of FSI models are introduced in:

Examples

Run this code
trim_mf <- function(a, b, c) {
  function(x) {
    pmax(pmin((x - a)/(b - a), (c - x)/(c - b), na.rm = TRUE), 0)
  }
}

# Creating the FSI model
fsi <- fsi_create("To visit or not to visit, that is the question", 
                  default_conseq = trim_mf(10, 30, 60)) 

Run the code above in your browser using DataLab