1) mamdani fuzzy model sugeno fuzzy models

12
1) Mamdani fuzzy model max โˆ’ min/ product 1 โˆช 2 โˆชโ€ฆ 2) Sugeno fuzzy models Takagi-Sugeno-Kang (TSK): consequent part of a rule is a polynomial function of inputs. Defuzzification: โˆ— = 1 1 + 2 2 1 + 2 โˆ— = 1 ( 1 + 1 + 1 )+ 2 ( 2 + 2 + 2 ) 1 + 2 Type 1: TSK model (1 st order) 1 = 1 1 + 1 1 + 1 1 = 1 + 1 + 1 Type 0: (or 0 โ„Ž order TSK) 1 = 1 0 + 1 0 + 1 1 = 1 + 1 + 1 (consequent part is just a number) 1 = 1 1 st order TSK and models are commonly used in modeling (forecasting) applications. Neuro fuzzy models (NF) are fuzzy model โ€“ but they are different from conventional fuzzy systems. They can use machine learning algorithms to update parameters.

Upload: others

Post on 25-Feb-2022

19 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1) Mamdani fuzzy model Sugeno fuzzy models

1) Mamdani fuzzy model maxโˆ’min/ product

๐‘…1 โˆช ๐‘…2 โˆช โ€ฆ

2) Sugeno fuzzy models Takagi-Sugeno-Kang (TSK): consequent part of a rule is a polynomial function of inputs.

Defuzzification:

๐‘งโˆ— =๐‘ค1๐‘ง1 + ๐‘ค2๐‘ง2

๐‘ค1 + ๐‘ค2

๐‘งโˆ— =๐‘ค1(๐“…1๐‘ฅ + ๐“†1๐‘ฆ + ๐‘Ÿ1) + ๐‘ค2(๐“…2๐‘ฅ + ๐“†2๐‘ฆ + ๐‘Ÿ2)

๐‘ค1 + ๐‘ค2

Type 1: TSK model (1st order)

๐‘ง1 = ๐“…1๐‘ฅ1 + ๐“†1๐‘ฆ

1 + ๐‘Ÿ1

๐‘ง1 = ๐“…1๐‘ฅ + ๐“†1๐‘ฆ + ๐‘Ÿ1

Type 0: (or 0๐‘กโ„Ž order TSK)

๐‘ง1 = ๐“…1๐‘ฅ0 + ๐“†1๐‘ฆ

0 + ๐‘Ÿ1

๐‘ง1 = ๐“…1 + ๐“†1 + ๐‘Ÿ1

(consequent part is just a number)

๐‘ง1 = ๐ถ1

1st order TSK and models are commonly used in modeling (forecasting) applications.

Neuro fuzzy models (NF) are fuzzy model โ€“ but they are different from conventional fuzzy systems. They

can use machine learning algorithms to update parameters.

Page 2: 1) Mamdani fuzzy model Sugeno fuzzy models

3) Tsukamoto fuzzy models Premise parts โ†’ same

Consequent parts โ†’ monotonic functions

Defuzzification (output):

๐‘งโˆ— =๐‘ค1๐‘ง1 + ๐‘ค2๐‘ง2

๐‘ค1 + ๐‘ค1

(Read by yourself for more info โ€“ Section 4.5, Book 2)

Page 3: 1) Mamdani fuzzy model Sugeno fuzzy models
Page 4: 1) Mamdani fuzzy model Sugeno fuzzy models
Page 5: 1) Mamdani fuzzy model Sugeno fuzzy models
Page 6: 1) Mamdani fuzzy model Sugeno fuzzy models
Page 7: 1) Mamdani fuzzy model Sugeno fuzzy models

Chapter 4: System Training The difference between a fuzzy system and a neuro fuzzy system is that we can implement the fuzzy

system like a neural network, then we can train system parameters.

We can use machine learning or training algorithms to optimize membership function parameters. This

includes the TSK model (the consequent part parameters) and system reasoning structures. Parameters

can be linear or nonlinear.

Linear: ๐‘ง = 3๐‘ฅ + 5๐‘ฆ + 2

Non-linear: ๐‘งโˆ— = 2๐‘ฅ2 + 3๐‘ฆ3 + ๐‘ฅ + 2

4.1 Least Squares Estimator (LSE) For linear parameter optimization:

๐‘ฆ = ๐œƒ1๐‘“(๏ฟฝโƒ—๏ฟฝ 1) + ๐œƒ2๐‘“(๏ฟฝโƒ—๏ฟฝ 2)โ€ฆ ๐œƒ๐‘›๐‘“(๏ฟฝโƒ—๏ฟฝ ๐‘›)

Parameters = {๐œƒ1 ๐œƒ2 โ€ฆ ๐œƒ๐‘›}

Output = ๐‘ฆ

Input vectors = uโƒ— 1, uโƒ— 2 , โ€ฆ , uโƒ— n

(Because uโƒ— = {uโƒ— 1 uโƒ— 2 โ€ฆ uโƒ— n})

Page 8: 1) Mamdani fuzzy model Sugeno fuzzy models

4.1 Least Squares Estimator or linear parameter optimization:

๐‘งโˆ— =๐‘ค1๐‘ง1 + ๐‘ค2๐‘ง2

๐‘ค1 + ๐‘ค2

๐‘งโˆ— =๐‘ค1(๐‘1๐‘ฅ + ๐‘ž1๐‘ฆ + ๐‘Ÿ1) + ๐‘ค2(๐‘2๐‘ฅ + ๐‘ž2๐‘ฆ + ๐‘Ÿ2)

๐‘ค1 + ๐‘ค2

Linear parameters: ๐‘1, ๐‘ž1, ๐‘Ÿ1, ๐‘2, ๐‘ž2, ๐‘Ÿ2

๐œ‡๐ด2= ๐‘’

โˆ’(๐‘ฅโˆ’๐‘Ž)2

๐‘2 ; ๐‘ค2 = ๐‘’โˆ’(๐‘ฅ0โˆ’๐‘Ž

๐‘)2

Nonlinear: MF (membership function) parameters

๐‘ฆ = ๐œƒ1๐‘“1(๏ฟฝโƒ—๏ฟฝ ) + ๐œƒ2๐‘“2(๏ฟฝโƒ—๏ฟฝ ) + โ‹ฏ+ ๐œƒ๐‘›๐‘“๐‘›(๏ฟฝโƒ—๏ฟฝ )

๏ฟฝโƒ—๏ฟฝ = {๐‘ฅ1, ๐‘ฅ2, โ€ฆ , ๐‘ฅ๐‘›}๐‘‡

๐œƒ = {๐œƒ1, ๐œƒ2, โ€ฆ , ๐œƒ๐‘›}๐‘‡

Linear parameters:

{๏ฟฝโƒ—๏ฟฝ 1, ๐‘ฆ1}, {๏ฟฝโƒ—๏ฟฝ 2, ๐‘ฆ2},โ€ฆ , {๏ฟฝโƒ—๏ฟฝ ๐‘š , ๐‘ฆ๐‘š}

General representation:

{๏ฟฝโƒ—๏ฟฝ ๐‘– , ๐‘ฆ๐‘–} ; ๐‘– = 1, 2, โ€ฆ ,๐‘š

๐‘“1(๏ฟฝโƒ—๏ฟฝ 1)๐œƒ1 + ๐‘“2(๏ฟฝโƒ—๏ฟฝ 1)๐œƒ2 + โ‹ฏ+ ๐‘“๐‘›(๏ฟฝโƒ—๏ฟฝ 1)๐œƒ๐‘› = ๐‘ฆ1

๐‘“1(๏ฟฝโƒ—๏ฟฝ 2)๐œƒ1 + ๐‘“2(๏ฟฝโƒ—๏ฟฝ 2)๐œƒ2 + โ‹ฏ+ ๐‘“๐‘›(๏ฟฝโƒ—๏ฟฝ 2)๐œƒ๐‘› = ๐‘ฆ2

โ‹ฎ

๐‘“1(๏ฟฝโƒ—๏ฟฝ ๐‘š)๐œƒ1 + ๐‘“2(๏ฟฝโƒ—๏ฟฝ ๐‘š)๐œƒ2 + โ‹ฏ+ ๐‘“๐‘›(๏ฟฝโƒ—๏ฟฝ ๐‘š)๐œƒ๐‘› = ๐‘ฆ๐‘š

Page 9: 1) Mamdani fuzzy model Sugeno fuzzy models

Matrix representation:

[ ๐‘“1(๏ฟฝโƒ—๏ฟฝ 1) ๐‘“2(๏ฟฝโƒ—๏ฟฝ 1) โ‹ฏ ๐‘“๐‘›(๏ฟฝโƒ—๏ฟฝ 1)

๐‘“1(๏ฟฝโƒ—๏ฟฝ 2) ๐‘“2(๏ฟฝโƒ—๏ฟฝ 2) โ‹ฏ ๐‘“๐‘›(๏ฟฝโƒ—๏ฟฝ 2)โ‹ฎ โ‹ฎ โ‹ฏ โ‹ฎ

๐‘“๐‘›(๏ฟฝโƒ—๏ฟฝ ๐‘–) ๐‘“๐‘›(๏ฟฝโƒ—๏ฟฝ ๐‘–) โ‹ฏ ๐‘“๐‘›(๏ฟฝโƒ—๏ฟฝ ๐‘–)โ‹ฎ โ‹ฎ โ‹ฑ โ‹ฎ

๐‘“1(๏ฟฝโƒ—๏ฟฝ ๐‘š) ๐‘“2(๏ฟฝโƒ—๏ฟฝ ๐‘š) โ‹ฏ ๐‘“๐‘›(๏ฟฝโƒ—๏ฟฝ ๐‘š)]

[

๐œƒ1

๐œƒ2

โ‹ฎ๐œƒ๐‘›

] = [

๐‘ฆ1

๐‘ฆ2

โ‹ฎ๐‘ฆ๐‘š

]

๐œƒ ๐‘‡ = {๐œƒ1, ๐œƒ2 , โ€ฆ , ๐œƒ๐‘›}

Summary:

โ€ข Vectors โ€œโ†’โ€ (column representation, typically)

โ€ข Matrix ๐ด

โ€ข Scalar

๐‘Ž ๐‘–๐‘‡ = {๐‘“1(๏ฟฝโƒ—๏ฟฝ 1), ๐‘“2(๏ฟฝโƒ—๏ฟฝ 2), โ€ฆ , ๐‘“๐‘›(๏ฟฝโƒ—๏ฟฝ ๐‘–)}

{๏ฟฝโƒ—๏ฟฝ ๐‘–; ๐‘ฆ๐‘–}

๐ด ๐œƒ = ๐‘ฆ

If ๐ด is non-singular (det โ‰  0)

๐ดโˆ’1๐ด ๐œƒ = ๐ดโˆ’1 ๐‘ฆ

๐œƒ = ๐ดโˆ’1๐‘ฆ

๐‘š โ†’ ๐‘›

๐‘š = # of training data points

๐‘› = # of linear paramerers to be optimized

โ€œIn general, the training data points should be 5-times the number of linear data points to be optimizedโ€

โ€ข Noise in experiments

Unavoidable (always present)

๐ด ๐œƒ + ๐‘’ = ๐‘ฆ

Error vector:

๐‘’ = ๐‘ฆ โˆ’ ๐ด ๐œƒ

Objective function:

๐ธ(๐œƒ ) = (๐‘ฆ1 โˆ’ ๐‘Ž 1๐‘‡๐œƒ )

2+ (๐‘ฆ2 โˆ’ ๐‘Ž 2

๐‘‡๐œƒ )2+ โ‹ฏ+ (๐‘ฆ๐‘– โˆ’ ๐‘Ž ๐‘–

๐‘‡๐œƒ )2+ โ‹ฏ+ (๐‘ฆ๐‘š โˆ’ ๐‘Ž ๐‘š

๐‘‡ ๐œƒ )2

๐ธ(๐œƒ ) = โˆ‘(๐‘ฆ๐‘– โˆ’ ๐‘Ž ๐‘–๐‘‡๐œƒ )

2

๐‘–=1

Page 10: 1) Mamdani fuzzy model Sugeno fuzzy models

๐‘’ ๐‘– = ๐‘ฆ๐‘– โˆ’ ๐‘Ž ๐‘–๐‘‡๐œƒ ; Where ๐‘– = 1, 2, 3, โ€ฆ ,๐‘š

๐ธ(๐œƒ ) = ๐‘’ 1๐‘‡๐‘’ 1 + ๐‘’ 2

๐‘‡๐‘’ 2 + โ‹ฏ+ ๐‘’ ๐‘–๐‘‡๐‘’ ๐‘– + โ‹ฏ+ ๐‘’ ๐‘š

๐‘‡ ๐‘’ ๐‘š

๐ธ(๐œƒ ) = โˆ‘๐‘’ ๐‘–๐‘‡๐‘’ ๐‘–

๐‘š

๐‘–=1

Consider:

๐‘’ ๐‘‡๐‘’ = (๐‘ฆ โˆ’ ๐ด๐œƒ )๐‘‡(๐‘ฆ โˆ’ ๐ด๐œƒ )

= [๐‘ฆ ๐‘‡ โˆ’ (๐ด๐œƒ )๐‘‡](๐‘ฆ โˆ’ ๐ด๐œƒ )

= [๐‘ฆ ๐‘‡ โˆ’ ๐œƒ ๐‘‡๐ด๐‘‡](๐‘ฆ โˆ’ ๐ด๐œƒ )

= ๐‘ฆ ๐‘‡๐‘ฆ โˆ’ ๐‘ฆ ๐‘‡๐ด๐œƒ โˆ’ ๐œƒ ๐‘‡๐ด๐‘‡๐‘ฆ + ๐œƒ ๐‘‡๐ด๐‘‡๐ด๐œƒ

= ๐‘ฆ ๐‘‡๐‘ฆ โˆ’ ๐‘ฆ ๐‘‡๐ด๐œƒ โˆ’ ๐‘ฆ ๐‘‡๐ด๐œƒ + ๐œƒ ๐‘‡๐ด๐‘‡๐ด๐œƒ

= ๐‘ฆ ๐‘‡๐‘ฆ โˆ’ 2๐‘ฆ ๐‘‡๐ด๐œƒ + ๐œƒ ๐‘‡๐ด๐‘‡๐ด๐œƒ

๐œƒ = {๐œƒ1, ๐œƒ2, โ€ฆ , ๐œƒ๐‘›}๐‘‡

๐œ•๐ธ(๐œƒ )

๐œ•๐œƒ =

๐œ•(๐‘ฆ ๐‘‡๐‘ฆ )

๐œ•๐œƒ โˆ’ 2(๐‘ฆ ๐‘‡๐ด)

๐‘‡+ [(๐ด๐‘‡๐ด) + (๐ด๐‘‡๐ด)

๐‘‡] ๐œƒ

Let:

๐œ•๐ธ(๐œƒ )

๐œ•๐œƒ = 0 ; ๐œƒ = ๐œƒ ฬ‚

Consider:

๐œ•(๐‘ฆ ๐‘‡๐ด๐‘ฅ )

๐œ•๐‘ฅ = ๐ด๐‘‡๐‘ฆ

Page 11: 1) Mamdani fuzzy model Sugeno fuzzy models

= 0 โˆ’ 2๐ด๐‘‡๐‘ฆ + [๐ด๐‘‡๐ด + ๐ด๐‘‡(๐ด๐‘‡)๐‘‡] ๐œƒ ฬ‚

โˆ’2๐ด๐‘‡๐‘ฆ + 2๐ด๐‘‡๐ด๐œƒ ฬ‚ = 0

๐ด๐‘‡๐ด๐œƒ ฬ‚ = ๐ด๐‘‡๐‘ฆ

(๐ด๐‘‡๐ด)โˆ’1

(๐ด๐‘‡๐ด) ๐œƒ ฬ‚ = (๐ด๐‘‡๐ด)

โˆ’1๐ด๐‘‡๐‘ฆ

๐œƒ ฬ‚ = (๐ด๐‘‡๐ด)โˆ’1

๐ด๐‘‡๐‘ฆ

๐œƒ ฬ‚ =๐ด๐‘‡๐‘ฆ

๐ด๐‘‡๐ด

Page 12: 1) Mamdani fuzzy model Sugeno fuzzy models

Example 3.1 (Jangโ€™s Book)

๐‘š = 7

Experiment Force (Newtons) Length of Spring (inches) 1 1.1 1.5 2 1.9 2.1 3 3.2 2.5 4 4.4 3.3 5 5.9 4.1 6 7.4 4.6 7 9.2 5.0

๐ฟ = ๐‘˜0 + ๐‘˜1๐น

{

๐‘˜0 + 1.1๐‘˜1 = 1.5๐‘˜0 + 1.9๐‘˜1 = 2.1

โ‹ฏ๐‘˜0 + 9.2๐‘˜1 = 5.0

๐ด๐œƒ ฬ‚ = ๐‘ฆ โˆ’ ๐‘’

[

1 1.51 2.1โ‹ฎ โ‹ฎ1 5.0

] [๐‘˜0

๐‘˜1] = [

๐‘ฆ1

๐‘ฆ2

โ‹ฎ๐‘ฆ7

] โˆ’ [

๐‘’1

๐‘’2

โ‹ฎ๐‘’7

]

๐œƒ ฬ‚ = [๐‘˜0

๐‘˜1] =

๐ด๐‘‡๐‘ฆ

๐ด๐‘‡๐ด

Use MATLAB (๐‘–๐‘›๐‘ฃ and .โˆ— operators)

Or, manually (since it is a 2x2 matrix) via:

[๐‘Ž ๐‘๐‘ ๐‘‘

]โˆ’1

=1

๐‘Ž๐‘‘ โˆ’ ๐‘๐‘[๐‘‘ โˆ’๐‘โˆ’๐‘ ๐‘Ž

]

๐œƒ ฬ‚ = [๐‘˜0

๐‘˜1] = [

1.200.44

]

๐ฟ = 1.20 + 0.40๐น