Matlab Programming
MATLAB Programming
OPERATORS
Relational Operators
Operator
Description
<
Less than
<=
Less than or equal to
>
Greater than
>=
Greater than or equal to
=
Equal to
~=
Not equal to
Relational Operators
> x=[1 5 4 2]
x =
1
5
4
2
> ind=x>2
i

Python Programming
Introduction
Currently available in 3.4 and 2.7
Anacoda: free Python distribution
It includes over 195 of the most popular Python packages for science,
math, engineering, data analysis.
continuum.io/downloads
Introduction
Python as a

Assignment 06
Deliver the work in ALL MATLAB, Python, and R with the same data as in the
sample code. You however save the data in an Excel workbook and your code
should read data from it.
1. (2.5 points) Derive and code the DEA constrained optimization p

Assignment 07
Deliver the work in ALL MATLAB, Python, and R.
Consider using all European-style options for the following questions.
1. (2.5 points) Write a function to compute the value of a bull spread
a. (1.25 points) Using calls (long a call with strik

Assignment 5
Deliver the work in ALL MATLAB, R, and Python with randomly generated data.
You should decide the parameters on your own (In MATLAB, DO NOT use high
level functions such as frontcon, frontopt, and portcons).
1. (1.5 points) Write code that ma

Assignment 01
Code the following in MATLAB
The Yahoo Finance API can be used to returns stock price data for a given
symbol. In this example, YHOO daily price from 4/13/2009 to 1/28/2010 is
requested.
http:/ichart.finance.yahoo.com/table.csv?s=YHOO&d=0&e=

Assignment 02
Code the following in Python
The Google Finance API can be used to get stock price data for a given symbol
at higher sampling rate than just daily frequency. In this example, YHOO prices
from for 15 days with interval of 300 seconds are requ

Projects
A. Project Ideas
You can apply any technique you learned so far, and any combination of them, or tweak
them, etc.
Examples:
a. Use DEA - linear programming to form a portfolio that contains efficient
stocks/bonds and adjust it daily/weekly
b. For

Assignment 04
Code the following in Python on Quantopian framework
You are given the Fourier Transform based Python code that modifies the Basic
Trading Strategy running on Quantopian framework. Try it on Quantopian
framework to see how it outperforms the

Assignment 04
Code the following in SAS IML
(5 points) Write a function that takes 1 matrix X, and return the covariance and
correlation matrices. Do not use high-level SAS functions. Write some code
that calls the function that you created, passes a matr

Assignment 03
Code the following in R
(5 points) Write a function that takes 1 matrix X, and return the covariance and
correlation matrices. Do not use high-level R functions. Write some code that
calls the function that you created, passes a matrix (with

Assignment 02
Code the following in Python
(5 points) Write a function that takes 1 matrix X, and return the covariance and
correlation matrices. Do not use high-level Python functions such as numpy.cov
and numpy.corrcoef functions. Write some code that c

Assignment 04
Code the following in SAS IML
(5 points) Write a function that takes 1 matrix X, and return the covariance and
correlation matrices. Do not use high-level SAS functions. Write some code
that calls the function that you created, passes a matr

Assignment 01
Code the following in MATLAB
(5 points) Write a function that takes 1 matrix X, and return the covariance and
correlation matrices. Do not use high-level MATLAB functions such as cov and
corr functions. Write some code that calls the functio

Assignment 03
Code the following in R
(5 points) Write a function that takes 1 matrix X, and return the covariance and
correlation matrices. Do not use high-level R functions. Write some code that
calls the function that you created, passes a matrix (with

Assignment 02
Code the following in Python
(5 points) Write a function that takes 1 matrix X, and return the covariance and
correlation matrices. Do not use high-level Python functions such as
numpy.cov and numpy.corrcoef functions. Write some code that c

Assignment 01
Code the following in MATLAB
(5 points) Write a function that takes 1 matrix X, and return the covariance and
correlation matrices. Do not use high-level MATLAB functions such as cov and
corr functions. Write some code that calls the functio

Assignment 03
Code the following in R
The Google Finance API can be used to get stock price data for a given symbol
at higher sampling rate than just daily frequency. In this example, YHOO prices
from for 15 days with interval of 300 seconds are requested