31.10.2014 Views

What Is Fuzzy Logic?

What Is Fuzzy Logic?

What Is Fuzzy Logic?

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

2 Tutorial<br />

At this point, you can use the optimization capability of anfis to improve the<br />

model. First, try using a relatively short anfis training (20 epochs) without<br />

implementing the checking data option, and then test the resulting FIS model<br />

against the testing data. To perform the optimization, type the following<br />

command:<br />

fismat2=anfis([datin datout],fismat,[20 0 0.1]);<br />

Here, 20 is the number of epochs, 0 is the training error goal, and 0.1 is the<br />

initial step size.<br />

This command returns the following result:<br />

ANFIS info:<br />

Number of nodes: 44<br />

Number of linear parameters: 18<br />

Number of nonlinear parameters: 30<br />

Total number of parameters: 48<br />

Number of training data pairs: 75<br />

Number of checking data pairs: 0<br />

Number of fuzzy rules: 3<br />

Start training ANFIS ...<br />

1 0.527607<br />

.<br />

.<br />

20 0.420275<br />

Designated epoch number reached --> ANFIS training completed at epoch 20<br />

After the training is done, validate the model by typing the following<br />

commands:<br />

fuzout2=evalfis(datin,fismat2);<br />

trnRMSE2=norm(fuzout2-datout)/sqrt(length(fuzout2))<br />

chkfuzout2=evalfis(chkdatin,fismat2);<br />

chkRMSE2=norm(chkfuzout2-chkdatout)/sqrt(length(chkfuzout2))<br />

These commands return the following results:<br />

2-152

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!