Matlab Functions




These functions were written primarily for illustrative purposes. Many are taken from and/or descrived in the material on principles and techniques. To my knowledge, they all work. However, few of them bother to detect errors, provide friendly advice, etc.. Moreover, I have used some inefficient computational procedures in order to make the algorithms easy to understand. In short, these functions may not be of full production quality . Despite these caveats, I have found them to be useful and thought others might also.

Each function is stored in a file with a .txt extension so as (hopefully) not to confuse the server or your browser. You may need to set your helper options (under general preferences in Netscape's browser) to have files with mime type text, mime subtype plain and extension txt viewed in the browser.

After viewing one of the functions, you may save it in a directory on your MATLAB path, using the same name and an .m extension. The function can then be used in any program. You can then also get its initial comment lines by issuing the command help, followed by the file name (e.g. help wcov).

The functions are listed below in alphabetic order. The date of the most recent version is also shown.

cnd Gets a probability from the cumulative normal distribution (Nov. 2, 1995)

f_stox Gets a time series in the TSI standard format. Used in the Time-Series Information System (Jan 15, 1996)

getfiles Loads files listed in a text file to the indicated file names (Nov. 20, 1995)

getsmat Gets a string matrix from an ASCII file. Used in the Time-Series Information System (Jan 15, 1996)

gqp Solves a standard asset allocation problem using the gradient algorithm (April 13, 1997)

mkdbd Makes a database directory. Part of the Time-Series Information System (Jan 15, 1996)

mkdbl Makes a database list. Part of the Time-Series Information System (Jan 15, 1996)

pmats  prints a matrix with titles for columns and rows

putl Puts a line on an ASCII output file (PC version). Used in the Time-Series Information System (Jan 15, 1996)

strsort Sorts a string matrix. Used in the Time-Series Information System (Jan 15, 1996)

tsi Gets a tsi series. Part of the Time-Series Information System (June 19, 1996)

wcov Computes a weighted covariance matrix and associated values (Nov. 2, 1995)