-----------
RUNNING
----------

* Java

In order to run HK from command line, you need Java installed. Please download
Java from java.sun.com and install it such that when you type "java -v" from
command line, you get a response.

Now you can run switch to the directory where hk.jar file resides, and execute

java -cp hk.jar org.boun.edu.hk.alg.EstimateStocksHmm /home/burak/DJI.txt 1 10 3
1 2000 1000 60 /home/burak/dj-

Here the runner program is EstimateStocksHmm. The data file is
/home/burak/DJI.txt, whose data column is its 1st column (where the price data
is found). Next, 10, is the number of hidden states for our HMM, 3 is the number
of Gaussian mixtures per state, 2000 is the day we start training, 1000 is the
size of the training window, 60 is the number of days we try to predict after
training is complete. Finally /home/burak/dj- is the output prefix, the
hard-coded output files will get that prefix prepended before that file name is
created. You can use this feature to place each test batch's output file in a
different folder.

Please take a look at the Bourne Shell "runner" scripts found under resources
folder if you need help preparing this java call.

The easiest method to run the estimator programs however, is downloading and
installing Ant, and then simply running "ant <targetname>" on the command line
in the directory where the build.xml file resides. There is a target prepared
for each estimator -HMM, Kalman and Random-, so you simply find the one you need in
build.xml file and use this target to run the estimator you want.

* Matlab NN

The estimator using neural network technology utilizes Netlab written by Chris
Bishop. Netlab is already downloaded and made part of this code release - you
can find it under src/matlab/netlab. Make sure Netlab path is added to Matlab's
PATH using Edit | Set Path. Then, to execute the estimator run "nrunner".

* Matlab Polynomial Estimator

A polynomial fitting based estimator can be found in src/matlab/nprunner.m and
polystock.m. In order to run it, simply type nprunner from Matlab command line. 

---------------------
Matlab <-> Java
------------------------

In order to call Kalman/HMM Java code from Matlab, you need to install JRE
1.2 from Sun. Then, use the target "ant compile-11" to generate a JRE 1.1
compatible Java jar file. All code in this source tree was written with JRE 1.1
in mind, so sorry, none of that "for (Bla bla : list) sorta new stuff!... :)
Unfortunately my Matlab only allowed this kind of old JRE integration, hence the
omission of Java 1.5 keywords.

Once Java JRE is installed, you need to introduce your jar file to Matlab. Go
into MATLAB/toolbox/local/classpath.txt file, and add the full path of your jar file
(C:/full/path/hk-11.jar) at the end. Restart Matlab. Now call javacall.m. 

