Образователни технологии

FUZZY LOGIC

Отворен достъп

Резюме. There are four backbones to analyze time-series in general and forecast time-series for financial markets: Chaos-theory, Fuzzy logic, Neural networks and Genetic algorithms. The first one is considered in (Magenreuter, 2016a), while te third one in (Magenreuter, 2016b). The present paper is dedicated to the second one analyzing posibilities for its application. Some results are discussed in promising outcomes.

Ключови думи: financial market, time-series, fuzzy logic, forecasting

1. Introduction. “Type of reasoning is based on the recognition that logical statements are not only true or false (white or black areas of probability) but can also range from ‘almost certain’ to ‘very unlikely’ (gray areas of probability). Software applying fuzzy-logic (as compared with that based on Formal Logic) allows computers to mimic human reasoning more closely, so that decisions can be made with incomplete or uncertain data. The concept is based on the work of the Polish mathematician Jan Lukasiewicz (1878 – 1956) and was developed by the Azerbaijani-Iranian computer scientist Dr. Lotfi A. Zadeh (born 1921) who coined the term ‘fuzzy logic’ in 1965 while working at the Berkeley campus of the University of California.” (source: business dictionary)

It was Prof. Lotfi Zadeh who has found, that humans can handle fuzzy sets much easier, than the conventional set theory of Georg Cantor, because it can handle and process imprecise data. Fuzzy Logic has become popular due to its success in industrial applications, particularly in Japan.

Terms like ‘a little bit less’, ’a little bit more’, approximately all, very positive, positive, neutral, negative and very negative are for us humans easy to express. Technical applications with tasks of regulations cannot be imagined without Fuzzy sets anymore. Each modern washing machine or camera cannot be thought without a fuzzy logic control chip.

Example 1: Bob is 65 years old. Is Bob old? In Boolean logic (True or False). In Fuzzy logic (False, True or degree of oldness).

Many events or facts have such fuzzy truth values, like:

– How big does a pond have to be to qualify as a lake?

– How much of an apple do you have to eat for what is left to no longer count as an apple?

– How broken has a ship to be in order to be called a wreck?

– What amount of hair loss categorizes you as bald?

Example 2 \({ }^{2}\) : In a traditional bivalent logic system an object either is or is not a member of a set. The idea of fuzzy sets is that the members are not restricted to true or false definitions. A member in a fuzzy set has a degree of membership to the set. For example, the set of temperature values can be classified using a bivalent set as either hot or not hot. This would require some cut-off value where any temperature greater than that the cut-off value is ‘hot’ and any temperature less than that value is ‘not hot’. If the cut off point is at \(50^{0} \mathrm{C}\) then this set does not differentiate between a temperature that is \(20^{\circ} \mathrm{C}\) and a temperature of \(49^{\circ} \mathrm{C}\). They are both ‘not hot’

2. Mathematical background. More than 50 years old denotes a crisp set standard set \(=\) characteristic function. In classical mathematics one deals with collections of objects called (crisp) sets. Sometimes it is convenient to fix some universe \(U\) in which every set is assumed to be included. It is also useful to think of a set \(A\) as a function from \(U\) which takes value 1 on objects which belong to \(A\) and 0 on all the rest. Such function is called the characteristic function of \(A\), \(\chi \mathrm{A}: \chi \mathrm{A}(x)=\operatorname{def}(1\) if \(x \in A\) and 0 if \(x \notin A\) ) ). So there exists a bijective correspondence between characteristic functions and sets.

Let \(X\) be the set of all real numbers between 0 and 10 and let \(A=[5,9]\) be the subset of \(X\) of real numbers between 5 and 9. This results in the following figure:

O591x

Fuzzy sets generalize this definition, allowing elements to belong to a given set with a certain degree. Instead of considering characteristic functions with value in \(\{0,1\}\) we consider now functions valued in \([0,1]\). A fuzzy subset \(F\) of a set \(X\) is a function \(\mu \mathrm{F}(x)\) assigning to every element \(x\) of \(X\) the degree of membership of \(x\) to \(F: x \in X \rightarrow \mu \mathrm{~F}(x) \in[0,1]\).

Let, as above, \(X\) be the set of real numbers between 1 and 10. A description of the fuzzy set of real numbers close to 7 could be given by the following figure:

O195x

In classical set theory there are some basic operations defined over sets. Let \(X\) be a set and \(P(X)\) be the set of all subsets of \(X\) or, equivalently, the set of all functions between \(X\) and \(\{0,1\}\). The operation of union, intersection and complement are defined in the following ways:

\[ \begin{aligned} & A \cup B=\{x \mid x \in A \text { or } x \in B\}, \text { i.e. } \chi A \cup B(x)=\max \{\chi \mathrm{A}(x), \chi \mathrm{B}(x)\} \\ & A \cap B=\{\mathrm{x} \mid x \in A \text { and } x \in B\}, \text { i.e. } \chi \mathrm{A} \cap B(x)=\min \{\chi \mathrm{A}(x), \chi \mathrm{B}(x)\} \\ & A^{\prime}=\{x \mid x \notin A\}, \text { i.e. } \chi \mathrm{A}^{\prime}(x)=1-\chi \mathrm{A}(x) \end{aligned} \]

The law \(\chi \mathrm{A} \cup B(x)=\max \{\chi \mathrm{A}(x), \chi \mathrm{B}(x)\}\) gives us an obvious way to generalize union to fuzzy sets. Let \(F\) and \(S\) be fuzzy subsets of \(X\) given by membership functions \(\mu \mathrm{F}\) and \(\mu \mathrm{S}\) :

O195x9x5O14

We set µF ∪S(x) = max{µF (x), µS(x)}.

9x5O14

Analogously for intersection: \(\chi \mathrm{A} \cap B(x)=\min \{\chi \mathrm{A}(x), \chi \mathrm{B}(x)\}\). We set

\[ \mu \mathrm{F} \cap S(x)=\min \{\mu \mathrm{F}(x), \mu \mathrm{S}(x)\} . \]

Finally the complement for characteristic functions is defined by,

\[ \begin{gathered} \chi \mathrm{A}^{\prime}(x)=1-\chi \mathrm{A}(x) . \text { We set } \\ \mu \mathrm{F}^{\prime}(x)=1-\mu \mathrm{F}(x) \end{gathered} \]

Let us go back for a while to operations between sets and focus on intersection. We defined operations between sets inspired by the operations on characteristic functions. Since characteristic functions take values over \(\{0,1\}\) we had to choose an extension to the full set \([0,1]\). It should be noted, though, that also the product would do the job, since on \(\{0,1\}\) they coincide:

\[ \chi \mathrm{A} \cap B(x)=\min \{\chi \mathrm{A}(x), \chi \mathrm{B}(x)\}=\chi \mathrm{A}(x) \cdot \chi \mathrm{B}(x) . \]

So our choice for the interpretation of the intersection between fuzzy sets was a little illegitimate. Further we have \(\chi \mathrm{A} \cap B(x)=\min \{\chi \mathrm{A}(x), \chi \mathrm{B}(x)\}=\max \{0, \chi \mathrm{~A}(x)\) \(+\chi \mathrm{B}(x)-1\}\). It turns out that there is an infinity of functions which have the same values as the minimum on the set \(\{0,1\}\). This leads to isolate some basic property that the our functions must enjoy in order to be good candidate to interpret the intersection between fuzzy sets.

3. Mathematical representation. Let \(V\) be the universe under consideration. A fuzzy set \(A\) is represented by a function \(\mu \mathrm{A}: V \rightarrow[0,1]\).

\(+\mu \mathrm{A}\) is called the membership function;

\(+\mu \mathrm{A}(x)\) is called the grade of membership of \(x\) w.r.t. \(A\);

\(+\mu \mathrm{A}(x)\) is also called the degree of truth of the proposition that \(x\) is an element of \(A\);

\(+\{x \in V: \mu \mathrm{A}(x) \gt 0\}\) is called the support of \(A\).

It is simple to provide analytic expressions that give a (stepwise) linear approximation to the three membership functions:

Figure. Membership function

“The justification of degrees of truth/membership is a weak point of fuzzy logic.

– Justification of degrees of beliefs in terms of betting behavior (fair bets). However, we cannot bet on fuzzy expressions: – I bet you \(\$ 5\) that the patient is older than \(30-\) ?? I bet you \(\$ 5\) that the patient is old.

– In some sense, fuzzy logic makes a vague expression too precise by insisting on a numerical description.

– For atomic sentences it may be a reasonable strategy to ask a large number of people what they think of a proposition like “this person is old” and take the average.

– However, this cannot work for compound sentences since frequencies do not behave truth-functionally.

– In fuzzy control the problem is different: start with discrete values and fuzzify it. E.g. 45 for age can be mapped on the set \(\{0,0.2,1,0,2,0\}\) corresponding to the fuzzy sets {very young, young, middle aged, old, very old}” (cf. Blunter).

As mentioned above, we may use fuzzy logic to pre-process a huge amount of financial data in form of up to 240 time-series, which act as indicators correlated to the desired target. The point of view is, that this is the adequate technique, to capture data, which are related to the others, to their environment.

If we drive by car with \(60 \mathrm{~km} / \mathrm{h}\) on a highway on the left line, where \(120 \mathrm{~km} / \mathrm{h}\) is allowed, we drive much too slow, if there is not a construction site. If we drive by car with \(60 \mathrm{~km} / \mathrm{h}\) on a playstreet, where only \(30 \mathrm{~km} / \mathrm{h}\) are allowed, we drive much too fast. In both cases we drive absolute viewed \(60 \mathrm{~km} / \mathrm{h}\), but if we put this absolute value in relation to its environment, we can describe the value \(60 \mathrm{~km} / \mathrm{h}\) much more correct in its effect.

4. Popular Examples. Famous are the Metros in Sendai and later in Tokyo, where the start, accelerate and brake regulation is achieved very smooth. Since there are many successful applications in process control tasks in the industry, there are other interesting experiments with financial market data. Very easy an expert can e.g. develop a rule based trading or buy and sell decision system. Like: if the 2 year yield of US bonds last week fell quite a lot, the stock prices correlated to bonds will fall within the next two weeks moderately. The amount of such correlations is limited only by the computing power and a good or less good programmed software.

Figure. Scheme of a fuzzy regulation control system

Following is a descriptive task, which the fuzzy set method can deal with quite easily:

Given is the set of swimmers and a set of golfers, which members are all living in one apartment house. One estimates with how much percent one set is within another set:

TINAMIKEGREGSUETOGETHERSwimmer0,80,70,90,22,6Golfer00,90,40,82,1Both00,70,40,21,3

According to that, there are 2,6 Swimmers, 2,1 Golfers and 1,3 people, who are both. Thus 1,3 of swimmers are golfers, swimmers are 1,3|2,6, or 0,5, a subset of golfers. Equally 1,3 of the 2,1 golfers are swimmers, this golfers are for 1,3|2,1, or 0,62 a subset of swimmers.

This concept extents the fundament, on which fuzzy logic is based on. It shows, that principles which master a variety of sets, regulates the individual grade of membership, as well. The limits of fuzziness extend (Kosko, 1986).

“The basic fuzzy logic control system is composed of a set of input membership functions, a rule-based controller, and a defuzzification process. The fuzzy logic input uses member functions to determine the fuzzy value of the input. There can be any number of inputs to a fuzzy system and each one of these inputs can have several membership functions. The set of membership functions for each input can be manipulated to add weight to different inputs. The output also has a set of membership functions. These membership functions define the possible responses and outputs of the system. The fuzzy inference engine is the heart of the fuzzy logic control system. It is a rule based controller that uses If-Then statements to relate the input to the desired output. The fuzzy inputs are combined based on these rules and the degree of membership in each function set. The output membership functions are then manipulated based on the controller for each rule. Several different rules will usually be used since the inputs will usually be in more than one membership function. All of the output member functions are then combined into one aggregate topology. The defuzzifaction process then chooses the desired finite output from this aggregate fuzzy set. There are several ways to do this such as weighted averages, centroids, or bisectors. This produces the desired result for the output.”2

5. Another example.

All oak trees wear acorns.

This tree wears acorns.

This tree is an oak tree.

The most people will agree to the above logical inherence than to the following:

All basketball professionals are very tall.

Bob is very tall.

Bob is a basketball professional.

Both examples are in its logical structure identical, but our knowledge about the background/environment is different. Only oak trees wear acorns. However, we know many tall men, who are no basketball professionals, why many counterexamples come us to mind: The knowledge dominates the conclusion in our all day life.

As explained, the fuzzy logic set analysis method can be applied to many different tasks and scientific research fields. We use fuzzy logic for pre-processing my financial time-series. All data of the desired time-series and all indicators are correlated within a ‘fuzzy-matrix’. Simply explained: data point of indicator 1 at time \(t_{0}\) correlates very negative to target point at time \(t_{0}+12\) (12 step ahead forecast), data point of indicator 2 at time \(t_{0}\) correlates positive to target point at time \(t_{0}+12\) (12 step ahead forecast) and so on. In our explorations we use up to 240 fundamental indicators which are correlated in this way. And, they are not only correlated to the target, they are inter-correlating, as well! Similar it is with financial markets: a Euro/Dollar parity of 1.1160 as indicator for the S&P 500 index, Friday last week, has another impact to the S&P 500, if it ends exactly with the same value, 1.1160, this Friday, because the environment has changed!

So far as the laws of mathematics refer to reality, they are not certain. And so far as they are certain, they do not refer to reality. ’’

(Albert Einstein, 1921)

NOTES

1. Dr. rer. nat. habil. Reinhard Blunter, PhD in Theoretical High Energy Physics, Course at University of Amsterdam.

2. A Time-Varying Harmonic Distortion Diagnostic Methodology Using Fuzzy Logic, Bryan Klingenberg, Student Member of IEEE 2.

REFFERENCES

Magenreuter, R. (2016a). Forecasting of time-series for fianncial markets. Mathematics and Informatics, 59 (5).

Magenreuter, R. (2016b). Neural networks. Mathematics and Informatics, 59 (5).

Bart, K. (1986). Fuzzy Entropy and Conditioning. Information Sciences, 40, pp.165 – 174.

Grozdev, S. (2007). For high achievements in mathematics. The Bulgarian experience (Theory and practice). Sofia: ADE.

Година LIX, 2016/6 Архив

стр. 657 - 664 Изтегли PDF