<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>MA3245 Financial Mathematics</title>
	<atom:link href="http://ma3245.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://ma3245.wordpress.com</link>
	<description>an introduction to option pricing</description>
	<lastBuildDate>Fri, 15 Mar 2013 05:53:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='ma3245.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/53aa0038fc10acaf35d4a1c83946f16c?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>MA3245 Financial Mathematics</title>
		<link>http://ma3245.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://ma3245.wordpress.com/osd.xml" title="MA3245 Financial Mathematics" />
	<atom:link rel='hub' href='http://ma3245.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Black-Scholes Formula</title>
		<link>http://ma3245.wordpress.com/2013/03/11/black-scholes-formula/</link>
		<comments>http://ma3245.wordpress.com/2013/03/11/black-scholes-formula/#comments</comments>
		<pubDate>Mon, 11 Mar 2013 03:56:31 +0000</pubDate>
		<dc:creator>matkcy</dc:creator>
				<category><![CDATA[Matlab]]></category>

		<guid isPermaLink="false">http://ma3245.wordpress.com/?p=203</guid>
		<description><![CDATA[MATLAB has a built-in function erf that evaluates the error function: . A simple calculation shows that , where is the cumulative distribution function for the standard normal variable. The matlab function below calculates the Black-Scholes European call price: where &#8230; <a href="http://ma3245.wordpress.com/2013/03/11/black-scholes-formula/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ma3245.wordpress.com&#038;blog=46506911&#038;post=203&#038;subd=ma3245&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>MATLAB has a built-in function <code>erf</code> that evaluates the error function:</p>
<p><img src='http://s0.wp.com/latex.php?latex=%5Ctextnormal%7Berf%7D%28z%29+%3D+%5Cfrac%7B2%7D%7B%5Csqrt%7B%5Cpi%7D%7D+%5Cint_%7B0%7D%5E%7Bz%7D+e%5E%7B-s%5E%7B2%7D%7D+%5C%2C+ds&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='&#92;textnormal{erf}(z) = &#92;frac{2}{&#92;sqrt{&#92;pi}} &#92;int_{0}^{z} e^{-s^{2}} &#92;, ds' title='&#92;textnormal{erf}(z) = &#92;frac{2}{&#92;sqrt{&#92;pi}} &#92;int_{0}^{z} e^{-s^{2}} &#92;, ds' class='latex' />.</p>
<p>A simple calculation shows that</p>
<p><img src='http://s0.wp.com/latex.php?latex=N%28x%29+%3D+%5Cfrac%7B1%7D%7B2%7D%5Cleft%281%2B%5Ctextnormal%7Berf%7D%28x%2F%5Csqrt%7B2%7D%29%5Cright%29&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='N(x) = &#92;frac{1}{2}&#92;left(1+&#92;textnormal{erf}(x/&#92;sqrt{2})&#92;right)' title='N(x) = &#92;frac{1}{2}&#92;left(1+&#92;textnormal{erf}(x/&#92;sqrt{2})&#92;right)' class='latex' />,</p>
<p>where <img src='http://s0.wp.com/latex.php?latex=N%28%5Ccdot%29&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='N(&#92;cdot)' title='N(&#92;cdot)' class='latex' /> is the cumulative distribution function for the standard normal variable.</p>
<p>The matlab function below calculates the Black-Scholes European call price:</p>
<p><img src='http://s0.wp.com/latex.php?latex=c%28S%2CK%2CT%29+%3D+SN%28d_%7B%2B%7D%29-Ke%5E%7B-rT%7DN%28d_%7B-%7D%29&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='c(S,K,T) = SN(d_{+})-Ke^{-rT}N(d_{-})' title='c(S,K,T) = SN(d_{+})-Ke^{-rT}N(d_{-})' class='latex' /></p>
<p>where <img src='http://s0.wp.com/latex.php?latex=S&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='S' title='S' class='latex' /> is the current underlying (non-dividend paying) stock price, <img src='http://s0.wp.com/latex.php?latex=K&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='K' title='K' class='latex' /> is the strike price, <img src='http://s0.wp.com/latex.php?latex=T&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='T' title='T' class='latex' /> is the time to maturity, and</p>
<p><img src='http://s0.wp.com/latex.php?latex=d_%7B%5Cpm%7D+%3D+%5Cfrac%7B1%7D%7B%5Csigma+%5Csqrt%7BT%7D%7D+%5Cleft%28%5Cln%28S%2FK%29%2B%28r%5Cpm+%5Csigma%5E%7B2%7D%2F2%29T%5Cright%29.&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='d_{&#92;pm} = &#92;frac{1}{&#92;sigma &#92;sqrt{T}} &#92;left(&#92;ln(S/K)+(r&#92;pm &#92;sigma^{2}/2)T&#92;right).' title='d_{&#92;pm} = &#92;frac{1}{&#92;sigma &#92;sqrt{T}} &#92;left(&#92;ln(S/K)+(r&#92;pm &#92;sigma^{2}/2)T&#92;right).' class='latex' /></p>
<p><strong>EuCall_BS.m</strong></p>
<pre class="brush: matlabkey; title: ; notranslate">
function price=EuCall_BS(S, K, T, r, sigma)
% EuCall_BS(S,K,T,r,sigma) 
% calculates Black-Scholes call price (no dividends)
% S0=spot asset price
% K=strike price
% T=time to maturity
% r=risk-free rate
% sigma=volativity

d1=(log(S./K)+(r+0.5*sigma^2).*T)./(sigma*sqrt(T));
d2=d1-sigma*sqrt(T);
N1=0.5*(1+erf(d1/sqrt(2)));
N2=0.5*(1+erf(d2/sqrt(2)));

price=S.*N1-K*exp(-r.*T).*N2;

</pre>
<br />  <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ma3245.wordpress.com&#038;blog=46506911&#038;post=203&#038;subd=ma3245&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ma3245.wordpress.com/2013/03/11/black-scholes-formula/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c939517ec889b9317c98790937da243b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">timcyku</media:title>
		</media:content>
	</item>
		<item>
		<title>CRR American put price</title>
		<link>http://ma3245.wordpress.com/2013/03/11/crr-american-put-price-2/</link>
		<comments>http://ma3245.wordpress.com/2013/03/11/crr-american-put-price-2/#comments</comments>
		<pubDate>Mon, 11 Mar 2013 03:50:20 +0000</pubDate>
		<dc:creator>matkcy</dc:creator>
				<category><![CDATA[Matlab]]></category>

		<guid isPermaLink="false">http://ma3245.wordpress.com/?p=238</guid>
		<description><![CDATA[The MATLAB function below calculates the American put price under CRR binomial model. AmPut_CRR.m<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ma3245.wordpress.com&#038;blog=46506911&#038;post=238&#038;subd=ma3245&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>The MATLAB function below calculates the American put price under CRR binomial model. </p>
<p><strong>AmPut_CRR.m</strong></p>
<pre class="brush: matlabkey; title: ; notranslate">
function price = AmPut_CRR(S0, K, T, r, sigma, n)
% AmPut_CRR(S0, K, T, r, sigma, n)
% S0=spot price
% K = strike price
% T = time to maturity
% r = risk-free rate (per annum continuously compunded)
% sigma = volatility
% n = number of time-steps in the CRR binomial model

dt = T/n;
u = exp(sigma*sqrt(dt));
d=1/u;
p = (exp(r*dt)-d)/(u-d);
q = 1-p;
D=exp(-r*dt);
% Initialization
V = zeros(n+1,1);

% Stock price dynamics at maturity
S=S0*d.^([n:-1:0]').*u.^([0:n]');

% Option values at time T
V = max(K-S,0);

% Backward induction
for i = n:-1:1 % time index
for j = 1:i
S(j)=S(j)*u; 
V(j) = max((p*V(j+1) + q*V(j))*D, K-S(j)) ;
end
end

price = V(1);

</pre>
<br />  <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ma3245.wordpress.com&#038;blog=46506911&#038;post=238&#038;subd=ma3245&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ma3245.wordpress.com/2013/03/11/crr-american-put-price-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c939517ec889b9317c98790937da243b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">timcyku</media:title>
		</media:content>
	</item>
		<item>
		<title>CRR European put price</title>
		<link>http://ma3245.wordpress.com/2013/03/11/crr-european-put-price/</link>
		<comments>http://ma3245.wordpress.com/2013/03/11/crr-european-put-price/#comments</comments>
		<pubDate>Mon, 11 Mar 2013 03:49:17 +0000</pubDate>
		<dc:creator>matkcy</dc:creator>
				<category><![CDATA[Matlab]]></category>

		<guid isPermaLink="false">http://ma3245.wordpress.com/?p=229</guid>
		<description><![CDATA[The MATLAB function below calculates the European put price under CRR binomial model. To see how the prices converge as the number of time steps increase, you can plot the graph by executing the following in the command window: &#62;&#62; &#8230; <a href="http://ma3245.wordpress.com/2013/03/11/crr-european-put-price/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ma3245.wordpress.com&#038;blog=46506911&#038;post=229&#038;subd=ma3245&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>The MATLAB function below calculates the European put price under CRR binomial model. To see how the prices converge as the number of time steps increase, you can plot the graph by executing the following in the command window:<br />
<code><br />
&gt;&gt; S0=100;K=100;T=1;r=0.1;sigma=0.3;<br />
&gt;&gt; for n=1:1:100<br />
prices(n)=EuPut_CRR(S0,K,T,r,sigma,n);<br />
end<br />
&gt;&gt; plot(prices)<br />
</code><br />
<strong>EuPut_CRR.m</strong></p>
<pre class="brush: matlabkey; title: ; notranslate">
function price = EuPut_CRR(S0, K, T, r, sigma, n)
% EuPut_CRR(S0, K, T, r, sigma, n)
% S0=spot price
% K = strike price
% T = time to maturity
% r = risk-free rate (per annum continuously compounded)
% sigma = volatility
% n = number of time-steps in the CRR binomial model

dt = T/n;
u = exp(sigma*sqrt(dt));
d=1/u;
p = (exp(r*dt)-d)/(u-d);
q = 1-p;

% Initialization
V = zeros(n+1,1);
S(1) = S0;

% Option values at time T
V = max(K-S0*d.^([n:-1:0]').*u.^([0:n]'),0);

%Backward induction
for i = n:-1:1
for j = 1:i
V(j) = p*V(j+1) + q*V(j);
end
end
V(1) = exp(-r*T)*V(1);

price = V(1);

</pre>
<br />  <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ma3245.wordpress.com&#038;blog=46506911&#038;post=229&#038;subd=ma3245&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ma3245.wordpress.com/2013/03/11/crr-european-put-price/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c939517ec889b9317c98790937da243b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">timcyku</media:title>
		</media:content>
	</item>
		<item>
		<title>Forward price, delivery price and value of forward contract</title>
		<link>http://ma3245.wordpress.com/2013/02/27/forward-price-delivery-price-and-value-of-forward-contract/</link>
		<comments>http://ma3245.wordpress.com/2013/02/27/forward-price-delivery-price-and-value-of-forward-contract/#comments</comments>
		<pubDate>Wed, 27 Feb 2013 13:19:07 +0000</pubDate>
		<dc:creator>matkcy</dc:creator>
				<category><![CDATA[MA3245 Concepts]]></category>

		<guid isPermaLink="false">http://ma3245.wordpress.com/?p=179</guid>
		<description><![CDATA[Suppose time today is , and I enter into a contract to buy the underlying asset for at maturity date (I am in the long position of the contract). Recall that the payoff at maturity to my long position is &#8230; <a href="http://ma3245.wordpress.com/2013/02/27/forward-price-delivery-price-and-value-of-forward-contract/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ma3245.wordpress.com&#038;blog=46506911&#038;post=179&#038;subd=ma3245&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Suppose time today is <img src='http://s0.wp.com/latex.php?latex=0&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='0' title='0' class='latex' />, and I enter into a contract to buy the underlying asset for <img src='http://s0.wp.com/latex.php?latex=K&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='K' title='K' class='latex' /> at maturity date <img src='http://s0.wp.com/latex.php?latex=T&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='T' title='T' class='latex' /> (I am in the long position of the contract). Recall that the payoff at maturity to my long position is <img src='http://s0.wp.com/latex.php?latex=S_%7BT%7D-K&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='S_{T}-K' title='S_{T}-K' class='latex' />. Here, <img src='http://s0.wp.com/latex.php?latex=K&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='K' title='K' class='latex' /> is called the <em>delivery price</em> of the contract and must be fixed at the initiation of the contract.</p>
<ol>
<li>How should <img src='http://s0.wp.com/latex.php?latex=K&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='K' title='K' class='latex' /> be chosen?</li>
<li>What is the value of my long position in the contract?</li>
<li>What is the difference between the current <em>forward price</em> <img src='http://s0.wp.com/latex.php?latex=F_%7B0%2CT%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='F_{0,T}' title='F_{0,T}' class='latex' /> and the delivery price <img src='http://s0.wp.com/latex.php?latex=K&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='K' title='K' class='latex' />?</li>
</ol>
<p>The answers to the above questions are related.</p>
<ul>
<li>If <img src='http://s0.wp.com/latex.php?latex=K%3DF_%7B0%2CT%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='K=F_{0,T}' title='K=F_{0,T}' class='latex' />, then the value of my (long) position in the contract is <img src='http://s0.wp.com/latex.php?latex=0&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='0' title='0' class='latex' />. This is true by definition of the forward price; it is the delivery price such that it costs nothing (for both the buyer and the seller) to enter into the contract.</li>
<li>If <img src='http://s0.wp.com/latex.php?latex=K%3EF_%7B0%2CT%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='K&gt;F_{0,T}' title='K&gt;F_{0,T}' class='latex' />, then my payoff would be <strong>less</strong> than that in the 1st case since <img src='http://s0.wp.com/latex.php?latex=S_%7BT%7D-K+%3C+S_%7BT%7D-F_%7B0%2CT%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='S_{T}-K &lt; S_{T}-F_{0,T}' title='S_{T}-K &lt; S_{T}-F_{0,T}' class='latex' />. The positive difference is exactly <img src='http://s0.wp.com/latex.php?latex=K-F_%7B0%2CT%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='K-F_{0,T}' title='K-F_{0,T}' class='latex' />. Discounting it back to the present, this amount is exactly <img src='http://s0.wp.com/latex.php?latex=%28K-F_%7B0%2CT%7D%29e%5E%7B-rT%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='(K-F_{0,T})e^{-rT}' title='(K-F_{0,T})e^{-rT}' class='latex' />. I should be compensated by this amount today for the lesser amount at maturity (compared to the 1st case). So I should receive <img src='http://s0.wp.com/latex.php?latex=%28K-F_%7B0%2CT%7D%29e%5E%7B-rT%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='(K-F_{0,T})e^{-rT}' title='(K-F_{0,T})e^{-rT}' class='latex' /> (positive cashflows) when entering into the position, so the value of this position is the <strong>negative</strong> of this amount, which is <img src='http://s0.wp.com/latex.php?latex=%28F_%7B0%2CT%7D-K%29e%5E%7B-rT%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='(F_{0,T}-K)e^{-rT}' title='(F_{0,T}-K)e^{-rT}' class='latex' />. This agrees with the formula in the lecture for the value of long forward contract.</li>
<li>If <img src='http://s0.wp.com/latex.php?latex=K%3CF_%7B0%2CT%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='K&lt;F_{0,T}' title='K&lt;F_{0,T}' class='latex' />, then my payoff would be <strong>more</strong> than that in the 1st case since <img src='http://s0.wp.com/latex.php?latex=S_%7BT%7D-K+%3E+S_%7BT%7D-F_%7B0%2CT%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='S_{T}-K &gt; S_{T}-F_{0,T}' title='S_{T}-K &gt; S_{T}-F_{0,T}' class='latex' />. The positive difference is exactly <img src='http://s0.wp.com/latex.php?latex=F_%7B0%2CT%7D-K&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='F_{0,T}-K' title='F_{0,T}-K' class='latex' />. Discounting it back to the present, this amount is exactly <img src='http://s0.wp.com/latex.php?latex=%28F_%7B0%2CT%7D-K%29e%5E%7B-rT%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='(F_{0,T}-K)e^{-rT}' title='(F_{0,T}-K)e^{-rT}' class='latex' />. I should pay this amount to the seller today for the extra amount at maturity (compared to the 1st case). So I should pay <img src='http://s0.wp.com/latex.php?latex=%28F_%7B0%2CT%7D-K%29e%5E%7B-rT%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='(F_{0,T}-K)e^{-rT}' title='(F_{0,T}-K)e^{-rT}' class='latex' /> (negative cashflows) when entering into the position, so the value of this position is the <strong>positive</strong> of this amount, which is <img src='http://s0.wp.com/latex.php?latex=%28F_%7B0%2CT%7D-K%29e%5E%7B-rT%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='(F_{0,T}-K)e^{-rT}' title='(F_{0,T}-K)e^{-rT}' class='latex' />. Again, this agrees with the formula in the lecture for the value of long forward contract.</li>
</ul>
<br />  <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ma3245.wordpress.com&#038;blog=46506911&#038;post=179&#038;subd=ma3245&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ma3245.wordpress.com/2013/02/27/forward-price-delivery-price-and-value-of-forward-contract/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c939517ec889b9317c98790937da243b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">timcyku</media:title>
		</media:content>
	</item>
		<item>
		<title>A QuantNet Guide to Financial Engineering</title>
		<link>http://ma3245.wordpress.com/2013/02/23/a-quantnet-guide-to-financial-engineering/</link>
		<comments>http://ma3245.wordpress.com/2013/02/23/a-quantnet-guide-to-financial-engineering/#comments</comments>
		<pubDate>Sat, 23 Feb 2013 03:28:12 +0000</pubDate>
		<dc:creator>matkcy</dc:creator>
				<category><![CDATA[Career]]></category>

		<guid isPermaLink="false">http://ma3245.wordpress.com/?p=155</guid>
		<description><![CDATA[Nowadays, many quant jobs require at least a Master in Financial Engineering (MFE).  The following guide provides some useful information about preparing for a quant career in the financial industry.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ma3245.wordpress.com&#038;blog=46506911&#038;post=155&#038;subd=ma3245&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Nowadays, many quant jobs require at least a Master in Financial Engineering (MFE).  The following guide provides some useful information about preparing for a quant career in the financial industry.</p>
<p><a title="QuantNet 2012-2013 Guide" href="//ma3245.files.wordpress.com/2013/02/quantnetguide.pdf"><img class="alignnone size-medium wp-image-172" alt="Screen shot 2013-02-23 at AM 11.24.20" src="http://ma3245.files.wordpress.com/2013/02/screen-shot-2013-02-23-at-am-11-24-20.png?w=300&#038;h=196" width="300" height="196" /></a></p>
<br />  <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ma3245.wordpress.com&#038;blog=46506911&#038;post=155&#038;subd=ma3245&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ma3245.wordpress.com/2013/02/23/a-quantnet-guide-to-financial-engineering/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c939517ec889b9317c98790937da243b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">timcyku</media:title>
		</media:content>

		<media:content url="http://ma3245.files.wordpress.com/2013/02/screen-shot-2013-02-23-at-am-11-24-20.png?w=300" medium="image">
			<media:title type="html">Screen shot 2013-02-23 at AM 11.24.20</media:title>
		</media:content>
	</item>
		<item>
		<title>Stock Data &#8212; from Yahoo to Matlab</title>
		<link>http://ma3245.wordpress.com/2013/02/22/stock-data-from-yahoo-to-matlab/</link>
		<comments>http://ma3245.wordpress.com/2013/02/22/stock-data-from-yahoo-to-matlab/#comments</comments>
		<pubDate>Fri, 22 Feb 2013 08:50:12 +0000</pubDate>
		<dc:creator>matkcy</dc:creator>
				<category><![CDATA[Matlab]]></category>

		<guid isPermaLink="false">http://ma3245.wordpress.com/?p=136</guid>
		<description><![CDATA[1. Save the following Matlab code as stock_data.m, say in C:\Desktop. 2. Open Matlab and change the current directory to C:\Desktop. 3. At the Matlab Command &#62;&#62; type &#62;&#62;[hist_date, hist_high, hist_low, hist_open, hist_close, hist_vol] = stock_data(&#8216;GOOG&#8217;); Here, GOOG is the &#8230; <a href="http://ma3245.wordpress.com/2013/02/22/stock-data-from-yahoo-to-matlab/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ma3245.wordpress.com&#038;blog=46506911&#038;post=136&#038;subd=ma3245&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>1. Save the following Matlab code as <strong>stock_data.m</strong>, say in C:\Desktop.</p>
<p>2. Open Matlab and change the current directory to C:\Desktop.</p>
<p>3. At the Matlab Command &gt;&gt; type</p>
<p><span style="color:#2233ff;"> &gt;&gt;[hist_date, hist_high, hist_low, hist_open, hist_close, hist_vol] = stock_data(&#8216;GOOG&#8217;);</span></p>
<p>Here, GOOG is the stock symbol for Google Inc.</p>
<p>4. Among others, the above will return <span style="color:#2233ff;">hist_close </span> as a (column) vector of daily closing stock prices starting from the 1st trading day of 2005 to the present day. Depending on your needs, you may wish to change the start year on Line 06 below. We can later use <span style="color:#2233ff;">hist_close </span> to analyse the continuously compounnded returns of the stock.</p>
<p><strong>stock_data.m</strong></p>
<pre class="brush: matlabkey; title: ; notranslate">

% Script to Retrieve Historical Stock Data from Yahoo! Finance
% modified from LuminousLogic.com
function [hist_date, hist_high, hist_low, hist_open, hist_close, hist_vol] = stock_data(stock_symbol)

% Define starting year (the further back in time, the longer it takes to download)
start_year = '2005';

% Get current date
[this_year, this_month, this_day, dummy, dummy, dummy] = datevec(date);

% Build URL string
url_string = 'http://ichart.finance.yahoo.com/table.csv?';
url_string = strcat(url_string, 's=', upper(stock_symbol));
url_string = strcat(url_string, '&amp;d=', num2str(this_month-1));
url_string = strcat(url_string, '&amp;e=', num2str(this_day));
url_string = strcat(url_string, '&amp;f=', num2str(this_year));
url_string = strcat(url_string, '&amp;g=d&amp;a=0&amp;b=1&amp;c=', start_year);
url_string = strcat(url_string, '&amp;ignore.csv');

% Open a connection to the URL and retrieve data into a buffer
buffer = java.io.BufferedReader(...
         java.io.InputStreamReader(...
         openStream(...
         java.net.URL(url_string))));

% Read the first line (a header) and discard
dummy   = readLine(buffer);

% Read all remaining lines in buffer
ptr = 1;
while 1

% Read line
buff_line = char(readLine(buffer));

% Break if this is the end
if length(buff_line)&lt;3, break; end

% Find comma delimiter locations
commas    = find(buff_line== ',');

% Extract high, low, open, close, etc. from string
DATEvar   = buff_line(1:commas(1)-1);
OPENvar   = str2num( buff_line(commas(1)+1:commas(2)-1));
HIGHvar   = str2num( buff_line(commas(2)+1:commas(3)-1));
LOWvar    = str2num( buff_line(commas(3)+1:commas(4)-1));
CLOSEvar  = str2num( buff_line(commas(4)+1:commas(5)-1));
VOLvar    = str2num( buff_line(commas(5)+1:commas(6)-1));
adj_close = str2num( buff_line(commas(6)+1:end));

% Adjust for dividends, splits, etc.
DATEtemp{ptr,1} = DATEvar;
OPENtemp(ptr,1) = OPENvar  * adj_close / CLOSEvar;
HIGHtemp(ptr,1) = HIGHvar  * adj_close / CLOSEvar;
LOWtemp (ptr,1) = LOWvar   * adj_close / CLOSEvar;
CLOSEtemp(ptr,1)= CLOSEvar * adj_close / CLOSEvar;
VOLtemp(ptr,1)  = VOLvar;

ptr = ptr + 1;
end

% Reverse to normal chronological order, so 1st entry is oldest data point
hist_date  = flipud(DATEtemp);
hist_open  = flipud(OPENtemp);
hist_high  = flipud(HIGHtemp);
hist_low   = flipud(LOWtemp);
hist_close = flipud(CLOSEtemp);
hist_vol   = flipud(VOLtemp);
</pre>
<br />  <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ma3245.wordpress.com&#038;blog=46506911&#038;post=136&#038;subd=ma3245&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ma3245.wordpress.com/2013/02/22/stock-data-from-yahoo-to-matlab/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c939517ec889b9317c98790937da243b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">timcyku</media:title>
		</media:content>
	</item>
		<item>
		<title>Early Exercise of American Call</title>
		<link>http://ma3245.wordpress.com/2013/02/19/early-exercise-of-american-call/</link>
		<comments>http://ma3245.wordpress.com/2013/02/19/early-exercise-of-american-call/#comments</comments>
		<pubDate>Tue, 19 Feb 2013 11:45:45 +0000</pubDate>
		<dc:creator>matkcy</dc:creator>
				<category><![CDATA[MA3245 Extra Practice Questions]]></category>

		<guid isPermaLink="false">http://ma3245.wordpress.com/?p=121</guid>
		<description><![CDATA[The time now is . An American call option is written on a stock which pays a known dividend at time , where , and is the maturity date of the option. Explain why it is not optimal to exercise &#8230; <a href="http://ma3245.wordpress.com/2013/02/19/early-exercise-of-american-call/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ma3245.wordpress.com&#038;blog=46506911&#038;post=121&#038;subd=ma3245&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>The time now is <img src='http://s0.wp.com/latex.php?latex=0&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='0' title='0' class='latex' />. An American call option is written on a stock which pays a known dividend <img src='http://s0.wp.com/latex.php?latex=D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='D' title='D' class='latex' /> at time <img src='http://s0.wp.com/latex.php?latex=t_%7BD%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='t_{D}' title='t_{D}' class='latex' />, where <img src='http://s0.wp.com/latex.php?latex=0%3C+t_%7BD%7D+%3C+T&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='0&lt; t_{D} &lt; T' title='0&lt; t_{D} &lt; T' class='latex' />, and <img src='http://s0.wp.com/latex.php?latex=T&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='T' title='T' class='latex' /> is the maturity date of the option.</p>
<p>Explain why it is not optimal to exercise the American option EXCEPT POSSIBLY at maturity date <img src='http://s0.wp.com/latex.php?latex=T&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='T' title='T' class='latex' /> or immediately before <img src='http://s0.wp.com/latex.php?latex=t_%7BD%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='t_{D}' title='t_{D}' class='latex' />.</p>
<p>On a side: Let <img src='http://s0.wp.com/latex.php?latex=t_%7BD%7D%5E%7B-%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='t_{D}^{-}' title='t_{D}^{-}' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=t_%7BD%7D%5E%7B%2B%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='t_{D}^{+}' title='t_{D}^{+}' class='latex' /> denote the time immediately before and after <img src='http://s0.wp.com/latex.php?latex=t_%7BD%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='t_{D}' title='t_{D}' class='latex' />. The interval between <img src='http://s0.wp.com/latex.php?latex=t_%7BD%7D%5E%7B-%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='t_{D}^{-}' title='t_{D}^{-}' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=t_%7BD%7D%5E%7B%2B%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='t_{D}^{+}' title='t_{D}^{+}' class='latex' /> is so small such that we can assume <img src='http://s0.wp.com/latex.php?latex=t_%7BD%7D-t_%7BD%7D%5E%7B-%7D%3D0&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='t_{D}-t_{D}^{-}=0' title='t_{D}-t_{D}^{-}=0' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=t_%7BD%7D%5E%7B%2B%7D-t_%7BD%7D%3D0&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='t_{D}^{+}-t_{D}=0' title='t_{D}^{+}-t_{D}=0' class='latex' />. Also, we will not talk about <img src='http://s0.wp.com/latex.php?latex=S_%7Bt_%7BD%7D%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='S_{t_{D}}' title='S_{t_{D}}' class='latex' />; instead, we speak of <img src='http://s0.wp.com/latex.php?latex=S_%7Bt_%7BD%7D%5E%7B-%7D%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='S_{t_{D}^{-}}' title='S_{t_{D}^{-}}' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=S_%7Bt_%7BD%7D%5E%7B%2B%7D%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='S_{t_{D}^{+}}' title='S_{t_{D}^{+}}' class='latex' />. If the dividend paid at <img src='http://s0.wp.com/latex.php?latex=t_%7BD%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='t_{D}' title='t_{D}' class='latex' /> is <img src='http://s0.wp.com/latex.php?latex=D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='D' title='D' class='latex' />, then <img src='http://s0.wp.com/latex.php?latex=S_%7Bt_%7BD%7D%5E%7B%2B%7D%7D%3DS_%7Bt_%7BD%7D%5E%7B-%7D%7D-D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='S_{t_{D}^{+}}=S_{t_{D}^{-}}-D' title='S_{t_{D}^{+}}=S_{t_{D}^{-}}-D' class='latex' />.</p>
<p><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='640' height='390' src='http://www.youtube.com/embed/8lX2VI5ZsqE?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span></p>
<br />  <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ma3245.wordpress.com&#038;blog=46506911&#038;post=121&#038;subd=ma3245&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ma3245.wordpress.com/2013/02/19/early-exercise-of-american-call/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c939517ec889b9317c98790937da243b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">timcyku</media:title>
		</media:content>
	</item>
		<item>
		<title>Digital Put</title>
		<link>http://ma3245.wordpress.com/2013/02/15/digital_put/</link>
		<comments>http://ma3245.wordpress.com/2013/02/15/digital_put/#comments</comments>
		<pubDate>Fri, 15 Feb 2013 13:10:29 +0000</pubDate>
		<dc:creator>matkcy</dc:creator>
				<category><![CDATA[MA3245 Extra Practice Questions]]></category>

		<guid isPermaLink="false">http://ma3245.wordpress.com/?p=62</guid>
		<description><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ma3245.wordpress.com&#038;blog=46506911&#038;post=62&#038;subd=ma3245&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='640' height='390' src='http://www.youtube.com/embed/9PS0DQflajA?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span></p>
<br />  <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ma3245.wordpress.com&#038;blog=46506911&#038;post=62&#038;subd=ma3245&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ma3245.wordpress.com/2013/02/15/digital_put/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c939517ec889b9317c98790937da243b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">timcyku</media:title>
		</media:content>
	</item>
		<item>
		<title>Arbitrage Portfolio</title>
		<link>http://ma3245.wordpress.com/2013/02/04/arbitrage_portfolio/</link>
		<comments>http://ma3245.wordpress.com/2013/02/04/arbitrage_portfolio/#comments</comments>
		<pubDate>Mon, 04 Feb 2013 12:56:28 +0000</pubDate>
		<dc:creator>matkcy</dc:creator>
				<category><![CDATA[MA3245 Concepts]]></category>

		<guid isPermaLink="false">http://ma3245.wordpress.com/?p=6</guid>
		<description><![CDATA[Suppose is a self-financing portfolio initiated at time with maturity date . Both of the following portfolios will generate an arbitrage at maturity: 1. and in ALL possible outcomes; 2. and in ALL possible outcomes. In fact, the two are &#8230; <a href="http://ma3245.wordpress.com/2013/02/04/arbitrage_portfolio/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ma3245.wordpress.com&#038;blog=46506911&#038;post=6&#038;subd=ma3245&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Suppose <img src='http://s0.wp.com/latex.php?latex=%5CPi_%7Bt%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='&#92;Pi_{t}' title='&#92;Pi_{t}' class='latex' /> is a self-financing portfolio initiated at time <img src='http://s0.wp.com/latex.php?latex=0&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='0' title='0' class='latex' /> with maturity date <img src='http://s0.wp.com/latex.php?latex=T&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='T' title='T' class='latex' />. Both of the following portfolios will generate an arbitrage at maturity:</p>
<p>1.<img src='http://s0.wp.com/latex.php?latex=%5CPi_%7B0%7D%3D0&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='&#92;Pi_{0}=0' title='&#92;Pi_{0}=0' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=%5CPi_%7BT%7D%3E0&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='&#92;Pi_{T}&gt;0' title='&#92;Pi_{T}&gt;0' class='latex' /> in ALL possible outcomes;</p>
<p>2.<img src='http://s0.wp.com/latex.php?latex=%5CPi_%7B0%7D+%3C+0&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='&#92;Pi_{0} &lt; 0' title='&#92;Pi_{0} &lt; 0' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=%5CPi_%7BT%7D+%5Cge+0&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='&#92;Pi_{T} &#92;ge 0' title='&#92;Pi_{T} &#92;ge 0' class='latex' /> in ALL possible outcomes.</p>
<p>In fact, the two are equivalent up to time value of money. Here is how we can `normalize’ the 2nd portfolio so that its value becomes zero at initiation: since the value of the second portfolio is negative, we receive money when entering into the portfolio; we can invest this amount in the money market so that the value of the resulting portfolio becomes zero. Consequently, the value of the resulting portfolio at maturity will be positive in all possible outcomes, which is the case of the 1st portfolio.</p>
<p>The above portfolios are<em> sufficient but not necessary</em> for generating arbitrage. This is because arbitrage, based on the definition given in the lecture, is weaker than what we have just seen. Recall the following definition of arbitrage:</p>
<ul>
<li><img src='http://s0.wp.com/latex.php?latex=%5CPi_%7B0%7D%3D0&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='&#92;Pi_{0}=0' title='&#92;Pi_{0}=0' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=%5CPi_%7BT%7D+%5Cge+0&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='&#92;Pi_{T} &#92;ge 0' title='&#92;Pi_{T} &#92;ge 0' class='latex' /> in ALL possible outcomes, and <img src='http://s0.wp.com/latex.php?latex=%5CPi_%7BT%7D+%3E+0&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='&#92;Pi_{T} &gt; 0' title='&#92;Pi_{T} &gt; 0' class='latex' /> in SOME possible outcome.</li>
</ul>
<p>If the initial value <img src='http://s0.wp.com/latex.php?latex=%5CPi_%7B0%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='&#92;Pi_{0}' title='&#92;Pi_{0}' class='latex' /> is not <img src='http://s0.wp.com/latex.php?latex=0&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='0' title='0' class='latex' />, an equivalent way of expressing arbitrage is that</p>
<ul>
<li><img src='http://s0.wp.com/latex.php?latex=%5CPi_%7BT%7D-%5CPi_%7B0%7De%5E%7BrT%7D+%5Cge+0&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='&#92;Pi_{T}-&#92;Pi_{0}e^{rT} &#92;ge 0' title='&#92;Pi_{T}-&#92;Pi_{0}e^{rT} &#92;ge 0' class='latex' /> in ALL possible outcomes, and <img src='http://s0.wp.com/latex.php?latex=%5CPi_%7BT%7D-%5CPi_%7B0%7De%5E%7BrT%7D+%3E+0&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='&#92;Pi_{T}-&#92;Pi_{0}e^{rT} &gt; 0' title='&#92;Pi_{T}-&#92;Pi_{0}e^{rT} &gt; 0' class='latex' /> in SOME possible outcome.</li>
</ul>
<p>Here, <img src='http://s0.wp.com/latex.php?latex=%5CPi_%7BT%7D-%5CPi_%7B0%7De%5E%7BrT%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='&#92;Pi_{T}-&#92;Pi_{0}e^{rT}' title='&#92;Pi_{T}-&#92;Pi_{0}e^{rT}' class='latex' /> is the profit generated by the portfolio at maturity <img src='http://s0.wp.com/latex.php?latex=T&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='T' title='T' class='latex' />. Therefore,</p>
<blockquote><p>Arbitrage is making positive profit with some positive probability without any risk of loss (i.e. negative profit occurs with zero probability)!</p></blockquote>
<br />  <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ma3245.wordpress.com&#038;blog=46506911&#038;post=6&#038;subd=ma3245&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ma3245.wordpress.com/2013/02/04/arbitrage_portfolio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c939517ec889b9317c98790937da243b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">timcyku</media:title>
		</media:content>
	</item>
	</channel>
</rss>
