Send
Close Add comments:
(status displays here)
Got it! This site "robinsnyder.com" uses cookies. You consent to this by clicking on "Got it!" or by continuing to use this website. Note: This appears on each machine/browser from which this site is accessed.
Regression, neural networks, and fuzzy approximation
1. Simple linear regression
In simple linear regression, one fits a regression line to data consisting of an independent variable and a dependent variable.
2. Many ways
There are many ways of doing such forecasting.
simple linear regression
neural networks
fuzzy approximation
3. User-written software
"Regress" for multiple-linear regression.
"Fuzzies" for fuzzy approximation.
"Neurals" for neural networks.
Excel Add-In
kithara.xla written in
VBA (Visual Basic for Applications) to handle spreadsheet output of the above programs.
4. Regress
5. Fuzzies
6. Neurals
7. The TV problem
Is there a relationship between TV size and TV price?
If so, what is the nature of that relationship?
Can the relationship be modeled with a straight line?
8. Raw data
The raw data consists of the diagonal size of a TV in inches and the price in dollars.
Size Price Size Price Size Price
13 169 20 278 27 498
13 178 20 219 27 598
13 139 25 347 31 697
19 199 25 299 32 699
19 188 25 299 32 1099
19 238 27 467 50 1999
9. Simple linear regression
Simple linear regression fits a straight line to the data.
10. Annotations
Annotations can be added to the chart.
11. Regress software
For more involved regression problems, specialized regression software is needed.
The "
Regress" software system is designed to solve regression problems involving multiple independent variables while producing output suitable for a spreadsheet.
The essential part of the "
Regress" software specification is as follows.
12. Regress specification
regress price(size)
when data(size,price) is
13 169
// ... data omitted ...
50 1999
and predict
price(0)
// ... predictions omitted ...
price(60)
end
13. Regress output
The output includes the regression equation as follows.
price =
+-671.606
+ 47.366 * size
14. Fuzzy logic
Fuzzy logic is often used for process control applications where continual adaptation to changing conditions is required Klir, G., & Yuan, G. 1995. Fuzzy sets and fuzzy logic. Upper Saddle River, NJ: Prentice-Hall...
In general, fuzzy approximation can be used to approximate arbitrary functions Kosko, B. (1992). Neural networks and fuzzy systems. Englewood Cliffs, NJ: Prentice-Hall...
15. Fuzzies software
The "
Fuzzies" software system is designed to facilitate fuzzy approximation while producing output suitable for a spreadsheet Snyder51..
The essential part of the "
Fuzzies" software specification is as follows.
16. Fuzzy size
fuzzy size is "TV size" in "inches"
with sets
small . 15.0 20.0 ;
medium 15.0 20.0 50.0 ;
large 20.0 50.0 . ;
17. Fuzzy sets for size
18. 3-D view
19. Fuzzy price
fuzzy price is "TV price" in "$"
with sets
cheap . 200.0 500.0 ;
reasonable 200.0 500.0 1700.0 ;
expensive 500.0 1700.0 . ;
20. Fuzzy sets for price
21. 3-D view
22. Fuzzy rules
rules
if size is small then price is cheap;
if size is medium then price is reasonable;
if size is large then price is expensive;
23. Rule#1
If size is small then price is cheap.
24. Rule#2
If size is medium then price is reasonable.
25. Rule#3
If size is large then price is expensive.
26. Overlap
The rule overlaps form patches.
27. Fuzzy predictions
determine
price when size is 10.0 ;
// ... predictions omitted ...
price when size is 60.0 ;
end
28. Predictions
29. Predictions and patches
30. Patches and approximation
31. Fuzzy and crisp logic
Although the sets are fuzzy, the inputs and outputs are crisp values.
The centroid method, or center of mass method, is used in the defuzzification process.
32. Getting a good fit
The fuzzy sets and/or rules can always be adjusted to achieve a better fit.
Neural networks can be used to find a good fit.
33. Neural networks
Artificial neural networks are often used for pattern recognition and/or categorization Fu, L. (1994). Neural networks in computer intelligence. New York: McGraw-Hill.., Skapura, D. (1996). Building neural networks. Reading, MA: Addison-Wesley...
Neural networks are created by a training process using representative samples rather than being programmed directly.
In the forecasting problem, the neural network is to learn one or more dependent values for a given independent value.
34. Neural networks
A neural network is represented as a set of neurons arranged in layers with weighted connections.
35. Neural network
Input trigger the connections such that an output is generated.
36. Neurals software
The "
Neurals" software system is designed to facilitate the training and creation of neural networks while producing output suitable for a spreadsheet Snyder42., Snyder53..
The "
Neurals" software uses the backpropagation training method and the bipolar sigmoid activation function.
The essential part of the "
Neurals" software specification is as follows.
37. Neurals table
neural network
table tv "TV data"
with fields
size integer "Size" ;
price integer "Price" ;
38. Neurals topology
topology
input nodes:
S = size scaled from 10 to 55 ;
hidden nodes: 3 ;
output nodes:
P = price scaled from 150 to 2100 ;
39. Neurals options
options
learning rate = 0.3 ;
activation threshold = 0.8 ;
momentum = 0.8 ;
max training cycles = 800 ;
40. Neurals data
training data
13 169
// ... data omitted ...
50 1999
test data
10 .
// ... predictions omitted ...
60 .
end
41. Neurals output
The "Neurals" output includes a working neural network spreadsheet that can be copied and pasted into an Excel worksheet so that the user can dynamically fill in the inputs and see the resulting outputs.
One can see exactly what the model does, from a spreadsheet formula point of view, but it is not usually intuitively clear how it does, in fact, work.
42. Excel Add-In
An Excel Add-In can be run on this spreadsheet to generate a neural network diagram as a chart and a neural network dialog box that provides a convenient interface to the working spreadsheet model.
43. Comparisons
44. Comparisons
The simple linear regression predicts that as the screen size becomes smaller, a company will pay you to take the TV. This is just not the case.
Forcing the y-intercept through 0.0 is one way to deal with this problem.
Notice how the neural network and fuzzy models adapt to the non-linearities in the model.
45. Models
In simple linear regression, we had to hypothesize a model and fit the data to the model.
The neural network approach takes the data and fits a model to the data. The problem is to find representative training data with which to train the neural network.
46. Approximations
The fuzzy approximation appears not to be as good an approximation to the raw data as the neural network model.
The fuzzy sets and/or rules can always adjusted to get a better approximation, at the cost of more details.
A neural network can be used to adjust the fuzzy sets and/or rules to achieve the desired approximation.
47. The future
Of course, one forecast that is difficult to make at this time is how soon the traditional cathode-ray TV will disappear due to the rapidly improving thin-screen technology.
48. End of page