back start next


[start] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] [42] [43] [44] [45] [46] [47] [48] [49] [50] [51] [52] [53] [54] [55] [ 56 ] [57] [58] [59] [60] [61] [62] [63] [64] [65] [66] [67] [68] [69] [70] [71]


56

WHAT YOU MUST KNOW ABOUT FILTER OPERATION

We have already noted in the case of the low-pass fUter operation known as a moving average that there is a time lag to the output. This simply means that the latest data resulting from the fUter operation never reflects up-to-date events. Put another way, it means that current time filter output results depend on events which have not yet occurred.

This is an example of a general characteristic of aU numerical filters. To obtain precise knowledge, using a fUter, of the nattwe of the frequency content of data, you must sacrifice knowledge of how that spectrum is affected by recent data. In fact, the more precisely you construct a frequency filter to perform the function of separating

A numerical frequency filter behaves the same way. It separates that part of digital data which contains frequencies below a certain value from that part of the data which contains frequencies above that same value.

When a filter just separates data into two parts, it is known as a "cutoff filter. A moving average is a crude filter of this type as shown in the Appendix. The moving average process stops the passage of high frequencies (short periods), and permits the passage of low frequencies (long periods). Just as the size of the mesh in a sieve sets the separation point for granular material, so the span of a moving average sets the frequency separation point

But a sieve divides particles into two parts, large and small. The moving average seems to throw away high frequencies, while saving the lows. Recall now the "inverted" movuig average of Chapter Six. This is the numerical filter equivalent of the sieve process that allows retention of the small particles. The inverted average throws away the low frequencies and retains the highs. By using both the normal and the inverted moving average on data, the full function of the sieve is duplicated with regard to the frequency characteristics of data instead of the size characteristics of physical particles.

But filters can do even more than this. Suppose you used a sieve to separate sand into two piles. Then suppose you screened the with the largest particles, using a sieve with slightly larger holes. You would then have three pUes of sand. One of them contains ail grains smaDer than a certain size. The next contains all grains between this certain size and another larger one. The third contains all particles larger than those in the second pile.

These processes can also be dupUcated by frequency filters. The filtering process which produces results that Ue between two fixed bounds is called a band-pass filter operation, and is particularly useful in the analysis of stock price data. Such filters were employed to produce the results of Figures 11-13 and IX-4 and a good part of the results in the Appendix. Filters of this nature are an indispensable tool when you undertake research of the price motion of stocks.

The type of filter that passes low frequencies but not highs (a la a moving average) is called a low-pass filter. Similarly, a filter that passes high frequencies but not lows is called a high-pass filter. AU. three types, low-pass, band-pass, and high-pass, belong in your arsenal if you desire to research market data.



frequencies, the more time lag you must tolerate. A moving average is a rather poor instrument for frequency separation, and as a result it has a rather small time lag associated with it. Much more effective filters can be constructed and used, but only at the cost of increased lag.

Because of the minimal lag and reasonable frequency separation capability, the moving average is an acceptable compromise for use in the kind of real time, predictive analysis presented in previous chapters. In such work, the lag must be kept small, and a moving average does as good a job for its lag as any filter can do.

On the other hand, lag is not nearly as important as effective frequency separation when you arc rearching for helpful relationdiips in market data. Wenty of past information is available, and tests of applicability of results to the real-time situation can always come later.

To improve the frequency separation characteristics of a filter, you must increase the span of time it covers. With such an increase, the lag automatically increases, since it is, as for the moving average, half the span of the filter. Some of the filters described in the Appendix have time lap of many years!

When using filters you should become familiar with the term "frequency response." This is a characteristic which completely identifies and describes the effectiveness of a filter. Conceive of the numbers you derive via a filtering process as the output of the filter. Similarly, picture the stock price data on which the filter operates as tlie input to the filter. If you then divide the numbers of the output by the numbers of the input, the resulting quantity is called the "amplitude ratio." If a sine wave is present in the stock data of a given amplitude, and it is reproduced in the output at the same arapUtude, the amplitude ratio is one (for sine waves of that particular frequency). In short, the filter has not changed the amplitude-or has "passed" it intact.

Similarly, if a sine wave of a given ampHtude is present in the data but is completely non-existent (or of zero amphtude) in the filter output, the ampUtude ratio of the filter for that frequency is zero. Clearly, for the filter to perform its function of frequency separation the amplitude ratio of the filter must vary from 0.0 to 1.0, dependent on the frequency of the sine waves put into it.

There is another characteristic of frequency response with which we will not be overly concerned in this introduction, but of which you should be aware. This is called "phase response." Phase response is a measure of how much if any a filter operation changes the phase-time of a sine wave on which it operates. Thus, it is seen that a filter can modify an input sine wave both as to its amplitude and with respect to gliding it backward or forward in time.

The two quantities, amplitude rario and phase response, together make up the frequency response of a filter. These quantities vary as the frequency elements of the data input to the filter vary, and between them they completely describe the qualities and capabilities of a filter.

THE PART OF "WEIGHTS" IN NUMERICAL FILTERS

You have already learned how to design normal and inverted moving average filters in previous chapters. There is a very large number of ways in which more



effective numerical filters can be designed to maice them do what you want. The bibliography contains a broad sample of references to some of these. As an introduction to the subject and to get you started, the design criteria of just one class of these will be presented here. You will undoubtedly wish to follow up the references to develop more capability in this highly interesting field.

All such filters have one aspect in common. They use what are called "weights" to achieve the desired results.

Weights are simply numbers which are derived as a result of filter design. In applying a numerical filter, you simply multiply each weight by the proper stock price datum and sum up these products to obtain the filter output. Determination of the number and precise value of these weights in order to achieve the needed filtering results is the object of filter design work.

This is true even in the case of a moving average, although the usual process of moving average appUcation masks this fact. Recall that to cause a moving average to do what you want it to do, you set a cutoff frequency by selection of the span of the avera. Suppose the resulting average utilizes " " data points. The process of forming the latest possible moving average output consists of summing up the last "N" stock prices, then dividing by "N." This is precisely equivalent to the more arduous task of dividing each of the last " /" stock prices by "N" and summing up these fractions. This, in turn, is the same as multiplying each of the last "N" stock prices by-and summing results. From this it is seen that a moving average simply uses constant weights. Each weight has a value of

If you plot these moving average weights in the chronological order of the stock prices to which they are applied, the result is a square wave. In essence, all price data prior to the Ath one before the last are multiphed by zero. All price data from the

ATth one to the last one are multiplied byj. All future prices are likewise not involved

in the average, or are effectively multiplied by zero. The resulting square wave youve plotted is the so-called "weighting function" of a moving average.

The four square corners of this weighting function cause many of the adverse characteristics of a moving average (which are discussed in the Appendix). To improve the characteristics, these must be rounded in a particular manner. The following design criteria accomplish this, resulting in one specific class of numerical filters suitable for research work.

HOW TO DESIGN YOUR OWN NUMERICAL FILTERS

The design presented here is one of several developed and discussed by Joseph F. A. Ormsby in a paper dated March, 1960 (see bibliography for details).

The techniques of this paper have been combined to form band-pa design criteria in this example, since this will be of the most use to you. The reference will provide you directiy with the corresponding low- and high-pass filter designs.

There are several decisions that you must make before you can start a design.

First of all you must decide the time spacing you are going to use for your stock price data. This will become a design parameter of your filter, and that particular filter must always be appUed against stock data of the same time pacing.



[start] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] [42] [43] [44] [45] [46] [47] [48] [49] [50] [51] [52] [53] [54] [55] [ 56 ] [57] [58] [59] [60] [61] [62] [63] [64] [65] [66] [67] [68] [69] [70] [71]