The Fuzzy Systems Handbook

Second Edition

Te^hnische Universitat to instmJNik AutomatisiaMngstechnlk Fachgebi^KQegelup^stheorie und

D-S4283 Darrftstadt

lnvfentar-NgxC? V2^s

TU Darmstadt FB ETiT

05C Contents

Figures xix Code Listings xxxi Foreword xxxiii Acknowledgments xxxv Preface xxxvii Fuzzy Decision Systems: The Early Days xxxix Nature of this Book xli Adapting and Using the C++ Code Library xlii The Graphical Representation of Fuzzy Sets xliv Contacting the Author xlv Icons and Topic Symbols xlvi Notes xlviii

1. Introduction 1 Fuzzy System Models 2 , Complexity, and Comprehension 2 The Idea of Fuzzy Sets 3 Linguistic Variables 4 Approximate Reasoning 6 Benefits of Fuzzy System Modeling 7 The Ability to Model Highly Complex Business Problems 8 Improved Cognitive Modeling of Expert Systems 8 The Ability to Model Systems Involving Multiple Experts 9 Reduced Model Complexity 10 Improved Handling of Uncertainty and Possibilities 10 Common Objections to 11 What Can Fuzzy Logic Do? 12 to Reject Fuzzy System Solutions 13 The Precise Organization 14 Fuzzy Logic Is a Control Engineering Tool 14 Complex Time-Series Modeling 17 The Power of Conventional Expert Systems 17

vii Contents

The Precision of Mathematical Models 18 Fuzzy Model Stability 18 Fuzzy Model Execution Speed 19 Fuzzy Set Discovery and Correctness 22 Tuning and Validating Fuzzy Systems 27 The Somewhat Ad-Hoc Nature of Defuzzification 30 The Problem of Combinatorial Explosion 32 Some Actual Fuzzy System Models 36 Company Acquisition and Credit Analysis 36 Credit Authorization 37 Criminal Identification System 37 Mainframe DASD Planning 38 Expense Auditing 38 Financial Advisor 38 Container Management System 38 Intelligent Project Management ~ 39 Integrated MRP and Production Scheduler 39 Managed Health Care—Provider Fraud Detection 40 Organizational Dynamics 40 Loan Evaluation Advisor 41 Portfolio Safety and Suitability Model 41 Product Pricing Model 43 Risk Underwriting 43 Systems Complexity Analysis 43 Notes 43

2. Fuzziness and Certainty 45 The Different Faces of Imprecision 45 Inexactness 46 Precision and Accuracy 48 Accuracy and Imprecision 48 Measurement Imprecision and Intrinsic Imprecision 49 Ambiguity 49 Semantic Ambiguity 49 Visual Ambiguity 50 Structural Ambiguity 51 Undecidability 52 Vagueness 54 Fuzzy Logic and Interval Arithmetic 55 Contents ix

Fuzzy Logic and 57 What Is Probability? 57 Frequentist 57 Subjective Probabilities 58 Mathematical Foundations (Briefly) 59 Confusion of Aims 59 Confusion of Methods 60 Likelihood and Ambiguity 60 Fuzzy Probabilities 62 Bayes Theorem and Fuzzy Probability 63 Fuzzy Logic 64 Notes • 65

3. Fuzzy Sets 67 The Age of Science 68 Imprecision in the Everyday World 70 Imprecise Concepts 70 The Nature of Fuzziness 71 Fuzziness and Imprecision 75 Representing Imprecision with Fuzzy Sets 78 Fuzzy Sets 79 Representing Fuzzy Sets in Software 81 Basic Properties and Characteristics of Fuzzy Sets 84 Fuzzy Set Height and Normalization 84 Domains, Alpha-level Sets, and Support Sets 87 The Fuzzy Set Domain 87 The Universe of Discourse 89 The Support Set 90 Use of Psychometric Domains 90 Fuzzy Alpha-Cut Thresholds 94 Alpha Cuts, Transition Walls, and Control Voids 95 Encoding Information with Fuzzy Sets 99 Expressing a Fuzzy Concept 100 Fuzzy Numbers 100 Fuzzy Qualifiers 102 Generating Fuzzy Membership Functions 103 Linear Representations 104 Contents

S-Curve (Sigmoid/Logistic) Representations 109 S-Curves and Cumulative Distributions 111 Proportional and Frequency Representations 113 Fuzzy Numbers and "Around" Representations 119 Fuzzy Numbers 119 Fuzzy Quantities and Counts 121 PI Curves 123 Beta Curves 127 Gaussian Curves 133 Triangular, Trapezoidal, and Shouldered Fuzzy Sets 136 Triangular Fuzzy Sets 138 Shouldered Fuzzy Sets 140 Irregularly Shaped and Arbitrary Fuzzy Sets 149 Series 154 Domain-Based Coordinate Memberships 159 Notes 165

4. Fuzzy Set Operators 167 Conventional (Crisp) Set Operations 167 Basic Zadeh-Type Operations on Fuzzy Sets 168 Fuzzy Set Membership and Elements 168 The Intersection of Fuzzy Sets 172 The Union of Fuzzy Sets 178 The Complement (Negation) of Fuzzy Sets 182 Counterintuitives and the Law of Noncontradiction 186 Non-Zadeh and Compensatory Fuzzy Set Operations 191 General Algebraic Operations 194 The Mean and Weighted Mean Operators 194 The Product Operator 198 The Heap Metaphor 199 The Bounded Difference and Sum Operators 201 Functional Compensatory Classes 202 The Yager Compensatory Operators 203 The Yager AND Operator 204 The Yager OR Operator 205 The Yager NOT Operator 209 Contents xi

The Sugeno Class and Other Alternative NOT Operators 211 Threshold NOT Operator 212 The Cosine NOT Function 212 Notes 216

5. Fuzzy Set Hedges 217 Hedges and Fuzzy Surface Transformers 217 The Meaning and Interpretation of Hedges 218 Importance of Hedges in Fuzzy Modeling 219 Dynamically Created Fuzzy Sets 219 Reducing Rule Complexity 221 Applying Hedges 222 Predicate and Consequent Hedges 223 Fuzzy Region Approximation ? 223 Restricting a Fuzzy Region 227 Intensifying and Diluting Fuzzy Regions 230 The Very Hedge 231 The Somewhat Hedge 239 Reciprocal Nature of Very and Somewhat 245 Contrast Intensification and Diffusion 246 The Positively Hedge 246 The Generally Hedge 249 Approximating a Scalar 260 Examples of Typical Hedge Operations 263 Notes , 268

6. Fuzzy Reasoning 269 The Role of Linguistic Variables 271 Fuzzy Propositions 273 Conditional Fuzzy Propositions 274 Unconditional Fuzzy Propositions 275 The Order of Proposition Execution 275 Monotonic (Proportional) Reasoning 275 Monotonic Reasoning with Complex Predicates 282 xii Contents

The Fuzzy Compositional Rules of 284 The Min-Max Rules of Implication 284 The Fuzzy Additive Rules of Implication 285 Accumulating Evidence with the Fuzzy Additive Method 286 Fuzzy Implication Example 289 Correlation Methods 293 Correlation Minimum 293 Correlation Product 295 The Minimum Law of Fuzzy Assertions 297 Methods of Decomposition and Defuzzification 303 Composite Moments (Centroid) 307 Composite Maximum (Maximum Height) 309 Hyperspace Decomposition Comparisons 310 Preponderance of Evidence Technique 310 Other Defuzzification Techniques 314 The Average of Maximum Values ^ 315 The Average of the Support Set 315 The Far and Near Edges of the Support Set 316 The Center of Maximums 317 Singleton Geometry Representations 324 Notes , 328

7. Fuzzy Models 329 The Basic Fuzzy System 329 The Fuzzy Model Overview 330 The Model Code View 332 Code Representation of Fuzzy Variables 333 Incorporating Hedges in the Fuzzy Model 336 Representing and Executing Rules in Code 337 Setting Alpha-Cut Thresholds 339 Including a Model Explanatory Facility 340 The Advanced Fuzzy Modeling Environment 345 The Policy Concept 345 Understanding Hash Tables and Dictionaries 346 Creating a Model and Associated Policies 353 Managing Policy Dictionaries 357 Loading Default Hedges 358 Contents xiii

Fundamental Model Design Issues 360 Integrating Application Code with the Modeling System 361 Tasks at the Module Main Program Level 362 Connecting the Model to the System Control Blocks 362 Allocating and Installing the Policy Structure 363 Defining Solution (Output) Variables 363 Creating and Storing Fuzzy Sets in Application Code 364 Creating and Storing Fuzzy Sets in a Policy's Dictionary 365 Loading and Creating Hedges 366 Segmenting Application Code into Modules 369 Maintaining Addressability to the Model 369 Establishing the Policy Environment 369 Initializing the Fuzzy Logic Work Area for the Policy 370 Locating the Necessary Fuzzy Sets and Hedges 371 Exploring a Simple Fuzzy System Model 372 Exploring a More Extensive Pricing Policy 384 The Interpretation of Model Results 395 Undecidable Models 396 Compatibility Index Metrics 399 The Idea of a Compatibility Index 399 The Unit Compatibility Index 400 Scaling Expected Values by the Compatibility Index 409 The Statistical Compatibility Index • 410 Selecting Height Measurements 414 Measuring Variability in the Model 414 Notes 415

8. Fuzzy Systems: Case Studies 417 A Fuzzy Steam Turbine Controller 418 The Fuzzy Control Model 418 The Fuzzy Logic Controller 418 The Conventional PID Controller 419 The Steam Turbine Plant Process 420 Designing the Fuzzy Logic Controller 422 Running the Steam Turbine FLC Logic 424 xiv Contents

The New Product Pricing Model (Version 1) 428 Model Design and Objectives 429 The Model Execution Logic 430 Create the Basic Price Fuzzy Sets 431 Create the Run-Time Model Fuzzy Sets 431 Execute the Price Estimation Rules - 432 Defuzzify to Find Expected Value for Price 438 Evaluating Defuzzification Strategies 438 The New Product Pricing Model (Version 2) 452 Model Design Strategies 452 The Model Execution Logic 453 Create the Basic Fuzzy Sets 453 Create the Run-Time Model Fuzzy Sets 454 Execute the Price Estimation Rules ^ 456 The New Product Pricing Model (Version 3) 462 The Model Execution Logic 462 Execute the Price Estimation Rules 462 Defuzzify to Find Expected Value for Price 468 The New Product Pricing Model (P&L Version) 468 Design for the P&L Model 469 Model Execution and Logic 470 Using Policies to Calculate Price and Sales Volume 473 A Project Risk Assessment Model 475 The Model Design 475 Model Application Issues 476 Model Execution Logic 479 Executing the Risk Assessment Rules 481 Notes 486

9. Building Fuzzy Systems: A System Evaluation and Design Methodology 489 Evaluating Fuzzy System Projects 489 The Ideal Fuzzy System Problem 490 Fuzzy Model Characteristics 490 Fuzzy Control Parameters 490 Multiple Experts 493 Elastic Relationships Among Continuous Variables 494 Complex, Poorly Understood, or Nonlinear Problems 494 Uncertainties, Probabilities, and Possibilities in Data 495 Contents xv

Fuzzy Set and Data Representational Issues 496 Variable and Parameter Decomposition 497 Semantic Decomposition of Profit 497 Fuzzy Set Naming Conventions 501 The Meaning and Degree of Fuzzy Set Overlap 503 Control Engineering Perspectives on Overlap and Composition 508 Highly Overlapping Fuzzy Regions 511 Designing and Eliciting Fuzzy Sets 512 Knowledge Engineering 512 A Knowledge Acquisition Methodology 513 Voted-For Distributions 515 Statistical Properties of the Data 517 Psychometrics of Fuzzy Set Evolution 521 Fuzzy set implications: cross-over point ^ and the voting of populations. 524 Best Estimate of the Variable's (SWAG) 525 Automatic Variable Decomposition 526 Boolean and Semi-Fuzzy Variables 529 Using Boolean Filters 529 Applying Explicit Degrees of Membership 530 Uncertain and Noisy Data 532 Handling Uncertain and Noisy Data 536 Inferencing with Fuzzy Data 537 Building Fuzzy System Models 539 The Fuzzy Design Methodology 542 Define the Model's Functional and Operational Characteristics 542 Define the System in Terms of an Input-Process-Output Model 543 Localize the Model in the Production System 543 Segment the Model into Functional and Operational Components 544 Isolate the Critical Performance Variables 544 Choose the Mode of Solution Variables 545 Resolve Basic Performance Criteria 545 Decide on a Level of Granularity 545 Determine Domain of the Model Variables 546 Determine the Degree of Uncertainty in the Data 546 Define the Limits of Operability 547 Establish Metrics for Model Performance Requirements 547 xvi Contents

Define the Fuzzy Sets 547 Determine the Type of Fuzzy Measurement 547 Choose the Shape of the Fuzzy Set (Its Surface Morphology) 548 Elicit a Fuzzy Set Shape 549 Select an Appropriate Degree of Overlap 550 Decide on the Space Correlation Metrics 550 Ensure that the Sets are Conformally Mapped 550 Write the Rules 553 Write the Ordinary Conditional Rules 554 Enter Any Unconditional Rules 554 Select Compensatory Operators for Special Rules 554 Review the Rule Set and Add Any Hedges 555 Add Any Alpha Cuts to Individual Rules - 555 Enter the Rule Execution Weights 555 Define the Defuzzification Method for Each Solution Variable 556 Notes 556

10. Using the Fuzzy Code Libraries 557 The Code and Interface Libraries 557 General Software Issues 559 System and Client Error Diagnostics 559 Software Status Codes 561 Information and Warning Messages 561 Using Dynamic Link Library (DLL) Files 562 The Visual Basic Module 563 Using the DLL in Visual Basic 564 Modeling and Utility Software 566 Symbolic Constants, Global Data, and Prototypes 566 Data Structures 566 Fuzzy Logic Functions 567 The Fuzzy System Modeling Functions 567 Miscellaneous Tools and Utilities 571 Demonstration and Fuzzy Model Programs 572 of Fuzzy Logic Functions 573 FzyAboveAlfa 574 FzyAddFZYctl 575 FzyAND 577 FzyApplyAlfa 578 FzyApplyAND 580 FzyApplyHedge 582 FzyApplyNOT 585 Contents xvii

FzyApplyOR 586 FzyAutoScale 588 FzyBetaCurve 588 FzyCompAND 590 FzyCompOR 591 FzyCondProposition 593 FzyCoordSeries 595 FzyCopySet 597 FzyCopyVector 598 FzyCorrMinimum 599 FzyCorrProduct 600 FzyCreateHedge 601 FzyCreateSet - 604 FzyDefuzzify 611 FzyDisplayFSV 616 FzyDrawSet 617 FzyExamineSet 619 FzyFindFSV 622 FzyFind Plateau 622 FzyGetCoordinates 624 FzyGetHeight 626 FzyGetMembership 627 FzyGetScalar 628 FzylmplMatrix 629 FzylnitCIX 632 FzylnitFDB 632 FzylnitFZYctl 633 FzylnitHDB 634 FzylnitVector 634 FzylnterpVec 635 FzylsNormal 636 FzyLinearCurve 637 FzyMemSeries 639 FzyMonotonicLogic 641 FzyNormalizeSet 642 FzyOR 643 FzyPiCurve 644 FzyPlotSets 646 FzySCurve 649 FzyStatComplndex 651 FzySupportSet 653 FzyTrueSet 654 FzyUnCondProposition 654 FzyUnitComplndex 656 xviii Contents

A. Appendix—The Combs Method for Rapid Inference 659 The Combinatorial Problem: Fuzzy Logic's Achilles' Heel 659 How Does the URC Affect the Multiplication of Rules? 665 How Does the URC Work? 669 Modeling Each Input's Relative Importance 672 And Speaking of Tuning ... 674 Design Considerations 676 An HMO Scheduling Program 677 Conclusion 678 Acknowledgments 678 678 Biography 680

Glossary 681 Bibliography 703 Index 707