Class curve_plot_test


class curve_plot_test
extends java.lang.Object

Generate histograms for the Haar coefficients created by applying the Haar transform to the time series for the Applied Materials (symbol: AMAT) daily close price. Plot the histograms along with a normal curve with a mean and standard deviation calculated from the coefficients.

There are 512 data points in the AMAT daily close price time series. This program generates a histogram for the first three high frequency sets of coefficients (e.g., 256, 128, and 64 coefficients).

Financial theory states that the average daily return (e.g, the difference between today'ss close prices and yesterday's close price) is normally distributed. So the histogram of the highest frequency coefficients, which reflect the difference between two close prices, should be bell curve shaped, centered around zero.

The close price in the AMAT time series rises sharply about half way through. So as the coefficient frequency decreases, the histogram will be shifted farther and farter away from zero.

Note that an inplace Haar transform is used that replaces the values with the coefficients. The order function orders the coefficients from the butterfly pattern generated by the inplace algorithm into increasing frequencies, where the lowest frequency is at the beginning of the array. Each frequency is a power of two: 2, 4, 8, 16, 32, 64, 128, 256.

Inner Class Summary
 class curve_plot_test.plot_log
           Write out the log of the close price.
Constructor Summary
(package private) curve_plot_test()
Method Summary
static void main(java.lang.String[] args)
 void plot_log(double[] v)
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait

Constructor Detail


Method Detail


public void plot_log(double[] v)


public static void main(java.lang.String[] args)