<?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/"
	>

<channel>
	<title>sitmo.com</title>
	<atom:link href="http://www.sitmo.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sitmo.com</link>
	<description>Custom Financial Research and Development Services</description>
	<lastBuildDate>Fri, 20 Jan 2012 22:33:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Validation of Treasury and Trading Pricing and Risk Management Models and System</title>
		<link>http://www.sitmo.com/article/validation-of-treasury-and-trading-pricing-and-risk-management-models-and-system/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=validation-of-treasury-and-trading-pricing-and-risk-management-models-and-system</link>
		<comments>http://www.sitmo.com/article/validation-of-treasury-and-trading-pricing-and-risk-management-models-and-system/#comments</comments>
		<pubDate>Fri, 20 Jan 2012 22:17:11 +0000</pubDate>
		<dc:creator>Thijs van den Berg</dc:creator>
				<category><![CDATA[Client Projects]]></category>

		<guid isPermaLink="false">http://www.sitmo.com/?p=693</guid>
		<description><![CDATA[This is an interim project I did in the period June 2011- Jan 2012 at a Dutch Bank. The implementation of a new treasury and risk management system at a bank called for a formal validation of the both the system output, as well as the system configuration. Validation / Configuration: Defining swap curves, contributing [...]]]></description>
			<content:encoded><![CDATA[<p>This is an interim project I did in the period June 2011- Jan 2012 at a Dutch Bank.</p>
<p>The implementation of a new treasury and risk management system at a bank called for a formal validation of the both the system output, as well as the system configuration.</p>
<p>Validation / Configuration:<br />
Defining swap curves, contributing rates and interpolation method. Validate discount curves and pricing models on linear products: deposits and loans bonds, interest rate swaps, forward, cross currency swaps<br />
Validate VAR calculations and risk reports: replicate the VAR calculation of various deal types.</p>
<p>Development:<br />
Develop liquidity management and risk management model for maturing and non-maturing accounts.<br />
Various IT tasks: works on Bloomberg and Reuters interfaces, Excel tools, writing SQL Server queries and scrips. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.sitmo.com/article/validation-of-treasury-and-trading-pricing-and-risk-management-models-and-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quantitative Strategic Modeling – Regulatory Impact Assessment</title>
		<link>http://www.sitmo.com/article/quantitative-strategic-modeling-%e2%80%93-regulatory-impact-assessment/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=quantitative-strategic-modeling-%25e2%2580%2593-regulatory-impact-assessment</link>
		<comments>http://www.sitmo.com/article/quantitative-strategic-modeling-%e2%80%93-regulatory-impact-assessment/#comments</comments>
		<pubDate>Thu, 12 Jan 2012 22:26:06 +0000</pubDate>
		<dc:creator>Thijs van den Berg</dc:creator>
				<category><![CDATA[Client Projects]]></category>

		<guid isPermaLink="false">http://www.sitmo.com/?p=696</guid>
		<description><![CDATA[This was a project I did in the period September 2011 &#8211; January 2012 European- and State regulations are open to dialogs with industries. In this study, the financial impact on my client of a wide variety of possible future regulatory scenario’s are examined using quantitative modeling and scenario analysis. The results of the study [...]]]></description>
			<content:encoded><![CDATA[<p>This was a project I did in the period September 2011 &#8211; January 2012</p>
<p>European- and State regulations are open to dialogs with industries.</p>
<p>In this study, the financial impact on my client of a wide variety of possible future regulatory scenario’s are examined using quantitative modeling and scenario analysis. The results of the study and condensed into a strategic advice. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.sitmo.com/article/quantitative-strategic-modeling-%e2%80%93-regulatory-impact-assessment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Brownian motion transform invariants</title>
		<link>http://www.sitmo.com/article/brownian-motion-transform-invariants/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=brownian-motion-transform-invariants</link>
		<comments>http://www.sitmo.com/article/brownian-motion-transform-invariants/#comments</comments>
		<pubDate>Fri, 11 Nov 2011 12:54:42 +0000</pubDate>
		<dc:creator>Thijs van den Berg</dc:creator>
				<category><![CDATA[Equations]]></category>

		<guid isPermaLink="false">http://www.sitmo.com/?p=483</guid>
		<description><![CDATA[Below are some usefull transform invariants for Brownian motion. &#160; &#160;]]></description>
			<content:encoded><![CDATA[<p>Below are some usefull transform invariants for Brownian motion.<br />
<span id="more-483"></span></p>
<p class="ql-center-displayed-equation" style="line-height: 446px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-11779f80dbf567aa2217b93c30a01966_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#92;&#116;&#101;&#120;&#116;&#123;&#32;&#36;&#89;&#95;&#116;&#36;&#32;&#105;&#115;&#32;&#97;&#108;&#115;&#111;&#32;&#97;&#32;&#125;&#38;&#92;&#116;&#101;&#120;&#116;&#123;&#66;&#114;&#111;&#119;&#110;&#105;&#97;&#110;&#32;&#109;&#111;&#116;&#105;&#111;&#110;&#46;&#46;&#125;&#92;&#92; &#92;&#116;&#101;&#120;&#116;&#123;&#115;&#121;&#109;&#109;&#101;&#116;&#114;&#121;&#58;&#125;&#92;&#92; &#89;&#95;&#116;&#38;&#61;&#45;&#87;&#95;&#116;&#92;&#92;&#32;&#92;&#92; &#92;&#116;&#101;&#120;&#116;&#123;&#116;&#114;&#97;&#110;&#115;&#108;&#97;&#116;&#105;&#111;&#110;&#58;&#125;&#92;&#92; &#89;&#95;&#116;&#38;&#61;&#87;&#95;&#116;&#43;&#97;&#92;&#92;&#32;&#92;&#92; &#92;&#116;&#101;&#120;&#116;&#123;&#115;&#99;&#97;&#108;&#105;&#110;&#103;&#58;&#125;&#92;&#92; &#89;&#95;&#116;&#38;&#61;&#99;&#32;&#87;&#95;&#123;&#116;&#47;&#99;&#94;&#50;&#125;&#92;&#92;&#32;&#92;&#92; &#92;&#116;&#101;&#120;&#116;&#123;&#114;&#101;&#102;&#108;&#101;&#99;&#116;&#105;&#111;&#110;&#32;&#112;&#114;&#105;&#110;&#99;&#105;&#112;&#108;&#101;&#58;&#125;&#92;&#92; &#89;&#95;&#116;&#32;&#38;&#61;&#32;&#92;&#108;&#101;&#102;&#116;&#92;&#123; &#32;&#32;&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#116;&#97;&#98;&#117;&#108;&#97;&#114;&#125;&#123;&#108;&#108;&#125; &#32;&#32;&#32;&#32;&#36;&#87;&#95;&#116;&#36;&#32;&#38;&#32;&#36;&#116;&#60;&#84;&#36;&#32;&#92;&#92; &#32;&#32;&#32;&#32;&#36;&#50;&#87;&#95;&#116;&#45;&#87;&#95;&#116;&#36;&#32;&#38;&#32;&#36;&#116;&#62;&#84;&#36; &#32;&#32;&#92;&#101;&#110;&#100;&#123;&#116;&#97;&#98;&#117;&#108;&#97;&#114;&#125; &#32;&#92;&#114;&#105;&#103;&#104;&#116;&#46;&#32;&#92;&#92;&#32;&#92;&#92; &#92;&#116;&#101;&#120;&#116;&#123;&#116;&#105;&#109;&#101;&#32;&#105;&#110;&#118;&#101;&#114;&#115;&#105;&#111;&#110;&#58;&#125;&#92;&#92; &#89;&#95;&#116;&#32;&#38;&#61;&#32;&#92;&#108;&#101;&#102;&#116;&#92;&#123; &#32;&#32;&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#116;&#97;&#98;&#117;&#108;&#97;&#114;&#125;&#123;&#108;&#108;&#125; &#32;&#32;&#32;&#32;&#36;&#48;&#36;&#32;&#38;&#32;&#36;&#116;&#61;&#48;&#36;&#32;&#92;&#92; &#32;&#32;&#32;&#32;&#36;&#116;&#32;&#87;&#95;&#123;&#49;&#47;&#116;&#125;&#36;&#32;&#38;&#32;&#36;&#116;&#62;&#48;&#36; &#32;&#32;&#92;&#101;&#110;&#100;&#123;&#116;&#97;&#98;&#117;&#108;&#97;&#114;&#125; &#32;&#92;&#114;&#105;&#103;&#104;&#116;&#46;&#32;&#92;&#92; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sitmo.com/article/brownian-motion-transform-invariants/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some usefull definitions for stochastic processes</title>
		<link>http://www.sitmo.com/article/some-usefull-definitions-for-stochastic-processes/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=some-usefull-definitions-for-stochastic-processes</link>
		<comments>http://www.sitmo.com/article/some-usefull-definitions-for-stochastic-processes/#comments</comments>
		<pubDate>Fri, 11 Nov 2011 12:53:25 +0000</pubDate>
		<dc:creator>Thijs van den Berg</dc:creator>
				<category><![CDATA[Equations]]></category>

		<guid isPermaLink="false">http://www.sitmo.com/?p=526</guid>
		<description><![CDATA[Bayes&#8217;s Rule &#160; &#160; Mean &#8211; Variance and r-moment about the mean &#160; &#160; Laplace transform of pdf &#160; &#160; Information content &#160; &#160; Conditional distribution &#160; &#160; Characteristic function &#160; &#160; Independent random variables note: &#160; &#160; Expected value &#160; &#160; Jointly Normal Distribution density function &#160; &#160; Orthogonal r.v.&#8217;s &#160; &#160; Correlation coefficient [...]]]></description>
			<content:encoded><![CDATA[<p><span id="more-526"></span></p>
<h3>Bayes&#8217;s Rule</h3>
<p class="ql-center-displayed-equation" style="line-height: 197px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-19d5ea1d09e6cf59b6c996e9997b18e6_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#80;&#91;&#65;&#95;&#106;&#124;&#66;&#93;&#32;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#80;&#91;&#66;&#124;&#65;&#95;&#106;&#93;&#80;&#91;&#65;&#95;&#106;&#93;&#125;&#123;&#80;&#91;&#66;&#93;&#125;&#92;&#92; &#92;&#92; &#80;&#91;&#66;&#93;&#61;&#80;&#91;&#66;&#124;&#65;&#95;&#49;&#93;&#80;&#91;&#65;&#95;&#49;&#93;&#43;&#32;&#92;&#108;&#100;&#111;&#116;&#115;&#32;&#32;&#43;&#32;&#32;&#80;&#91;&#66;&#124;&#65;&#95;&#110;&#93;&#80;&#91;&#65;&#95;&#110;&#93;&#92;&#92; &#92;&#92; &#102;&#95;&#121;&#32;&#40;&#121;&#124;&#32;&#88;&#32;&#61;&#32;&#120;&#41;&#32;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#102;&#95;&#120;&#32;&#40;&#120;&#32;&#124;&#32;&#89;&#32;&#61;&#32;&#121;&#41;&#32;&#102;&#95;&#121;&#32;&#40;&#121;&#41;&#32;&#32;&#125;&#123;&#102;&#95;&#120;&#32;&#40;&#120;&#41;&#125;&#32;&#92;&#92; &#92;&#116;&#101;&#120;&#116;&#123;&#102;&#111;&#114;&#32;&#114;&#97;&#110;&#100;&#111;&#109;&#32;&#118;&#97;&#114;&#105;&#97;&#98;&#108;&#101;&#125; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Mean &#8211; Variance and r-moment about the mean</h3>
<p class="ql-center-displayed-equation" style="line-height: 299px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-219248c05e52a250596a1d96a7d6fbd0_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#92;&#109;&#117;&#32;&#32;&#61;&#32;&#92;&#105;&#110;&#116;&#95;&#123;&#45;&#92;&#105;&#110;&#102;&#116;&#121;&#125;&#94;&#123;&#43;&#92;&#105;&#110;&#102;&#116;&#121;&#125;&#32;&#120;&#32;&#102;&#40;&#120;&#41;&#32;&#100;&#120;&#92;&#92; &#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#32;&#61;&#32;&#92;&#105;&#110;&#116;&#95;&#123;&#45;&#92;&#105;&#110;&#102;&#116;&#121;&#125;&#94;&#123;&#43;&#92;&#105;&#110;&#102;&#116;&#121;&#125;&#32;&#40;&#120;&#32;&#45;&#32;&#92;&#109;&#117;&#41;&#94;&#50;&#32;&#102;&#40;&#120;&#41;&#32;&#100;&#120;&#92;&#92; &#92;&#109;&#117;&#95;&#114;&#32;&#32;&#61;&#32;&#92;&#105;&#110;&#116;&#95;&#123;&#45;&#92;&#105;&#110;&#102;&#116;&#121;&#125;&#94;&#123;&#43;&#92;&#105;&#110;&#102;&#116;&#121;&#125;&#32;&#40;&#120;&#32;&#45;&#32;&#92;&#109;&#117;&#41;&#94;&#114;&#32;&#102;&#40;&#120;&#41;&#32;&#100;&#120;&#32;&#92;&#92; &#92;&#92; &#92;&#109;&#117;&#95;&#123;&#107;&#114;&#125;&#32;&#61;&#32;&#69;&#92;&#123;&#40;&#88;&#32;&#45;&#32;&#92;&#109;&#117;&#95;&#120;&#41;&#94;&#107;&#32;&#40;&#89;&#32;&#45;&#32;&#92;&#109;&#117;&#95;&#121;&#41;&#94;&#114;&#32;&#92;&#125;&#32;&#61;&#32;&#92;&#105;&#110;&#116;&#95;&#123;&#45;&#92;&#105;&#110;&#102;&#116;&#121;&#125;&#94;&#123;&#92;&#105;&#110;&#102;&#116;&#121;&#125;&#32;&#92;&#105;&#110;&#116;&#95;&#123;&#45;&#92;&#105;&#110;&#102;&#116;&#121;&#125;&#94;&#123;&#92;&#105;&#110;&#102;&#116;&#121;&#125;&#32;&#40;&#120;&#32;&#45;&#32;&#92;&#109;&#117;&#95;&#120;&#41;&#94;&#107;&#32;&#40;&#121;&#32;&#45;&#32;&#92;&#109;&#117;&#95;&#121;&#41;&#94;&#114;&#32;&#102;&#40;&#120;&#44;&#121;&#41;&#32;&#100;&#120;&#32;&#100;&#121;&#32;&#92;&#92; &#92;&#92; &#92;&#109;&#117;&#94;&#92;&#112;&#114;&#105;&#109;&#101;&#32;&#95;&#32;&#123;&#107;&#114;&#125;&#61;&#32;&#69;&#92;&#123;&#32;&#88;&#94;&#107;&#32;&#89;&#94;&#114;&#92;&#125;&#32;&#61;&#32;&#32;&#32;&#92;&#105;&#110;&#116;&#95;&#123;&#45;&#92;&#105;&#110;&#102;&#116;&#121;&#125;&#94;&#123;&#92;&#105;&#110;&#102;&#116;&#121;&#125;&#32;&#92;&#105;&#110;&#116;&#95;&#123;&#45;&#92;&#105;&#110;&#102;&#116;&#121;&#125;&#94;&#123;&#92;&#105;&#110;&#102;&#116;&#121;&#125;&#32;&#120;&#32;&#94;&#107;&#32;&#121;&#94;&#114;&#32;&#102;&#40;&#120;&#44;&#121;&#41;&#32;&#100;&#120;&#32;&#100;&#121;&#32;&#92;&#92; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Laplace transform of pdf</h3>
<p class="ql-center-displayed-equation" style="line-height: 41px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-945441cd2a96206b2b1a2ae77603a35a_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#102;&#94;&#76;&#95;&#115;&#32;&#61;&#32;&#92;&#105;&#110;&#116;&#95;&#48;&#32;&#94;&#123;&#92;&#105;&#110;&#102;&#116;&#121;&#125;&#32;&#101;&#94;&#123;&#45;&#115;&#120;&#125;&#32;&#102;&#40;&#120;&#41;&#32;&#100;&#120; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Information content</h3>
<p class="ql-center-displayed-equation" style="line-height: 41px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-6085388f8c863c16e7c0b5e98e0dd217_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#73;&#32;&#61;&#32;&#45;&#32;&#92;&#105;&#110;&#116;&#95;&#123;&#45;&#92;&#105;&#110;&#102;&#116;&#121;&#125;&#94;&#123;&#92;&#105;&#110;&#102;&#116;&#121;&#125;&#32;&#102;&#40;&#120;&#41;&#32;&#92;&#108;&#111;&#103;&#95;&#50;&#40;&#102;&#40;&#120;&#41;&#41;&#32;&#100;&#120; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Conditional distribution</h3>
<p class="ql-center-displayed-equation" style="line-height: 43px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-86b6e31d7ea4dc26ef803d5404374a6e_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#70;&#95;&#120;&#32;&#40;&#120;&#124;&#77;&#41;&#32;&#61;&#32;&#80;&#92;&#123;&#88;&#32;&#92;&#108;&#101;&#113;&#32;&#120;&#32;&#124;&#32;&#77;&#32;&#92;&#125;&#32;&#32;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#80;&#92;&#123;&#32;&#88;&#32;&#92;&#108;&#101;&#113;&#32;&#120;&#32;&#44;&#32;&#77;&#32;&#32;&#92;&#125;&#125;&#123;&#80;&#92;&#123;&#32;&#32;&#77;&#32;&#92;&#125;&#125; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Characteristic function</h3>
<p class="ql-center-displayed-equation" style="line-height: 145px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-3fa703a5f90d14c946d0571ceb48ea06_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#92;&#80;&#104;&#105;&#32;&#40;&#92;&#111;&#109;&#101;&#103;&#97;&#41;&#32;&#61;&#32;&#69;&#92;&#123;&#32;&#101;&#94;&#123;&#106;&#92;&#111;&#109;&#101;&#103;&#97;&#32;&#88;&#125;&#32;&#32;&#92;&#125;&#32;&#61;&#32;&#92;&#105;&#110;&#116;&#95;&#123;&#45;&#92;&#105;&#110;&#102;&#116;&#121;&#125;&#94;&#123;&#92;&#105;&#110;&#102;&#116;&#121;&#125;&#32;&#32;&#32;&#101;&#94;&#123;&#106;&#32;&#92;&#111;&#109;&#101;&#103;&#97;&#32;&#120;&#125;&#32;&#102;&#40;&#120;&#41;&#32;&#100;&#120;&#32;&#92;&#92;&#32;&#32;&#92;&#116;&#101;&#120;&#116;&#123;&#102;&#111;&#114;&#32;&#99;&#111;&#110;&#116;&#105;&#110;&#117;&#111;&#117;&#115;&#32;&#114;&#46;&#118;&#46;&#125;&#32;&#92;&#92; &#92;&#80;&#104;&#105;&#32;&#40;&#92;&#111;&#109;&#101;&#103;&#97;&#41;&#32;&#61;&#32;&#92;&#115;&#117;&#109;&#95;&#107;&#32;&#101;&#94;&#123;&#106;&#32;&#92;&#111;&#109;&#101;&#103;&#97;&#32;&#120;&#95;&#107;&#125;&#32;&#32;&#80;&#92;&#123;&#32;&#88;&#32;&#61;&#32;&#120;&#95;&#107;&#32;&#92;&#125;&#32;&#92;&#32;&#92;&#32;&#92;&#32;&#92;&#116;&#101;&#120;&#116;&#123;&#102;&#111;&#114;&#32;&#100;&#105;&#115;&#99;&#114;&#101;&#116;&#101;&#32;&#114;&#46;&#118;&#125;&#32;&#92;&#92; &#92;&#80;&#104;&#105;&#40;&#48;&#41;&#32;&#61;&#32;&#49;&#44;&#32;&#124;&#92;&#80;&#104;&#105;&#32;&#40;&#92;&#111;&#109;&#101;&#103;&#97;&#41;&#124;&#32;&#60;&#32;&#49; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Independent random variables</h3>
<p>note:</p>
<p class="ql-center-displayed-equation" style="line-height: 206px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-6c74c5f394a3b156221861cd34a2cfaf_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#70;&#95;&#123;&#120;&#121;&#125;&#32;&#40;&#120;&#44;&#32;&#121;&#41;&#32;&#61;&#32;&#70;&#95;&#120;&#32;&#40;&#120;&#41;&#32;&#70;&#95;&#121;&#32;&#40;&#121;&#41;&#32;&#92;&#92; &#102;&#95;&#123;&#120;&#121;&#125;&#32;&#40;&#120;&#44;&#121;&#41;&#32;&#61;&#32;&#102;&#40;&#120;&#41;&#32;&#102;&#40;&#121;&#41;&#32;&#92;&#92; &#102;&#95;&#121;&#32;&#40;&#121;&#124;&#120;&#41;&#32;&#61;&#32;&#102;&#95;&#121;&#32;&#40;&#121;&#41;&#32;&#92;&#92; &#102;&#95;&#120;&#32;&#40;&#120;&#124;&#121;&#41;&#32;&#61;&#32;&#102;&#95;&#120;&#32;&#40;&#120;&#41;&#32;&#92;&#92;&#32;&#32;&#92;&#92;&#32;&#92;&#92; &#69;&#92;&#123;&#103;&#40;&#88;&#41;&#32;&#104;&#40;&#88;&#41;&#92;&#125;&#32;&#61;&#32;&#69;&#92;&#123;&#32;&#103;&#40;&#88;&#41;&#92;&#125;&#32;&#69;&#92;&#123;&#104;&#40;&#88;&#41;&#92;&#125;&#32;&#32;&#92;&#92; &#92;&#116;&#101;&#120;&#116;&#123;&#40;&#73;&#102;&#32;&#88;&#44;&#32;&#89;&#32;&#97;&#114;&#101;&#32;&#105;&#110;&#100;&#101;&#112;&#101;&#110;&#100;&#101;&#110;&#116;&#44;&#32;&#116;&#104;&#101;&#105;&#114;&#32;&#102;&#117;&#110;&#99;&#116;&#105;&#111;&#110;&#115;&#32;&#97;&#114;&#101;&#32;&#105;&#110;&#100;&#101;&#112;&#101;&#110;&#100;&#101;&#110;&#116;&#32;&#116;&#111;&#111;&#41;&#125; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Expected value</h3>
<p class="ql-center-displayed-equation" style="line-height: 457px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-d435a0143089ed54100d4b7fad588bdf_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#69;&#92;&#123;&#32;&#88;&#32;&#92;&#125;&#32;&#61;&#32;&#92;&#105;&#110;&#116;&#95;&#123;&#45;&#92;&#105;&#110;&#102;&#116;&#121;&#125;&#32;&#94;&#123;&#92;&#105;&#110;&#102;&#116;&#121;&#125;&#32;&#120;&#32;&#102;&#40;&#120;&#41;&#32;&#100;&#120;&#32;&#92;&#32;&#92;&#32;&#92;&#32;&#92;&#32;&#92;&#116;&#101;&#120;&#116;&#123;&#99;&#111;&#110;&#116;&#105;&#110;&#117;&#111;&#117;&#115;&#32;&#114;&#46;&#118;&#46;&#125;&#32;&#92;&#92;&#32;&#92;&#92; &#69;&#92;&#123;&#32;&#88;&#32;&#92;&#125;&#32;&#61;&#32;&#92;&#115;&#117;&#109;&#95;&#110;&#32;&#120;&#95;&#110;&#32;&#80;&#32;&#92;&#123;&#32;&#32;&#88;&#32;&#61;&#32;&#120;&#95;&#110;&#92;&#125;&#32;&#61;&#32;&#92;&#115;&#117;&#109;&#95;&#110;&#32;&#120;&#95;&#110;&#32;&#112;&#95;&#110;&#32;&#92;&#32;&#92;&#32;&#92;&#32;&#92;&#116;&#101;&#120;&#116;&#123;&#100;&#105;&#115;&#99;&#114;&#101;&#116;&#101;&#32;&#114;&#46;&#118;&#46;&#32;&#125;&#32;&#92;&#92;&#32;&#92;&#92; &#69;&#92;&#123;&#32;&#89;&#32;&#61;&#32;&#103;&#40;&#88;&#41;&#32;&#92;&#125;&#32;&#61;&#32;&#92;&#105;&#110;&#116;&#95;&#123;&#45;&#92;&#105;&#110;&#102;&#116;&#121;&#125;&#32;&#94;&#123;&#92;&#105;&#110;&#102;&#116;&#121;&#125;&#32;&#121;&#32;&#102;&#95;&#89;&#32;&#40;&#121;&#41;&#32;&#100;&#121;&#32;&#32;&#61;&#32;&#92;&#105;&#110;&#116;&#95;&#123;&#45;&#92;&#105;&#110;&#102;&#116;&#121;&#125;&#32;&#94;&#123;&#92;&#105;&#110;&#102;&#116;&#121;&#125;&#32;&#103;&#40;&#120;&#41;&#32;&#102;&#95;&#88;&#32;&#40;&#120;&#41;&#32;&#100;&#120;&#32;&#92;&#32;&#92;&#32;&#92;&#32;&#92;&#32;&#92;&#92;&#92;&#116;&#101;&#120;&#116;&#123;&#102;&#111;&#114;&#32;&#102;&#117;&#110;&#99;&#116;&#105;&#111;&#110;&#32;&#103;&#40;&#88;&#41;&#125;&#32;&#92;&#92;&#32;&#92;&#92; &#69;&#92;&#123;&#32;&#103;&#40;&#88;&#41;&#32;&#124;&#32;&#89;&#32;&#61;&#32;&#121;&#32;&#92;&#125;&#32;&#61;&#32;&#92;&#105;&#110;&#116;&#95;&#123;&#45;&#92;&#105;&#110;&#102;&#116;&#121;&#125;&#32;&#94;&#123;&#92;&#105;&#110;&#102;&#116;&#121;&#125;&#32;&#32;&#103;&#40;&#120;&#41;&#32;&#102;&#95;&#120;&#32;&#40;&#120;&#124;&#32;&#89;&#32;&#61;&#32;&#121;&#41;&#32;&#100;&#120;&#32;&#92;&#92;&#32;&#61;&#32; &#92;&#102;&#114;&#97;&#99;&#123;&#92;&#105;&#110;&#116;&#95;&#123;&#45;&#92;&#105;&#110;&#102;&#116;&#121;&#125;&#94;&#92;&#105;&#110;&#102;&#116;&#121;&#32;&#103;&#40;&#120;&#41;&#32;&#102;&#95;&#123;&#120;&#121;&#125;&#32;&#40;&#120;&#44;&#121;&#41;&#32;&#100;&#120;&#125;&#123;&#32;&#92;&#105;&#110;&#116;&#95;&#123;&#45;&#92;&#105;&#110;&#102;&#116;&#121;&#125;&#94;&#92;&#105;&#110;&#102;&#116;&#121;&#32;&#102;&#95;&#123;&#120;&#121;&#125;&#32;&#40;&#120;&#44;&#121;&#41;&#32;&#100;&#121;&#125;&#32;&#92;&#32;&#92;&#32;&#92;&#32;&#92;&#116;&#101;&#120;&#116;&#123;&#99;&#111;&#110;&#100;&#105;&#116;&#105;&#111;&#110;&#97;&#108;&#32;&#101;&#120;&#112;&#101;&#99;&#116;&#101;&#100;&#32;&#118;&#97;&#108;&#117;&#101;&#125;&#32;&#92;&#92; &#92;&#32;&#92;&#92;&#32;&#92;&#92; &#69;&#92;&#123;&#32;&#103;&#40;&#88;&#44;&#89;&#32;&#124;&#77;&#41;&#92;&#125;&#32;&#61;&#32;&#92;&#105;&#110;&#116;&#95;&#123;&#45;&#92;&#105;&#110;&#102;&#116;&#121;&#125;&#94;&#123;&#92;&#105;&#110;&#102;&#116;&#121;&#125;&#32;&#92;&#105;&#110;&#116;&#95;&#123;&#45;&#92;&#105;&#110;&#102;&#116;&#121;&#125;&#94;&#123;&#92;&#105;&#110;&#102;&#116;&#121;&#125;&#32;&#103;&#40;&#120;&#44;&#121;&#41;&#32;&#102;&#40;&#120;&#44;&#121;&#124;&#77;&#41;&#32;&#100;&#120;&#32;&#100;&#121; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Jointly Normal Distribution density function</h3>
<p class="ql-center-displayed-equation" style="line-height: 125px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-626b15962a3af14b50cbb7246d730f0c_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#102;&#40;&#120;&#44;&#121;&#41;&#32;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#50;&#32;&#92;&#112;&#105;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#49;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#50;&#32;&#92;&#115;&#113;&#114;&#116;&#123;&#49;&#45;&#114;&#94;&#50;&#125;&#125;&#32;&#92;&#116;&#101;&#120;&#116;&#123;&#101;&#120;&#112;&#125;&#32;&#92;&#108;&#101;&#102;&#116;&#91;&#45;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#50;&#40;&#49;&#45;&#114;&#94;&#50;&#41;&#125;&#32;&#92;&#108;&#101;&#102;&#116;&#91;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#40;&#120;&#45;&#92;&#109;&#117;&#95;&#49;&#41;&#94;&#50;&#125;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#49;&#94;&#50;&#125;&#32;&#45;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#50;&#114;&#40;&#120;&#32;&#45;&#32;&#92;&#109;&#117;&#95;&#49;&#41;&#40;&#121;&#32;&#45;&#32;&#92;&#109;&#117;&#95;&#50;&#41;&#125;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#49;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#50;&#125;&#32;&#32;&#43;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#40;&#121;&#45;&#92;&#109;&#117;&#95;&#50;&#41;&#94;&#50;&#125;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#50;&#94;&#50;&#125;&#32;&#32;&#92;&#114;&#105;&#103;&#104;&#116;&#93;&#32;&#92;&#114;&#105;&#103;&#104;&#116;&#93;&#32;&#32;&#92;&#92; &#92;&#32;&#92;&#92;&#32;&#92;&#92; &#124;&#114;&#124;&#32;&#60;&#32;&#49;&#32;&#92;&#32;&#32;&#92;&#32;&#92;&#32;&#92;&#32;&#92;&#116;&#101;&#120;&#116;&#123;&#99;&#111;&#114;&#114;&#101;&#108;&#97;&#116;&#105;&#111;&#110;&#32;&#99;&#111;&#101;&#102;&#102;&#105;&#99;&#105;&#101;&#110;&#116;&#125; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Orthogonal r.v.&#8217;s</h3>
<p class="ql-center-displayed-equation" style="line-height: 18px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-6162819b7763f172bbfeb6bafaf4b2c1_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#69;&#92;&#123;&#88;&#89;&#92;&#125;&#32;&#61;&#32;&#48; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Correlation coefficient</h3>
<p class="ql-center-displayed-equation" style="line-height: 47px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-240217c3e797f813b33fc1898e728aff_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#114;&#32;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#69;&#92;&#123;&#32;&#40;&#88;&#32;&#45;&#32;&#92;&#109;&#117;&#95;&#120;&#41;&#32;&#40;&#89;&#32;&#45;&#32;&#92;&#109;&#117;&#95;&#121;&#41;&#92;&#125;&#125;&#123;&#32;&#92;&#115;&#113;&#114;&#116;&#123;&#69;&#92;&#123;&#40;&#88;&#32;&#45;&#32;&#92;&#109;&#117;&#95;&#120;&#41;&#94;&#50;&#92;&#125;&#32;&#69;&#92;&#123;&#40;&#89;&#32;&#45;&#32;&#92;&#109;&#117;&#95;&#121;&#41;&#94;&#50;&#92;&#125;&#32;&#125;&#125;&#32;&#32;&#32;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#92;&#109;&#117;&#95;&#123;&#49;&#49;&#125;&#32;&#94;&#92;&#112;&#114;&#105;&#109;&#101;&#32;&#125;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#120;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#121;&#125; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Normal random variables</h3>
<p class="ql-center-displayed-equation" style="line-height: 161px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-821218254d1b5668897a67c10ba5b67a_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#69;&#92;&#123;&#32;&#40;&#88;&#32;&#45;&#32;&#92;&#109;&#117;&#95;&#120;&#41;&#32;&#40;&#89;&#32;&#45;&#32;&#92;&#109;&#117;&#95;&#121;&#41;&#92;&#125;&#32;&#61;&#32;&#114;&#95;&#123;&#120;&#121;&#125;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#120;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#121;&#92;&#92; &#92;&#92; &#92;&#116;&#101;&#120;&#116;&#123;&#87;&#104;&#101;&#110;&#32;&#88;&#44;&#32;&#89;&#32;&#97;&#114;&#101;&#32;&#106;&#111;&#105;&#110;&#116;&#108;&#121;&#32;&#110;&#111;&#114;&#109;&#97;&#108;&#32;&#119;&#105;&#116;&#104;&#32;&#122;&#101;&#114;&#111;&#32;&#109;&#101;&#97;&#110;&#125;&#92;&#92; &#69;&#92;&#123;&#32;&#40;&#97;&#88;&#32;&#43;&#32;&#98;&#89;&#41;&#94;&#50;&#32;&#92;&#125;&#32;&#61;&#32;&#97;&#94;&#50;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#120;&#32;&#94;&#50;&#32;&#43;&#32;&#98;&#94;&#50;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#121;&#32;&#94;&#50;&#32;&#43;&#32;&#50;&#97;&#98;&#32;&#114;&#95;&#123;&#120;&#121;&#125;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#120;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#121;&#32;&#32;&#92;&#92;&#32; &#92;&#92; &#69;&#92;&#123;&#32;&#40;&#97;&#88;&#32;&#43;&#32;&#98;&#89;&#41;&#32;&#40;&#99;&#88;&#32;&#43;&#32;&#100;&#89;&#41;&#92;&#125;&#32;&#61;&#32;&#97;&#99;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#120;&#32;&#94;&#50;&#32;&#43;&#32;&#98;&#100;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#121;&#32;&#94;&#50;&#32;&#43;&#32;&#40;&#97;&#100;&#32;&#43;&#98;&#99;&#41;&#32;&#114;&#95;&#123;&#120;&#121;&#125;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#120;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#121; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Conditional densities</h3>
<p class="ql-center-displayed-equation" style="line-height: 43px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-37e25b1f0b521cdad5c5df579fc53887_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#102;&#40;&#120;&#95;&#49;&#44;&#32;&#46;&#46;&#46;&#44;&#32;&#120;&#95;&#107;&#32;&#124;&#32;&#120;&#95;&#123;&#107;&#43;&#49;&#125;&#32;&#44;&#32;&#46;&#46;&#46;&#44;&#32;&#120;&#95;&#110;&#41;&#32;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#32;&#102;&#40;&#120;&#95;&#49;&#44;&#46;&#46;&#46;&#44;&#120;&#95;&#110;&#41;&#125;&#123;&#32;&#102;&#40;&#120;&#95;&#123;&#107;&#43;&#49;&#125;&#44;&#32;&#46;&#46;&#46;&#32;&#44;&#120;&#95;&#110;&#41;&#125; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Chain rule for sequence of random variables</h3>
<p class="ql-center-displayed-equation" style="line-height: 18px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-6cde2322d6ed1929a328db1b6c647477_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#102;&#40;&#120;&#95;&#49;&#44;&#46;&#46;&#46;&#44;&#120;&#95;&#110;&#41;&#32;&#61;&#32;&#102;&#40;&#120;&#95;&#110;&#124;&#44;&#120;&#95;&#123;&#110;&#45;&#49;&#125;&#44;&#46;&#46;&#46;&#44;&#120;&#95;&#49;&#41;&#46;&#46;&#46;&#102;&#40;&#120;&#95;&#50;&#124;&#120;&#95;&#49;&#41;&#102;&#40;&#120;&#95;&#49;&#41; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Sample mean</h3>
<p>Note that the variance of sample mean is n-time smaller than the one of a single sample.</p>
<p class="ql-center-displayed-equation" style="line-height: 153px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-e299eb8e0a2caa7bdae536993994eb2e_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#38;&#92;&#111;&#118;&#101;&#114;&#108;&#105;&#110;&#101;&#32;&#88;&#32;&#61;&#32;&#40;&#88;&#95;&#49;&#32;&#43;&#32;&#92;&#99;&#100;&#111;&#116;&#115;&#32;&#43;&#32;&#88;&#95;&#110;&#41;&#32;&#92;&#115;&#108;&#97;&#115;&#104;&#32;&#110;&#32;&#92;&#92; &#92;&#92; &#38;&#92;&#116;&#101;&#120;&#116;&#123;&#68;&#101;&#110;&#115;&#105;&#116;&#121;&#32;&#102;&#117;&#110;&#99;&#116;&#105;&#111;&#110;&#32;&#111;&#102;&#32;&#116;&#104;&#101;&#32;&#115;&#97;&#109;&#112;&#108;&#101;&#32;&#109;&#101;&#97;&#110;&#125;&#92;&#92; &#38;&#92;&#116;&#101;&#120;&#116;&#123;&#40;&#122;&#101;&#114;&#111;&#45;&#109;&#101;&#97;&#110;&#44;&#32;&#71;&#97;&#117;&#115;&#115;&#105;&#97;&#110;&#32;&#99;&#97;&#115;&#101;&#41;&#125;&#92;&#92; &#38;&#102;&#95;&#123;&#92;&#111;&#118;&#101;&#114;&#108;&#105;&#110;&#101;&#32;&#120;&#125;&#40;&#120;&#41;&#32;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#92;&#115;&#113;&#114;&#116;&#123;&#50;&#92;&#112;&#105;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#32;&#92;&#115;&#108;&#97;&#115;&#104;&#32;&#110;&#125;&#125;&#32;&#101;&#94;&#123;&#45;&#110;&#120;&#94;&#50;&#32;&#92;&#115;&#108;&#97;&#115;&#104;&#32;&#50;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#125;&#32;&#92;&#92; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Sample variance</h3>
<p>note:Sample variance</p>
<p class="ql-center-displayed-equation" style="line-height: 51px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-5c3d716b615539507671dfeffa0ca3cc_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#92;&#111;&#118;&#101;&#114;&#108;&#105;&#110;&#101;&#32;&#83;&#32;&#61;&#32;&#91;&#40;&#88;&#95;&#49;&#32;&#45;&#32;&#92;&#111;&#118;&#101;&#114;&#108;&#105;&#110;&#101;&#32;&#88;&#41;&#94;&#50;&#32;&#32;&#43;&#32;&#92;&#99;&#100;&#111;&#116;&#115;&#32;&#43;&#32;&#40;&#88;&#95;&#110;&#32;&#45;&#32;&#92;&#111;&#118;&#101;&#114;&#108;&#105;&#110;&#101;&#32;&#88;&#41;&#94;&#50;&#93;&#32;&#92;&#115;&#108;&#97;&#115;&#104;&#32;&#110;&#32;&#61;&#32;&#92;&#115;&#117;&#109;&#95;&#123;&#105;&#61;&#49;&#125;&#94;&#110;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#88;&#95;&#105;&#32;&#94;&#50;&#125;&#123;&#110;&#125;&#32;&#45;&#32;&#92;&#111;&#118;&#101;&#114;&#108;&#105;&#110;&#101;&#32;&#88;&#94;&#50; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Random process X(t) and basis</h3>
<p>note:Random process X(t)</p>
<p class="ql-center-displayed-equation" style="line-height: 493px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-ec5344dd0ad153ab377e849fc090ad4c_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#38;&#92;&#116;&#101;&#120;&#116;&#123;&#82;&#97;&#110;&#100;&#111;&#109;&#32;&#112;&#114;&#111;&#99;&#101;&#115;&#115;&#125;&#92;&#92; &#38;&#88;&#40;&#116;&#41;&#32;&#61;&#32;&#88;&#40;&#116;&#44;&#92;&#122;&#101;&#116;&#97;&#41;&#92;&#92; &#92;&#92; &#38;&#92;&#116;&#101;&#120;&#116;&#123;&#70;&#105;&#114;&#115;&#116;&#32;&#111;&#114;&#100;&#101;&#114;&#32;&#100;&#105;&#115;&#116;&#114;&#105;&#98;&#117;&#116;&#105;&#111;&#110;&#32;&#102;&#117;&#110;&#99;&#116;&#105;&#111;&#110;&#125;&#92;&#92; &#38;&#70;&#40;&#120;&#59;&#116;&#41;&#32;&#61;&#32;&#80;&#92;&#123;&#32;&#88;&#40;&#116;&#41;&#32;&#92;&#108;&#101;&#32;&#120;&#32;&#92;&#125;&#92;&#92; &#92;&#92; &#38;&#92;&#116;&#101;&#120;&#116;&#123;&#110;&#45;&#111;&#114;&#100;&#101;&#114;&#32;&#100;&#105;&#115;&#116;&#114;&#105;&#98;&#117;&#116;&#105;&#111;&#110;&#32;&#102;&#117;&#110;&#99;&#116;&#105;&#111;&#110;&#125;&#92;&#92; &#38;&#70;&#40;&#120;&#95;&#49;&#44;&#92;&#99;&#100;&#111;&#116;&#115;&#44;&#120;&#95;&#110;&#59;&#32;&#116;&#95;&#49;&#44;&#92;&#99;&#100;&#111;&#116;&#115;&#44;&#116;&#95;&#110;&#41;&#32;&#61;&#32;&#80;&#92;&#123;&#32;&#88;&#40;&#116;&#95;&#49;&#41;&#32;&#92;&#108;&#101;&#32;&#120;&#95;&#49;&#44;&#32;&#92;&#99;&#100;&#111;&#116;&#115;&#32;&#32;&#44;&#32;&#32;&#32;&#88;&#40;&#116;&#95;&#110;&#41;&#32;&#92;&#108;&#101;&#32;&#120;&#95;&#110;&#92;&#125;&#32;&#92;&#92; &#92;&#92; &#38;&#92;&#116;&#101;&#120;&#116;&#123;&#32;&#110;&#45;&#111;&#114;&#100;&#101;&#114;&#32;&#68;&#101;&#110;&#115;&#105;&#116;&#121;&#32;&#102;&#117;&#110;&#99;&#116;&#105;&#111;&#110;&#32;&#111;&#114;&#32;&#112;&#100;&#102;&#125;&#92;&#92; &#38;&#102;&#40;&#120;&#95;&#49;&#44;&#92;&#99;&#100;&#111;&#116;&#115;&#44;&#120;&#95;&#110;&#59;&#32;&#116;&#95;&#49;&#44;&#92;&#99;&#100;&#111;&#116;&#115;&#44;&#32;&#116;&#95;&#110;&#41;&#32;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#32;&#92;&#112;&#97;&#114;&#116;&#105;&#97;&#108;&#32;&#70;&#40;&#120;&#95;&#49;&#44;&#92;&#99;&#100;&#111;&#116;&#115;&#44;&#32;&#120;&#95;&#110;&#32;&#59;&#32;&#116;&#95;&#49;&#44;&#92;&#99;&#100;&#111;&#116;&#115;&#44;&#116;&#95;&#110;&#41;&#125;&#123;&#32;&#92;&#112;&#97;&#114;&#116;&#105;&#97;&#108;&#32;&#120;&#95;&#49;&#44;&#32;&#92;&#99;&#100;&#111;&#116;&#115;&#44;&#32;&#92;&#112;&#97;&#114;&#116;&#105;&#97;&#108;&#32;&#120;&#95;&#110;&#125;&#92;&#92; &#92;&#92; &#38;&#92;&#116;&#101;&#120;&#116;&#123;&#65;&#117;&#116;&#111;&#99;&#111;&#114;&#114;&#101;&#108;&#97;&#116;&#105;&#111;&#110;&#125;&#92;&#92; &#38;&#82;&#40;&#116;&#95;&#49;&#44;&#116;&#95;&#50;&#41;&#32;&#61;&#32;&#69;&#92;&#123;&#32;&#88;&#40;&#116;&#95;&#49;&#41;&#32;&#88;&#40;&#116;&#95;&#50;&#41;&#92;&#125;&#32;&#61;&#32;&#92;&#105;&#110;&#116;&#95;&#123;&#45;&#92;&#105;&#110;&#102;&#116;&#121;&#125;&#94;&#123;&#92;&#105;&#110;&#102;&#116;&#121;&#125;&#32;&#120;&#95;&#49;&#32;&#120;&#95;&#50;&#32;&#102;&#40;&#120;&#95;&#49;&#44;&#120;&#95;&#50;&#59;&#116;&#95;&#49;&#44;&#116;&#95;&#50;&#41;&#100;&#120;&#95;&#49;&#32;&#100;&#120;&#95;&#50;&#92;&#92; &#92;&#92; &#38;&#92;&#116;&#101;&#120;&#116;&#123;&#65;&#117;&#116;&#111;&#99;&#111;&#118;&#97;&#114;&#105;&#97;&#110;&#99;&#101;&#125;&#32;&#92;&#92; &#38;&#67;&#40;&#116;&#95;&#49;&#44;&#116;&#95;&#50;&#41;&#32;&#61;&#32;&#69;&#92;&#123;&#91;&#88;&#40;&#116;&#95;&#49;&#41;&#32;&#45;&#32;&#92;&#109;&#117;&#40;&#116;&#95;&#49;&#41;&#32;&#93;&#32;&#91;&#88;&#40;&#116;&#95;&#50;&#41;&#32;&#45;&#32;&#92;&#109;&#117;&#40;&#116;&#95;&#50;&#41;&#93;&#92;&#125;&#32;&#61;&#32;&#82;&#40;&#116;&#95;&#49;&#44;&#116;&#95;&#50;&#41;&#32;&#45;&#32;&#92;&#109;&#117;&#40;&#116;&#95;&#49;&#41;&#32;&#92;&#109;&#117;&#40;&#116;&#95;&#50;&#41; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Simulating the Schwartz type 1 stochastic process</h3>
<p>The Schwartz type 1 model is a log price Ornstein-Uhlenbeck stochastic process. Monte Carlo simulation of the model can be done using the equation above. The above equation is an exact solution of the model, this means that the distribution of the simulation is exact, and that time steps can be any size.</p>
<p class="ql-center-displayed-equation" style="line-height: 95px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-d1f519954f23f36a7a7cf9359e2dc068_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#92;&#108;&#110;&#32;&#83;&#95;&#116;&#32;&#92;&#115;&#105;&#109;&#38;&#92;&#59;&#32;&#101;&#94;&#123;&#45;&#92;&#107;&#97;&#112;&#112;&#97;&#32;&#116;&#125;&#92;&#108;&#110;&#32;&#83;&#95;&#48;&#43;&#92;&#108;&#101;&#102;&#116;&#40;&#49;&#45;&#101;&#94;&#123;&#45;&#92;&#107;&#97;&#112;&#112;&#97;&#32;&#116;&#125;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#92;&#108;&#101;&#102;&#116;&#40;&#92;&#109;&#117;&#45;&#92;&#102;&#114;&#97;&#99;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#125;&#123;&#50;&#92;&#107;&#97;&#112;&#112;&#97;&#125;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#92;&#92; &#38;&#43;&#92;&#115;&#105;&#103;&#109;&#97;&#32;&#92;&#115;&#113;&#114;&#116;&#123;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#45;&#101;&#94;&#123;&#45;&#50;&#92;&#107;&#97;&#112;&#112;&#97;&#32;&#116;&#125;&#125;&#123;&#50;&#92;&#107;&#97;&#112;&#112;&#97;&#125;&#125;&#78;&#95;&#123;&#48;&#44;&#49;&#125; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Calibrating the Schwartz type 1 model</h3>
<p>The Schwartz type 1 model is a log price Ornstein-Uhlenbeck stochastic process. The calibration can be done through a regression of the logprices as described in the above equation.</p>
<p class="ql-center-displayed-equation" style="line-height: 346px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-9badcf111b3ff7944a2214f546a89428_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#38;&#92;&#116;&#101;&#120;&#116;&#123;&#116;&#104;&#101;&#32;&#83;&#99;&#104;&#119;&#97;&#114;&#116;&#122;&#32;&#116;&#121;&#112;&#101;&#32;&#49;&#32;&#109;&#111;&#100;&#101;&#108;&#32;&#105;&#115;&#32;&#100;&#101;&#102;&#105;&#110;&#101;&#100;&#32;&#97;&#115;&#58;&#125;&#92;&#92; &#38;&#100;&#83;&#95;&#116;&#32;&#61;&#92;&#59;&#32;&#92;&#107;&#97;&#112;&#112;&#97;&#32;&#40;&#92;&#109;&#117;&#45;&#92;&#108;&#110;&#32;&#83;&#95;&#116;&#41;&#32;&#83;&#95;&#116;&#32;&#100;&#116;&#32;&#43;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#32;&#83;&#95;&#116;&#100;&#87;&#32;&#92;&#92; &#92;&#92; &#38;&#92;&#116;&#101;&#120;&#116;&#123;&#67;&#97;&#108;&#105;&#98;&#114;&#97;&#116;&#105;&#111;&#110;&#32;&#99;&#97;&#110;&#32;&#98;&#101;&#32;&#100;&#111;&#110;&#101;&#32;&#116;&#104;&#114;&#111;&#117;&#103;&#104;&#32;&#97;&#32;&#108;&#105;&#110;&#101;&#97;&#114;&#32;&#125;&#92;&#92; &#38;&#92;&#116;&#101;&#120;&#116;&#123;&#114;&#101;&#103;&#114;&#101;&#115;&#115;&#105;&#111;&#110;&#32;&#119;&#104;&#105;&#99;&#104;&#32;&#114;&#101;&#99;&#111;&#118;&#101;&#114;&#32;&#97;&#44;&#98;&#44;&#99;&#32;&#102;&#114;&#111;&#109;&#58;&#125;&#92;&#92; &#38;&#92;&#108;&#110;&#32;&#83;&#95;&#123;&#116;&#43;&#92;&#100;&#101;&#108;&#116;&#97;&#32;&#116;&#125;&#61;&#97;&#92;&#108;&#110;&#32;&#83;&#95;&#116;&#43;&#98;&#43;&#99;&#78;&#95;&#123;&#48;&#44;&#49;&#125;&#92;&#92; &#92;&#92; &#38;&#92;&#116;&#101;&#120;&#116;&#123;&#84;&#104;&#101;&#32;&#109;&#111;&#100;&#101;&#108;&#32;&#112;&#97;&#114;&#97;&#109;&#101;&#116;&#101;&#114;&#115;&#32;&#97;&#114;&#101;&#32;&#116;&#104;&#101;&#110;&#32;&#103;&#105;&#118;&#101;&#110;&#32;&#98;&#121;&#58;&#125;&#92;&#92; &#38;&#92;&#107;&#97;&#112;&#112;&#97;&#32;&#61;&#32;&#45;&#92;&#102;&#114;&#97;&#99;&#123;&#92;&#108;&#110;&#32;&#97;&#125;&#123;&#92;&#100;&#101;&#108;&#116;&#97;&#32;&#116;&#125;&#92;&#92; &#38;&#92;&#115;&#105;&#103;&#109;&#97;&#32;&#61;&#32;&#99;&#32;&#92;&#115;&#113;&#114;&#116;&#123;&#92;&#102;&#114;&#97;&#99;&#123;&#50;&#92;&#107;&#97;&#112;&#112;&#97;&#125;&#123;&#49;&#45;&#101;&#94;&#123;&#45;&#50;&#92;&#107;&#97;&#112;&#112;&#97;&#32;&#92;&#100;&#101;&#108;&#116;&#97;&#32;&#116;&#125;&#125;&#125;&#92;&#92; &#38;&#32;&#92;&#109;&#117;&#32;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#98;&#125;&#123;&#49;&#45;&#101;&#94;&#123;&#45;&#92;&#107;&#97;&#112;&#112;&#97;&#32;&#92;&#100;&#101;&#108;&#116;&#97;&#125;&#125;&#43;&#92;&#102;&#114;&#97;&#99;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#125;&#123;&#50;&#92;&#107;&#97;&#112;&#112;&#97;&#125; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Complex process</h3>
<p>note:</p>
<p class="ql-center-displayed-equation" style="line-height: 153px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-e48296c6ba63db5fc2349ca013d511a6_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#38;&#92;&#116;&#101;&#120;&#116;&#123;&#67;&#111;&#109;&#112;&#108;&#101;&#120;&#32;&#112;&#114;&#111;&#99;&#101;&#115;&#115;&#58;&#125;&#92;&#92; &#38;&#90;&#40;&#116;&#41;&#32;&#61;&#32;&#85;&#40;&#116;&#41;&#32;&#43;&#32;&#106;&#86;&#40;&#116;&#41;&#92;&#92; &#38;&#92;&#116;&#101;&#120;&#116;&#123;&#65;&#117;&#116;&#111;&#99;&#111;&#114;&#114;&#101;&#108;&#97;&#116;&#105;&#111;&#110;&#32;&#111;&#102;&#32;&#99;&#111;&#109;&#112;&#108;&#101;&#120;&#32;&#112;&#114;&#111;&#99;&#101;&#115;&#115;&#32;&#90;&#58;&#125;&#92;&#92; &#38;&#82;&#95;&#122;&#40;&#116;&#95;&#49;&#44;&#116;&#95;&#50;&#41;&#32;&#61;&#32;&#69;&#92;&#123;&#32;&#90;&#40;&#116;&#95;&#49;&#41;&#32;&#90;&#94;&#42;&#40;&#116;&#95;&#50;&#41;&#92;&#125;&#92;&#92; &#38;&#92;&#116;&#101;&#120;&#116;&#123;&#67;&#114;&#111;&#115;&#115;&#99;&#111;&#114;&#114;&#101;&#108;&#97;&#116;&#105;&#111;&#110;&#32;&#111;&#102;&#32;&#99;&#111;&#109;&#112;&#108;&#101;&#120;&#32;&#112;&#114;&#111;&#99;&#101;&#115;&#115;&#101;&#115;&#32;&#88;&#32;&#97;&#110;&#100;&#32;&#89;&#58;&#125;&#92;&#92; &#38;&#82;&#95;&#123;&#120;&#121;&#125;&#40;&#116;&#95;&#49;&#44;&#116;&#95;&#50;&#41;&#32;&#61;&#32;&#69;&#92;&#123;&#32;&#88;&#40;&#116;&#95;&#49;&#41;&#32;&#89;&#94;&#42;&#40;&#116;&#95;&#50;&#41;&#92;&#125; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>(r,s)-Fold Trimmed Mean Filters</h3>
<p>Short the samples in the window and omit r first samples and s last samples</p>
<p class="ql-center-displayed-equation" style="line-height: 53px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-50ce9ba1d4dde7a979befdb66b57b1fc_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#92;&#116;&#101;&#120;&#116;&#123;&#84;&#114;&#77;&#101;&#97;&#110;&#125;&#40;&#92;&#116;&#101;&#120;&#116;&#98;&#102;&#32;&#120;&#32;&#61;&#32;&#92;&#123;&#120;&#40;&#49;&#41;&#44;&#32;&#120;&#40;&#50;&#41;&#44;&#32;&#92;&#108;&#100;&#111;&#116;&#115;&#44;&#32;&#120;&#40;&#78;&#41;&#92;&#125;&#32;&#59;&#32;&#114;&#44;&#115;&#41;&#32;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#78;&#45;&#114;&#45;&#115;&#125;&#32;&#92;&#115;&#117;&#109;&#95;&#123;&#105;&#32;&#61;&#32;&#114;&#43;&#49;&#125;&#94;&#123;&#78;&#45;&#115;&#125;&#32;&#120;&#40;&#105;&#41; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sitmo.com/article/some-usefull-definitions-for-stochastic-processes/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>An Internally Consistent Interpolation Method for Yield Curves</title>
		<link>http://www.sitmo.com/article/an-internally-consistent-interpolation-method-for-yield-curves/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=an-internally-consistent-interpolation-method-for-yield-curves</link>
		<comments>http://www.sitmo.com/article/an-internally-consistent-interpolation-method-for-yield-curves/#comments</comments>
		<pubDate>Fri, 11 Nov 2011 08:07:50 +0000</pubDate>
		<dc:creator>Thijs van den Berg</dc:creator>
				<category><![CDATA[Client Projects]]></category>
		<category><![CDATA[Equations]]></category>
		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://www.sitmo.com/?p=660</guid>
		<description><![CDATA[Here we present a new yield curve interpolation method, one that&#8217;s based on conditioning a stochastic model on a set of market yields. The concept is closely related to a Brownian bridge where you generate scenario according to an SDE, but with the extra condition that the start and end of the scenario&#8217;s must have [...]]]></description>
			<content:encoded><![CDATA[<p>Here we present a new yield curve interpolation method, one that&#8217;s based on conditioning a stochastic model on a set of market yields. The concept is closely related to a Brownian bridge where you generate scenario according to an SDE, but  with the extra condition that the start and end of the scenario&#8217;s must have certain values. In this article we use Gaussian process regression to generalization the Brownian bridge and allows for more complicated conditions. As an example we condition the Vasicek spot interest rate model on a set of yield constraints, and give analytical solution.</p>
<p><span id="more-660"></span></p>
<hr />
<blockquote><p>
Note: You can now download an Excel worksheet containing the model<br />
<a href="http://www.sitmo.com/wp-content/uploads/2012/01/SitmoVasicekInterpolation.xls">SitmoVasicekInterpolation.xls</a>
</p></blockquote>
<hr />
<p>The resulting model output can be used for various purposes:</p>
<ul>
<li>Monte Carlo scenario generation</li>
<li>Yield curve interpolation</li>
<li>Estimating optimal hedges, and the associated risk  for non tradable products</li>
</ul>
<p>In general this technique gives an analytical solution of the conditional scenario pdf.<br />
Scenario generation can be accomplished by sampling from that distribution. A different<br />
application is to calculate the average yield as a function of maturity (the average of<br />
the scenario&#8217;s), which can be viewed as a interpolation method. Yet another applications is to use the relationships between yield to estimate hedges based on the relationship between interpolated yields and the available yields from quoted products.</p>
<h3>The Vasicek SDE</h3>
<p>We use the following notation for the Vasicek SDE rate model </p>
<p class="ql-center-displayed-equation" style="line-height: 18px;"><span class="ql-right-eqno"> (1) </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-3f96ba94bf65a1afef2fed41cd66588c_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#101;&#113;&#117;&#97;&#116;&#105;&#111;&#110;&#42;&#125; &#100;&#114;&#95;&#116;&#32;&#61;&#32;&#107;&#40;&#92;&#84;&#104;&#101;&#116;&#97;&#32;&#45;&#32;&#114;&#95;&#116;&#41;&#43;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#32;&#100;&#87;&#95;&#116; &#92;&#101;&#110;&#100;&#123;&#101;&#113;&#117;&#97;&#116;&#105;&#111;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<div id="attachment_656" class="wp-caption aligncenter" style="width: 477px"><a href="http://www.sitmo.com/wp-content/uploads/2011/11/vasicek-rate.png"><img src="http://www.sitmo.com/wp-content/uploads/2011/11/vasicek-rate.png" alt="" title="vasicek rate" width="467" height="276" class="size-full wp-image-656" /></a><p class="wp-caption-text">The spot rate distribution of the Vasicek model. The green line mu is the long term mean,  blue line is the average forward rate, the three red lines are random scenario's, the blue  area is the 95% confidence interval.</p></div>
<h3>Properties of the rate</h3>
<p>the rate <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-1338aa9058f7cdecedabbe4dcb023753_l3.png" class="ql-img-inline-formula" alt="&#114;&#95;&#116;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/> has has the following properties</p>
<p class="ql-center-displayed-equation" style="line-height: 119px;"><span class="ql-right-eqno"> (2) </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-4964687bd24dcc9952d9c65e0316896c_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#69;&#91;&#114;&#95;&#116;&#32;&#124;&#32;&#114;&#95;&#48;&#93;&#32;&#38;&#61;&#32;&#101;&#94;&#123;&#45;&#107;&#116;&#125;&#91;&#114;&#95;&#48;&#32;&#43;&#32;&#92;&#84;&#104;&#101;&#116;&#97;&#32;&#40;&#101;&#94;&#123;&#107;&#116;&#125;&#32;&#45;&#49;&#41;&#93;&#32;&#92;&#92; &#92;&#116;&#101;&#120;&#116;&#123;&#86;&#97;&#114;&#125;&#91;&#114;&#95;&#116;&#93;&#32;&#38;&#61;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#32;&#92;&#108;&#101;&#102;&#116;&#40;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#32;&#45;&#32;&#101;&#94;&#123;&#45;&#50;&#107;&#116;&#125;&#125;&#123;&#50;&#107;&#125;&#32;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#32;&#92;&#110;&#111;&#110;&#117;&#109;&#98;&#101;&#114;&#32;&#92;&#92; &#92;&#116;&#101;&#120;&#116;&#123;&#67;&#111;&#118;&#125;&#91;&#114;&#95;&#116;&#44;&#114;&#95;&#117;&#93;&#32;&#38;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#125;&#123;&#50;&#107;&#125;&#32;&#101;&#94;&#123;&#45;&#107;&#40;&#116;&#43;&#117;&#41;&#125;&#32;&#92;&#108;&#101;&#102;&#116;&#40;&#101;&#94;&#123;&#50;&#107;&#92;&#109;&#105;&#110;&#40;&#116;&#44;&#117;&#41;&#125;&#32;&#45;&#49;&#32;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#32;&#92;&#110;&#111;&#110;&#117;&#109;&#98;&#101;&#114; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Properties of the Yield</h3>
<p>With a Gaussian spot, the yield <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-2cb009cbcb5be98b4377a3c6918e17be_l3.png" class="ql-img-inline-formula" alt="&#89;&#95;&#116;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/> can be shown to be Gaussian too. The yield is defined as<br />
-the average compounded rate during the time interval up to <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-b4e3cbf5d4c5c6d9b702dd139f14c147_l3.png" class="ql-img-inline-formula" alt="&#116;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/>-</p>
<p class="ql-center-displayed-equation" style="line-height: 44px;"><span class="ql-right-eqno"> (3) </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-f55a282db8e8887ab87b6627ff43f9c7_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#101;&#113;&#117;&#97;&#116;&#105;&#111;&#110;&#42;&#125; &#89;&#95;&#116;&#32;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#116;&#125;&#32;&#92;&#105;&#110;&#116;&#95;&#48;&#94;&#116;&#32;&#114;&#95;&#117;&#32;&#100;&#117; &#92;&#101;&#110;&#100;&#123;&#101;&#113;&#117;&#97;&#116;&#105;&#111;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<div id="attachment_657" class="wp-caption aligncenter" style="width: 481px"><a href="http://www.sitmo.com/wp-content/uploads/2011/11/vasicek-yield.png"><img src="http://www.sitmo.com/wp-content/uploads/2011/11/vasicek-yield.png" alt="" title="vasicek yield" width="471" height="273" class="size-full wp-image-657" /></a><p class="wp-caption-text">The yield of the Vasicek spot rate model. It looks similar to the spot rate except that it's less volatile due to the averaging.</p></div>
<p>The yield It has these properties<br />
<a name="id4193000454"></a>
<p class="ql-center-displayed-equation" style="line-height: 127px;"><span class="ql-right-eqno"> (4) </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-e35591c5d7cb6fa9b92bff8d32aea275_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#69;&#91;&#89;&#95;&#116;&#93;&#32;&#38;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#114;&#95;&#48;&#32;&#45;&#32;&#92;&#84;&#104;&#101;&#116;&#97;&#125;&#123;&#107;&#116;&#125;&#32;&#92;&#108;&#101;&#102;&#116;&#40;&#101;&#94;&#123;&#45;&#107;&#116;&#125;&#32;&#45;&#49;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#32;&#43;&#32;&#92;&#84;&#104;&#101;&#116;&#97;&#32;&#32;&#92;&#92; &#92;&#116;&#101;&#120;&#116;&#123;&#86;&#97;&#114;&#125;&#91;&#89;&#95;&#116;&#93;&#32;&#38;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#125;&#123;&#50;&#107;&#94;&#51;&#32;&#116;&#94;&#50;&#125;&#32;&#92;&#108;&#101;&#102;&#116;&#40;&#32;&#50;&#107;&#116;&#32;&#45;&#51;&#32;&#43;&#52;&#101;&#94;&#123;&#45;&#107;&#116;&#125;&#32;&#45;&#101;&#94;&#123;&#45;&#50;&#107;&#116;&#125;&#32;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#32;&#92;&#110;&#111;&#110;&#117;&#109;&#98;&#101;&#114;&#32;&#92;&#92; &#92;&#116;&#101;&#120;&#116;&#123;&#67;&#111;&#118;&#125;&#91;&#89;&#95;&#116;&#44;&#89;&#95;&#117;&#93;&#32;&#38;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#125;&#123;&#50;&#107;&#94;&#51;&#32;&#116;&#32;&#117;&#32;&#125;&#92;&#108;&#101;&#102;&#116;&#32;&#40;&#32;&#50;&#107;&#116;&#32;&#45;&#50;&#32;&#43;&#32;&#50;&#101;&#94;&#123;&#45;&#107;&#116;&#125;&#32;&#43;&#50;&#101;&#94;&#123;&#45;&#107;&#117;&#125;&#32;&#45;&#101;&#94;&#123;&#107;&#40;&#116;&#43;&#117;&#41;&#125;&#45;&#101;&#94;&#123;&#45;&#107;&#40;&#116;&#43;&#117;&#41;&#125;&#32;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#32;&#92;&#116;&#101;&#120;&#116;&#123;&#32;&#102;&#111;&#114;&#32;&#125;&#116;&#60;&#117;&#32;&#92;&#110;&#111;&#110;&#117;&#109;&#98;&#101;&#114; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<p>the Cov is solved using this relation</p>
<p class="ql-center-displayed-equation" style="line-height: 40px;"><span class="ql-right-eqno"> (5) </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-a4046588af8f8fa66968e2a075670faa_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#101;&#113;&#117;&#97;&#116;&#105;&#111;&#110;&#42;&#125; &#92;&#116;&#101;&#120;&#116;&#123;&#67;&#111;&#118;&#125;&#91;&#92;&#105;&#110;&#116;&#32;&#114;&#95;&#116;&#32;&#100;&#116;&#32;&#44;&#32;&#92;&#105;&#110;&#116;&#32;&#114;&#95;&#117;&#32;&#100;&#117;&#93;&#32;&#61;&#32;&#92;&#105;&#110;&#116;&#32;&#92;&#105;&#110;&#116;&#32;&#92;&#116;&#101;&#120;&#116;&#123;&#67;&#111;&#118;&#125;&#91;&#114;&#95;&#116;&#44;&#114;&#95;&#117;&#93;&#32;&#100;&#116;&#32;&#100;&#117;&#32; &#92;&#101;&#110;&#100;&#123;&#101;&#113;&#117;&#97;&#116;&#105;&#111;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>The Yield as a Gaussian</h3>
<p>Let <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-792f8896440bc2a0ed4bfd1ead47d762_l3.png" class="ql-img-inline-formula" alt="&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#89;&#125;&#61;&#32;&#92;&#123;&#89;&#95;&#123;&#116;&#95;&#49;&#125;&#44;&#32;&#89;&#95;&#123;&#116;&#95;&#50;&#125;&#44;&#32;&#92;&#108;&#100;&#111;&#116;&#115;&#32;&#89;&#95;&#123;&#116;&#95;&#100;&#125;&#32;&#92;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -5px;"/> be the yield at a <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-4e8716946f6a868f015e0d62f28bc540_l3.png" class="ql-img-inline-formula" alt="&#100;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> points in time.<br />
To simplify notation, let <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-8c0c532309cda66ce7a5ab187c354b77_l3.png" class="ql-img-inline-formula" alt="&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#92;&#109;&#117;&#125;&#61;&#69;&#91;&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#89;&#125;&#93;" title="Rendered by QuickLaTeX.com" style="vertical-align: -5px;"/> and <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-3cfa32b20210208fb9125985213f4b84_l3.png" class="ql-img-inline-formula" alt="&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#92;&#83;&#105;&#103;&#109;&#97;&#125;&#61;&#92;&#116;&#101;&#120;&#116;&#123;&#67;&#111;&#118;&#125;&#91;&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#89;&#125;&#44;&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#89;&#125;&#93;" title="Rendered by QuickLaTeX.com" style="vertical-align: -5px;"/>.<br />
From the result we know that these yields will have a <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-4e8716946f6a868f015e0d62f28bc540_l3.png" class="ql-img-inline-formula" alt="&#100;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> dimensional Gaussian distribution.</p>
<p class="ql-center-displayed-equation" style="line-height: 18px;"><span class="ql-right-eqno"> (6) </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-16545406ab3af7d088bbfff50e97705b_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#101;&#113;&#117;&#97;&#116;&#105;&#111;&#110;&#42;&#125; &#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#89;&#125; &#92;&#115;&#105;&#109; &#92;&#109;&#97;&#116;&#104;&#99;&#97;&#108;&#123;&#78;&#125; &#92;&#108;&#101;&#102;&#116;&#40;&#32;&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#92;&#109;&#117;&#125;&#44;&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#92;&#83;&#105;&#103;&#109;&#97;&#125; &#92;&#114;&#105;&#103;&#104;&#116;&#41; &#92;&#101;&#110;&#100;&#123;&#101;&#113;&#117;&#97;&#116;&#105;&#111;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Conditional Distribution of a Gaussian</h3>
<p>The <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-4e8716946f6a868f015e0d62f28bc540_l3.png" class="ql-img-inline-formula" alt="&#100;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/>-dimensional Gaussian probability density functions is given by:</p>
<p class="ql-center-displayed-equation" style="line-height: 49px;"><span class="ql-right-eqno"> (7) </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-b78f40a8a8db355e806679c494ed15ca_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#101;&#113;&#117;&#97;&#116;&#105;&#111;&#110;&#42;&#125; &#92;&#109;&#97;&#116;&#104;&#99;&#97;&#108;&#123;&#78;&#125;&#40;&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#89;&#125;&#44;&#32;&#92;&#98;&#111;&#108;&#100;&#115;&#121;&#109;&#98;&#111;&#108;&#123;&#92;&#109;&#117;&#125;&#44;&#32;&#92;&#98;&#111;&#108;&#100;&#115;&#121;&#109;&#98;&#111;&#108;&#123;&#92;&#83;&#105;&#103;&#109;&#97;&#125;&#41;&#32;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#92;&#101;&#120;&#112;&#92;&#108;&#101;&#102;&#116;&#91;&#32;&#92;&#116;&#101;&#120;&#116;&#115;&#116;&#121;&#108;&#101;&#45;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#50;&#125;&#40;&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#89;&#125;&#45;&#92;&#98;&#111;&#108;&#100;&#115;&#121;&#109;&#98;&#111;&#108;&#123;&#92;&#109;&#117;&#125;&#41;&#94;&#84;&#32;&#92;&#98;&#111;&#108;&#100;&#115;&#121;&#109;&#98;&#111;&#108;&#123;&#92;&#83;&#105;&#103;&#109;&#97;&#125;&#94;&#123;&#45;&#49;&#125;&#32;&#40;&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#89;&#125;&#45;&#92;&#98;&#111;&#108;&#100;&#115;&#121;&#109;&#98;&#111;&#108;&#123;&#92;&#109;&#117;&#125;&#41;&#32;&#92;&#114;&#105;&#103;&#104;&#116;&#93;&#125;&#32;&#123;&#92;&#115;&#113;&#114;&#116;&#123;&#40;&#50;&#92;&#112;&#105;&#41;&#94;&#100;&#124;&#92;&#98;&#111;&#108;&#100;&#115;&#121;&#109;&#98;&#111;&#108;&#123;&#92;&#83;&#105;&#103;&#109;&#97;&#125;&#124;&#125;&#125; &#92;&#101;&#110;&#100;&#123;&#101;&#113;&#117;&#97;&#116;&#105;&#111;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<p>with the distribution parameters <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-c5713d1d9330bb12c39c3cfaa846b977_l3.png" class="ql-img-inline-formula" alt="&#92;&#98;&#111;&#108;&#100;&#115;&#121;&#109;&#98;&#111;&#108;&#123;&#92;&#109;&#117;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> the mean vector, <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-694cdbc8f78038d0eb53cc86377fb95c_l3.png" class="ql-img-inline-formula" alt="&#92;&#98;&#111;&#108;&#100;&#115;&#121;&#109;&#98;&#111;&#108;&#123;&#92;&#83;&#105;&#103;&#109;&#97;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> the covariance matrix, and <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-61c10102f53254961bc70349070221fc_l3.png" class="ql-img-inline-formula" alt="&#124;&#92;&#98;&#111;&#108;&#100;&#115;&#121;&#109;&#98;&#111;&#108;&#123;&#92;&#83;&#105;&#103;&#109;&#97;&#125;&#124;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> the determinant of <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-694cdbc8f78038d0eb53cc86377fb95c_l3.png" class="ql-img-inline-formula" alt="&#92;&#98;&#111;&#108;&#100;&#115;&#121;&#109;&#98;&#111;&#108;&#123;&#92;&#83;&#105;&#103;&#109;&#97;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/>.</p>
<p>Let <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-86be4636dfd3427e20cd5ea889aa1a8b_l3.png" class="ql-img-inline-formula" alt="&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#89;&#125;&#44;&#92;&#98;&#111;&#108;&#100;&#115;&#121;&#109;&#98;&#111;&#108;&#123;&#92;&#109;&#117;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> and <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-694cdbc8f78038d0eb53cc86377fb95c_l3.png" class="ql-img-inline-formula" alt="&#92;&#98;&#111;&#108;&#100;&#115;&#121;&#109;&#98;&#111;&#108;&#123;&#92;&#83;&#105;&#103;&#109;&#97;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> be partitioned into a set of free variable<br />
<img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-c1f4d30ca25b6ed949730a934a318644_l3.png" class="ql-img-inline-formula" alt="&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#102;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -1px;"/>, and a set of conditioning variables <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-99cf613a035549e818807a37bbcac148_l3.png" class="ql-img-inline-formula" alt="&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#122;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> with known fixed values.</p>
<p class="ql-center-displayed-equation" style="line-height: 43px;"><span class="ql-right-eqno"> (8) </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-48fc69b7a0f25aac6a1ff7734f996744_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#101;&#113;&#117;&#97;&#116;&#105;&#111;&#110;&#42;&#125; &#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#89;&#125;&#61; &#92;&#108;&#101;&#102;&#116;&#91; &#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#114;&#114;&#97;&#121;&#125;&#123;&#99;&#125; &#32;&#32;&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#122;&#125;&#32;&#92;&#92; &#32;&#32;&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#102;&#125; &#92;&#101;&#110;&#100;&#123;&#97;&#114;&#114;&#97;&#121;&#125; &#92;&#114;&#105;&#103;&#104;&#116;&#93; &#92;&#115;&#105;&#109; &#92;&#109;&#97;&#116;&#104;&#99;&#97;&#108;&#123;&#78;&#125; &#92;&#108;&#101;&#102;&#116;&#40; &#92;&#108;&#101;&#102;&#116;&#91; &#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#114;&#114;&#97;&#121;&#125;&#123;&#99;&#125; &#32;&#32;&#92;&#98;&#111;&#108;&#100;&#115;&#121;&#109;&#98;&#111;&#108;&#123;&#92;&#109;&#117;&#95;&#122;&#125;&#32;&#92;&#92; &#32;&#32;&#92;&#98;&#111;&#108;&#100;&#115;&#121;&#109;&#98;&#111;&#108;&#123;&#92;&#109;&#117;&#95;&#102;&#125; &#92;&#101;&#110;&#100;&#123;&#97;&#114;&#114;&#97;&#121;&#125; &#92;&#114;&#105;&#103;&#104;&#116;&#93; &#44; &#92;&#108;&#101;&#102;&#116;&#91; &#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#114;&#114;&#97;&#121;&#125;&#123;&#99;&#99;&#125; &#32;&#32;&#92;&#98;&#111;&#108;&#100;&#115;&#121;&#109;&#98;&#111;&#108;&#123;&#92;&#83;&#105;&#103;&#109;&#97;&#95;&#123;&#122;&#122;&#125;&#125;&#32;&#38;&#32;&#92;&#98;&#111;&#108;&#100;&#115;&#121;&#109;&#98;&#111;&#108;&#123;&#92;&#83;&#105;&#103;&#109;&#97;&#95;&#123;&#122;&#102;&#125;&#125;&#32;&#92;&#92; &#32;&#32;&#92;&#98;&#111;&#108;&#100;&#115;&#121;&#109;&#98;&#111;&#108;&#123;&#92;&#83;&#105;&#103;&#109;&#97;&#95;&#123;&#102;&#122;&#125;&#125;&#32;&#38;&#32;&#92;&#98;&#111;&#108;&#100;&#115;&#121;&#109;&#98;&#111;&#108;&#123;&#92;&#83;&#105;&#103;&#109;&#97;&#95;&#123;&#102;&#102;&#125;&#125; &#92;&#101;&#110;&#100;&#123;&#97;&#114;&#114;&#97;&#121;&#125; &#92;&#114;&#105;&#103;&#104;&#116;&#93; &#92;&#114;&#105;&#103;&#104;&#116;&#41; &#92;&#101;&#110;&#100;&#123;&#101;&#113;&#117;&#97;&#116;&#105;&#111;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<p>The conditional density function <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-dee5823b88d5de78437c6646a80f24e6_l3.png" class="ql-img-inline-formula" alt="&#92;&#98;&#111;&#108;&#100;&#115;&#121;&#109;&#98;&#111;&#108;&#123;&#102;&#125;&#32;&#124;&#32;&#32;&#92;&#98;&#111;&#108;&#100;&#115;&#121;&#109;&#98;&#111;&#108;&#123;&#122;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> of the multivariate Gaussian density is given as</p>
<p class="ql-center-displayed-equation" style="line-height: 22px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-1c5a94b91eec32f2f421d7ba90f0644f_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#101;&#113;&#117;&#97;&#116;&#105;&#111;&#110;&#42;&#125; &#32;&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#102;&#125;&#32;&#124;&#32;&#32;&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#122;&#125;&#32;&#92;&#115;&#105;&#109; &#32;&#92;&#109;&#97;&#116;&#104;&#99;&#97;&#108;&#123;&#78;&#125;&#40;&#32;&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#92;&#109;&#117;&#95;&#102;&#125;&#32;&#43;&#32;&#92;&#98;&#111;&#108;&#100;&#115;&#121;&#109;&#98;&#111;&#108;&#123;&#92;&#83;&#105;&#103;&#109;&#97;&#95;&#123;&#102;&#122;&#125;&#125;&#32;&#40;&#92;&#98;&#111;&#108;&#100;&#115;&#121;&#109;&#98;&#111;&#108;&#123;&#92;&#83;&#105;&#103;&#109;&#97;&#95;&#123;&#122;&#122;&#125;&#125;&#41;&#94;&#123;&#45;&#49;&#125;&#32;&#40;&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#122;&#125;&#32;&#45;&#32;&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#92;&#109;&#117;&#95;&#122;&#125;&#41;&#44;&#32;&#92;&#98;&#111;&#108;&#100;&#115;&#121;&#109;&#98;&#111;&#108;&#123;&#92;&#83;&#105;&#103;&#109;&#97;&#95;&#123;&#102;&#102;&#125;&#125;&#32;&#45;&#92;&#98;&#111;&#108;&#100;&#115;&#121;&#109;&#98;&#111;&#108;&#123;&#92;&#83;&#105;&#103;&#109;&#97;&#95;&#123;&#102;&#122;&#125;&#125;&#32;&#40;&#92;&#98;&#111;&#108;&#100;&#115;&#121;&#109;&#98;&#111;&#108;&#123;&#92;&#83;&#105;&#103;&#109;&#97;&#95;&#123;&#122;&#122;&#125;&#125;&#41;&#94;&#123;&#45;&#49;&#125;&#32;&#92;&#98;&#111;&#108;&#100;&#115;&#121;&#109;&#98;&#111;&#108;&#123;&#92;&#83;&#105;&#103;&#109;&#97;&#95;&#123;&#122;&#102;&#125;&#125;&#41; &#92;&#101;&#110;&#100;&#123;&#101;&#113;&#117;&#97;&#116;&#105;&#111;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<p>which can also be written as</p>
<p><a name="id3577759505"></a>
<p class="ql-center-displayed-equation" style="line-height: 105px;"><span class="ql-right-eqno"> (9) </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-546a8ca5f87a3da8a067d115fd75a892_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#32;&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#102;&#125;&#32;&#124;&#32;&#32;&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#122;&#125;&#32;&#38;&#92;&#115;&#105;&#109;&#32;&#92;&#109;&#97;&#116;&#104;&#99;&#97;&#108;&#123;&#78;&#125;&#40;&#99;&#95;&#49;&#32;&#32;&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#122;&#125;&#32;&#43;&#32;&#99;&#95;&#50;&#32;&#32;&#44;&#99;&#95;&#51;&#41;&#32;&#92;&#92; &#92;&#116;&#101;&#120;&#116;&#123;&#119;&#105;&#116;&#104;&#125;&#32;&#92;&#113;&#117;&#97;&#100; &#99;&#95;&#49;&#32;&#38;&#61;&#32;&#92;&#98;&#111;&#108;&#100;&#115;&#121;&#109;&#98;&#111;&#108;&#123;&#92;&#83;&#105;&#103;&#109;&#97;&#95;&#123;&#102;&#122;&#125;&#125;&#32;&#32;&#40;&#92;&#98;&#111;&#108;&#100;&#115;&#121;&#109;&#98;&#111;&#108;&#123;&#92;&#83;&#105;&#103;&#109;&#97;&#95;&#123;&#122;&#122;&#125;&#125;&#41;&#94;&#123;&#45;&#49;&#125;&#32;&#32;&#92;&#110;&#111;&#116;&#97;&#103;&#32;&#92;&#92; &#99;&#95;&#50;&#32;&#38;&#61;&#32;&#92;&#98;&#111;&#108;&#100;&#115;&#121;&#109;&#98;&#111;&#108;&#123;&#92;&#109;&#117;&#95;&#102;&#125;&#32;&#45;&#32;&#92;&#98;&#111;&#108;&#100;&#115;&#121;&#109;&#98;&#111;&#108;&#123;&#92;&#83;&#105;&#103;&#109;&#97;&#95;&#123;&#102;&#122;&#125;&#125;&#32;&#32;&#40;&#92;&#98;&#111;&#108;&#100;&#115;&#121;&#109;&#98;&#111;&#108;&#123;&#92;&#83;&#105;&#103;&#109;&#97;&#95;&#123;&#122;&#122;&#125;&#125;&#41;&#94;&#123;&#45;&#49;&#125;&#32;&#92;&#98;&#111;&#108;&#100;&#115;&#121;&#109;&#98;&#111;&#108;&#123;&#92;&#109;&#117;&#95;&#122;&#125;&#92;&#110;&#111;&#116;&#97;&#103;&#32;&#92;&#92; &#99;&#95;&#51;&#32;&#38;&#61;&#32;&#32;&#92;&#98;&#111;&#108;&#100;&#115;&#121;&#109;&#98;&#111;&#108;&#123;&#92;&#83;&#105;&#103;&#109;&#97;&#95;&#123;&#102;&#102;&#125;&#125;&#32;&#45;&#92;&#98;&#111;&#108;&#100;&#115;&#121;&#109;&#98;&#111;&#108;&#123;&#92;&#83;&#105;&#103;&#109;&#97;&#95;&#123;&#102;&#122;&#125;&#125;&#32;&#40;&#92;&#98;&#111;&#108;&#100;&#115;&#121;&#109;&#98;&#111;&#108;&#123;&#92;&#83;&#105;&#103;&#109;&#97;&#95;&#123;&#122;&#122;&#125;&#125;&#41;&#94;&#123;&#45;&#49;&#125;&#32;&#92;&#98;&#111;&#108;&#100;&#115;&#121;&#109;&#98;&#111;&#108;&#123;&#92;&#83;&#105;&#103;&#109;&#97;&#95;&#123;&#122;&#102;&#125;&#125;&#32;&#92;&#110;&#111;&#116;&#97;&#103; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Conditioning the Yield Distribution on a Set of Values</h3>
<p>We will now apply the conditioning equation (<a href="#id3577759505">9</a>) to the Gaussian yield solution<br />
of the vasicek model (<a href="#id4193000454">4</a>).<br />
The conditioning values <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-99cf613a035549e818807a37bbcac148_l3.png" class="ql-img-inline-formula" alt="&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#122;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> will be a set zero yields values obtained from zero coupon bonds, and the free variable(s) <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-c1f4d30ca25b6ed949730a934a318644_l3.png" class="ql-img-inline-formula" alt="&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#102;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -1px;"/> as parameterized functions that define the distribution of the yield curve in general -which we&#8217;ll use for interpolation, MC sampling etc.-.</p>
<p>A couple of interesting thing to note already based on equation (<a href="#id3577759505">9</a>) are:</p>
<ul>
<li>Looking at <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-e126f2c7de223e3fb320085c42dcb484_l3.png" class="ql-img-inline-formula" alt="&#99;&#95;&#49;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/>, the mean of the free variables depends linear on the conditioned values.</li>
<li>The variance of the free variables does not depend on the values of conditioning varaibles (<img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-95a4d822cdbcf5bb443d3095b870fdd7_l3.png" class="ql-img-inline-formula" alt="&#99;&#95;&#51;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/>).</li>
</ul>
<div id="attachment_653" class="wp-caption aligncenter" style="width: 480px"><a href="http://www.sitmo.com/wp-content/uploads/2011/11/conditioned-yield.png"><img src="http://www.sitmo.com/wp-content/uploads/2011/11/conditioned-yield.png" alt="" title="conditioned yield" width="470" height="265" class="size-full wp-image-653" /></a><p class="wp-caption-text">The mean yield and 95% probability intervals of the conditioned Vasicek model. The red dots are the market yield.</p></div>
<h3>Adding Variance to Future Yields</h3>
<p>The conditioned yield is not a very realistic model. It assumes an uncertain evolution of<br />
a stochastic spot rate, yet at the same time assumes that we know the yields for a set of future periods exactly. We can however very easily make the yields stochastic using the law<br />
of total probability (Bayes rules). </p>
<p class="ql-center-displayed-equation" style="line-height: 41px;"><span class="ql-right-eqno"> (10) </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-b4e7b375a57b3842ec6378f56bca2662_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#101;&#113;&#117;&#97;&#116;&#105;&#111;&#110;&#42;&#125; &#80;&#40;&#102;&#41;&#32;&#61;&#32;&#92;&#105;&#110;&#116;&#95;&#77;&#32;&#80;&#40;&#102;&#124;&#122;&#61;&#77;&#41;&#80;&#40;&#77;&#41;&#32;&#100;&#77; &#92;&#101;&#110;&#100;&#123;&#101;&#113;&#117;&#97;&#116;&#105;&#111;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<p>Assuming that a set of yields are multivariate Gaussian, i.e. </p>
<p class="ql-center-displayed-equation" style="line-height: 18px;"><span class="ql-right-eqno"> (11) </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-c0d8933886cb045c08eb66f29b7f4eb8_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#101;&#113;&#117;&#97;&#116;&#105;&#111;&#110;&#42;&#125; &#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#77;&#125; &#92;&#115;&#105;&#109; &#92;&#109;&#97;&#116;&#104;&#99;&#97;&#108;&#123;&#78;&#125; &#92;&#108;&#101;&#102;&#116;&#40;&#32;&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#92;&#109;&#117;&#95;&#77;&#125;&#44;&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#92;&#83;&#105;&#103;&#109;&#97;&#95;&#77;&#125; &#92;&#114;&#105;&#103;&#104;&#116;&#41; &#92;&#101;&#110;&#100;&#123;&#101;&#113;&#117;&#97;&#116;&#105;&#111;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<p>will result in a analytical, Gaussian solution</p>
<p class="ql-center-displayed-equation" style="line-height: 23px;"><span class="ql-right-eqno"> (12) </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-71a88d416d60e2e0e7bb43662114006e_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#101;&#113;&#117;&#97;&#116;&#105;&#111;&#110;&#42;&#125; &#80;&#40;&#32;&#102;&#32;&#124;&#32;&#122;&#32;&#61;&#32;&#77;&#32;&#41; &#92;&#115;&#105;&#109; &#92;&#109;&#97;&#116;&#104;&#99;&#97;&#108;&#123;&#78;&#125; &#92;&#108;&#101;&#102;&#116;&#40;&#32;&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#32;&#99;&#95;&#49;&#92;&#109;&#117;&#95;&#77;&#32;&#43;&#32;&#99;&#95;&#50;&#125;&#44;&#99;&#95;&#49;&#32;&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#92;&#83;&#105;&#103;&#109;&#97;&#95;&#77;&#125;&#32;&#99;&#95;&#49;&#94;&#84;&#32;&#43;&#99;&#95;&#51; &#92;&#114;&#105;&#103;&#104;&#116;&#41; &#92;&#101;&#110;&#100;&#123;&#101;&#113;&#117;&#97;&#116;&#105;&#111;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Final Result</h3>
<div id="attachment_655" class="wp-caption aligncenter" style="width: 480px"><a href="http://www.sitmo.com/wp-content/uploads/2011/11/vasicek-posterior.png"><img src="http://www.sitmo.com/wp-content/uploads/2011/11/vasicek-posterior.png" alt="" title="vasicek posterior" width="470" height="265" class="size-full wp-image-655" /></a><p class="wp-caption-text">The final result, the Vasicek yield distribution, with adjusted (displaced) yield distributions slipped in to make it marked adjusted.</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.sitmo.com/article/an-internally-consistent-interpolation-method-for-yield-curves/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Binomial and Trinomial Trees</title>
		<link>http://www.sitmo.com/article/binomial-and-trinomial-trees/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=binomial-and-trinomial-trees</link>
		<comments>http://www.sitmo.com/article/binomial-and-trinomial-trees/#comments</comments>
		<pubDate>Mon, 06 Jun 2011 21:45:58 +0000</pubDate>
		<dc:creator>Thijs van den Berg</dc:creator>
				<category><![CDATA[Equations]]></category>

		<guid isPermaLink="false">http://www.sitmo.com/?p=541</guid>
		<description><![CDATA[A list of popular binomial and trinomial tree used in finance for pricing options. Binomial Tree, geometric Brownian motion: Cox, Ross, Rubinstein The Binomial tree is a discretized description of geometric Brownian motion which is often used to describe asset behavior. The structure is a recombining tree where the asset S can move either up [...]]]></description>
			<content:encoded><![CDATA[<p>A list of popular binomial and trinomial tree used in finance for pricing options.<br />
<span id="more-541"></span></p>
<h3>Binomial Tree, geometric Brownian motion: Cox, Ross, Rubinstein</h3>
<p>The Binomial tree is a discretized description of geometric Brownian motion which is often used to describe asset behavior. The structure is a recombining tree where the asset S can move either up or down.</p>
<p class="ql-center-displayed-equation" style="line-height: 196px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-d9b13e982a9416cc66e17d89ff0d0c2c_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#117;&#38;&#61;&#101;&#94;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#32;&#92;&#115;&#113;&#114;&#116;&#123;&#116;&#125;&#125;&#32;&#92;&#92; &#100;&#38;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#117;&#125;&#32;&#61;&#32;&#101;&#94;&#123;&#45;&#92;&#115;&#105;&#103;&#109;&#97;&#32;&#92;&#115;&#113;&#114;&#116;&#123;&#116;&#125;&#125;&#32;&#92;&#92; &#83;&#95;&#117;&#32;&#38;&#61;&#32;&#83;&#32;&#46;&#32;&#117;&#92;&#92; &#83;&#95;&#100;&#32;&#38;&#61;&#32;&#83;&#46;&#32;&#100;&#32;&#92;&#92; &#112;&#95;&#117;&#38;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#101;&#94;&#123;&#89;&#116;&#125;&#45;&#100;&#125;&#123;&#117;&#32;&#45;&#32;&#100;&#125;&#92;&#92; &#112;&#95;&#115;&#38;&#61;&#49;&#45;&#112;&#95;&#117; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Trinomial Tree, geometric Brownian motion</h3>
<p>The Trinomial tree is a discretized description of geometric Brownian motion which is often used to describe asset behavior. The structure is a recombining tree where the asset S can move up, mid or down.</p>
<p class="ql-center-displayed-equation" style="line-height: 261px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-4ddf5fe3e938b3716fafce433d2f2391_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#117;&#38;&#61;&#101;&#94;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#32;&#92;&#115;&#113;&#114;&#116;&#123;&#50;&#116;&#125;&#125;&#44;&#92;&#59;&#92;&#59;&#32;&#109;&#61;&#49;&#44;&#32;&#92;&#59;&#92;&#59;&#32;&#100;&#61;&#32;&#101;&#94;&#123;&#45;&#92;&#115;&#105;&#103;&#109;&#97;&#32;&#92;&#115;&#113;&#114;&#116;&#123;&#50;&#116;&#125;&#125;&#32;&#92;&#92;&#32;&#92;&#92; &#83;&#95;&#117;&#32;&#38;&#61;&#32;&#83;&#32;&#46;&#32;&#117;&#44;&#32;&#92;&#59;&#92;&#59;&#83;&#95;&#109;&#32;&#61;&#32;&#83;&#44;&#32;&#92;&#59;&#92;&#59;&#83;&#95;&#100;&#32;&#61;&#32;&#83;&#46;&#32;&#100;&#32;&#92;&#92;&#32;&#92;&#92; &#112;&#95;&#117;&#38;&#61;&#92;&#108;&#101;&#102;&#116;&#40;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#101;&#94;&#123;&#89;&#116;&#47;&#50;&#125;&#32;&#45;&#32;&#101;&#94;&#123;&#45;&#92;&#115;&#105;&#103;&#109;&#97;&#32;&#92;&#115;&#113;&#114;&#116;&#123;&#116;&#47;&#50;&#125;&#125;&#125;&#123;&#101;&#94;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#32;&#92;&#115;&#113;&#114;&#116;&#123;&#116;&#47;&#50;&#125;&#125;&#45;&#101;&#94;&#123;&#45;&#92;&#115;&#105;&#103;&#109;&#97;&#32;&#92;&#115;&#113;&#114;&#116;&#123;&#116;&#47;&#50;&#125;&#125;&#125;&#32;&#32;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#94;&#50;&#92;&#92; &#112;&#95;&#100;&#38;&#61;&#92;&#108;&#101;&#102;&#116;&#40;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#101;&#94;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#32;&#92;&#115;&#113;&#114;&#116;&#123;&#116;&#47;&#50;&#125;&#125;&#45;&#32;&#101;&#94;&#123;&#89;&#116;&#47;&#50;&#125;&#32;&#32;&#125;&#123;&#101;&#94;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#32;&#92;&#115;&#113;&#114;&#116;&#123;&#116;&#47;&#50;&#125;&#125;&#45;&#101;&#94;&#123;&#45;&#92;&#115;&#105;&#103;&#109;&#97;&#32;&#92;&#115;&#113;&#114;&#116;&#123;&#116;&#47;&#50;&#125;&#125;&#125;&#32;&#32;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#94;&#50;&#92;&#92; &#112;&#95;&#109;&#38;&#61;&#49;&#45;&#112;&#95;&#117;&#45;&#112;&#95;&#100; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Binomial Tree, geometric Brownian motion: Jarrow, Rudd</h3>
<p>This is the Jarrow and Rudd version of the Binomial tree. The Binomial tree is a discretized description of geometric Brownian motion which is often used to describe asset behavior. The structure is a recombining tree where the asset S can move either up or down.</p>
<p class="ql-center-displayed-equation" style="line-height: 153px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-513355f1fe2e7f3155f66c0def5cfc3d_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#117;&#38;&#61;&#101;&#94;&#123;&#40;&#89;&#45;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#50;&#125;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#41;&#116;&#32;&#43;&#92;&#115;&#105;&#103;&#109;&#97;&#32;&#92;&#115;&#113;&#114;&#116;&#123;&#116;&#125;&#125;&#32;&#92;&#92; &#100;&#38;&#61;&#101;&#94;&#123;&#40;&#89;&#45;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#50;&#125;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#41;&#116;&#32;&#45;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#32;&#92;&#115;&#113;&#114;&#116;&#123;&#116;&#125;&#125;&#32;&#92;&#92; &#83;&#95;&#117;&#32;&#38;&#61;&#32;&#83;&#32;&#46;&#32;&#117;&#92;&#92; &#83;&#95;&#100;&#32;&#38;&#61;&#32;&#83;&#46;&#32;&#100;&#32;&#92;&#92; &#112;&#95;&#117;&#38;&#61;&#112;&#95;&#100;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#50;&#125; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Binomial Tree, geometric Brownian motion: Tian</h3>
<p>This is the Tian version of the Binomial tree. The Binomial tree is a discretized description of geometric Brownian motion which is often used to describe asset behavior. The structure is a recombining tree where the asset S can move either up or down.</p>
<p class="ql-center-displayed-equation" style="line-height: 199px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-47f872165276250febb6567364fe7f2c_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#117;&#38;&#61;&#92;&#116;&#101;&#120;&#116;&#115;&#116;&#121;&#108;&#101;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#50;&#125;&#92;&#100;&#105;&#115;&#112;&#108;&#97;&#121;&#115;&#116;&#121;&#108;&#101;&#32;&#101;&#94;&#123;&#40;&#89;&#43;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#41;&#116;&#125;&#32;&#92;&#108;&#101;&#102;&#116;&#40;&#101;&#94;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#116;&#125;&#32;&#43;&#49;&#32;&#43;&#32;&#92;&#115;&#113;&#114;&#116;&#123;&#101;&#94;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#52;&#116;&#94;&#50;&#125;&#32;&#43;&#32;&#50;&#101;&#94;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#116;&#125;&#45;&#51;&#125;&#32;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#32;&#92;&#92; &#100;&#38;&#61;&#92;&#116;&#101;&#120;&#116;&#115;&#116;&#121;&#108;&#101;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#50;&#125;&#92;&#100;&#105;&#115;&#112;&#108;&#97;&#121;&#115;&#116;&#121;&#108;&#101;&#32;&#101;&#94;&#123;&#40;&#89;&#43;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#41;&#116;&#125;&#32;&#92;&#108;&#101;&#102;&#116;&#40;&#101;&#94;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#116;&#125;&#32;&#43;&#49;&#32;&#45;&#92;&#115;&#113;&#114;&#116;&#123;&#101;&#94;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#52;&#116;&#94;&#50;&#125;&#32;&#43;&#32;&#50;&#101;&#94;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#116;&#125;&#45;&#51;&#125;&#32;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#32;&#92;&#92; &#83;&#95;&#117;&#32;&#38;&#61;&#32;&#83;&#32;&#46;&#32;&#117;&#92;&#92; &#83;&#95;&#100;&#32;&#38;&#61;&#32;&#83;&#46;&#32;&#100;&#32;&#92;&#92; &#112;&#95;&#117;&#38;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#101;&#94;&#123;&#89;&#116;&#125;&#45;&#100;&#125;&#123;&#117;&#32;&#45;&#32;&#100;&#125;&#92;&#92; &#112;&#95;&#100;&#38;&#61;&#49;&#45;&#112;&#95;&#117; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Binomial Tree, geometric Brownian motion: Trigeorgis</h3>
<p>This is the Trigeorgis version of the Binomial tree. The Binomial tree is a discretized description of geometric Brownian motion which is often used to describe asset behavior. The structure is a recombining tree where the asset S can move either up or down.</p>
<p class="ql-center-displayed-equation" style="line-height: 246px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-1138af04ae0db8112853390288b9a723_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#92;&#103;&#97;&#109;&#109;&#97;&#32;&#38;&#61;&#89;&#32;&#45;&#32;&#92;&#116;&#101;&#120;&#116;&#115;&#116;&#121;&#108;&#101;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#50;&#125;&#92;&#100;&#105;&#115;&#112;&#108;&#97;&#121;&#115;&#116;&#121;&#108;&#101;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#92;&#92; &#120;&#32;&#38;&#61;&#32;&#92;&#115;&#113;&#114;&#116;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#116;&#43;&#92;&#103;&#97;&#109;&#109;&#97;&#94;&#50;&#32;&#116;&#94;&#50;&#125;&#92;&#92; &#117;&#38;&#61;&#32;&#101;&#94;&#120;&#92;&#92; &#100;&#38;&#61;&#101;&#94;&#123;&#45;&#120;&#125;&#32;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#117;&#125;&#32;&#92;&#92; &#83;&#95;&#117;&#32;&#38;&#61;&#32;&#83;&#32;&#46;&#32;&#117;&#92;&#92; &#83;&#95;&#100;&#32;&#38;&#61;&#32;&#83;&#46;&#32;&#100;&#32;&#92;&#92; &#112;&#95;&#117;&#38;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#50;&#125;&#32;&#43;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#50;&#125;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#92;&#103;&#97;&#109;&#109;&#97;&#32;&#116;&#125;&#123;&#120;&#125;&#92;&#92; &#112;&#95;&#100;&#38;&#61;&#49;&#45;&#112;&#95;&#117; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sitmo.com/article/binomial-and-trinomial-trees/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Numerical Differentiation</title>
		<link>http://www.sitmo.com/article/numerical-differentiation/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=numerical-differentiation</link>
		<comments>http://www.sitmo.com/article/numerical-differentiation/#comments</comments>
		<pubDate>Mon, 06 Jun 2011 21:34:20 +0000</pubDate>
		<dc:creator>Thijs van den Berg</dc:creator>
				<category><![CDATA[Equations]]></category>

		<guid isPermaLink="false">http://www.sitmo.com/?p=535</guid>
		<description><![CDATA[The equations in this category are used to estimate the derivative of functions. These routines are quite often used in finance to estimate sensitivities like delta,gamma,theta, and the estimation of boundary conditions. First derivative: 2 point rules Approximation formula for the first derivative. These equations are known as the forward and backward Eurler rules. &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>The equations in this category are used to estimate the derivative of functions.<br />
These routines are quite often used in finance to estimate sensitivities like delta,gamma,theta, and the estimation of boundary conditions.<br />
<span id="more-535"></span></p>
<h3>First derivative: 2 point rules</h3>
<p>Approximation formula for the first derivative. These equations are known as the forward and backward Eurler rules.</p>
<p class="ql-center-displayed-equation" style="line-height: 84px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-32bde7dd2b54eba66014d9686a81a8f3_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#92;&#102;&#114;&#97;&#99;&#123;&#92;&#112;&#97;&#114;&#116;&#105;&#97;&#108;&#32;&#102;&#125;&#123;&#92;&#112;&#97;&#114;&#116;&#105;&#97;&#108;&#32;&#120;&#125;&#38;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#102;&#40;&#120;&#43;&#104;&#41;&#45;&#102;&#40;&#120;&#41;&#125;&#123;&#104;&#125;&#43;&#79;&#40;&#104;&#41;&#32;&#92;&#92; &#92;&#102;&#114;&#97;&#99;&#123;&#92;&#112;&#97;&#114;&#116;&#105;&#97;&#108;&#32;&#102;&#125;&#123;&#92;&#112;&#97;&#114;&#116;&#105;&#97;&#108;&#32;&#120;&#125;&#38;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#102;&#40;&#120;&#41;&#45;&#102;&#40;&#120;&#45;&#104;&#41;&#125;&#123;&#104;&#125;&#43;&#79;&#40;&#104;&#41; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Second derivative: 3 point rule</h3>
<p>Approximation of the second derivative using the 3 point rule.</p>
<p class="ql-center-displayed-equation" style="line-height: 41px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-8aff2effbeab08d86264b1ee9f8a0d3d_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#92;&#102;&#114;&#97;&#99;&#123;&#92;&#112;&#97;&#114;&#116;&#105;&#97;&#108;&#94;&#50;&#102;&#125;&#123;&#92;&#112;&#97;&#114;&#116;&#105;&#97;&#108;&#32;&#120;&#94;&#50;&#125;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#102;&#40;&#120;&#43;&#104;&#41;&#45;&#50;&#102;&#40;&#120;&#41;&#43;&#102;&#40;&#120;&#45;&#104;&#41;&#125;&#123;&#104;&#94;&#50;&#125;&#43;&#79;&#40;&#104;&#41; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>First derivative: 3 point rules</h3>
<p>Approximation formula for the first derivative. These 3 point equations have second order accuracy. </p>
<p class="ql-center-displayed-equation" style="line-height: 84px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-902cecedcc80377e03cae6f2dcc27330_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#92;&#102;&#114;&#97;&#99;&#123;&#92;&#112;&#97;&#114;&#116;&#105;&#97;&#108;&#32;&#102;&#125;&#123;&#92;&#112;&#97;&#114;&#116;&#105;&#97;&#108;&#32;&#120;&#125;&#38;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#102;&#40;&#120;&#43;&#104;&#41;&#45;&#102;&#40;&#120;&#45;&#104;&#41;&#125;&#123;&#50;&#104;&#125;&#43;&#79;&#40;&#104;&#94;&#50;&#41;&#32;&#92;&#92; &#92;&#102;&#114;&#97;&#99;&#123;&#92;&#112;&#97;&#114;&#116;&#105;&#97;&#108;&#32;&#102;&#125;&#123;&#92;&#112;&#97;&#114;&#116;&#105;&#97;&#108;&#32;&#120;&#125;&#38;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#45;&#102;&#40;&#120;&#43;&#50;&#104;&#41;&#43;&#52;&#102;&#40;&#120;&#43;&#104;&#41;&#45;&#51;&#102;&#40;&#120;&#41;&#125;&#123;&#50;&#104;&#125;&#43;&#79;&#40;&#104;&#94;&#50;&#41; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>First derivative: 4 point rules</h3>
<p>Approximation formula for the first derivative. These 4 point equations have third order accuracy. </p>
<p class="ql-center-displayed-equation" style="line-height: 108px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-12b47e6c981c5f9aa29c6f9fddadf436_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#92;&#102;&#114;&#97;&#99;&#123;&#92;&#112;&#97;&#114;&#116;&#105;&#97;&#108;&#32;&#102;&#40;&#120;&#95;&#48;&#41;&#125;&#123;&#92;&#112;&#97;&#114;&#116;&#105;&#97;&#108;&#32;&#120;&#125;&#38;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#50;&#102;&#40;&#120;&#95;&#51;&#41;&#45;&#57;&#102;&#40;&#120;&#95;&#50;&#41;&#43;&#49;&#56;&#102;&#40;&#120;&#95;&#49;&#41;&#45;&#49;&#49;&#102;&#40;&#120;&#95;&#48;&#41;&#125;&#123;&#54;&#104;&#125;&#43;&#79;&#40;&#104;&#94;&#51;&#41;&#32;&#92;&#92; &#92;&#102;&#114;&#97;&#99;&#123;&#92;&#112;&#97;&#114;&#116;&#105;&#97;&#108;&#32;&#102;&#40;&#120;&#95;&#48;&#41;&#125;&#123;&#92;&#112;&#97;&#114;&#116;&#105;&#97;&#108;&#32;&#120;&#125;&#38;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#45;&#102;&#40;&#120;&#95;&#50;&#41;&#43;&#54;&#102;&#40;&#120;&#95;&#49;&#41;&#45;&#51;&#102;&#40;&#120;&#95;&#48;&#41;&#43;&#45;&#50;&#102;&#40;&#120;&#95;&#123;&#45;&#49;&#125;&#41;&#125;&#123;&#54;&#104;&#125;&#43;&#79;&#40;&#104;&#94;&#51;&#41;&#32;&#92;&#92; &#104;&#38;&#61;&#120;&#95;&#123;&#105;&#43;&#49;&#125;&#45;&#120;&#95;&#105; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Second derivative: 4 point rules</h3>
<p>Approximation of the second derivative using the 4 point rule.</p>
<p class="ql-center-displayed-equation" style="line-height: 41px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-b1d4d1800ae663a1428bbc48b00103b6_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#92;&#102;&#114;&#97;&#99;&#123;&#92;&#112;&#97;&#114;&#116;&#105;&#97;&#108;&#94;&#50;&#102;&#125;&#123;&#92;&#112;&#97;&#114;&#116;&#105;&#97;&#108;&#32;&#120;&#94;&#50;&#125;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#45;&#102;&#40;&#120;&#43;&#51;&#104;&#41;&#43;&#52;&#102;&#40;&#120;&#43;&#50;&#104;&#41;&#45;&#53;&#102;&#40;&#120;&#43;&#104;&#41;&#43;&#50;&#102;&#40;&#120;&#41;&#125;&#123;&#104;&#94;&#50;&#125;&#43;&#79;&#40;&#104;&#94;&#50;&#41; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Second derivative: 5 point rules</h3>
<p>Approximation of the second derivative using the 5 point rule.</p>
<p class="ql-center-displayed-equation" style="line-height: 132px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-3ab14f51acbb705175991433c63abaad_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#92;&#102;&#114;&#97;&#99;&#123;&#92;&#112;&#97;&#114;&#116;&#105;&#97;&#108;&#94;&#50;&#102;&#125;&#123;&#92;&#112;&#97;&#114;&#116;&#105;&#97;&#108;&#32;&#120;&#94;&#50;&#125;&#32;&#38;&#61;&#32;&#92;&#116;&#101;&#120;&#116;&#115;&#116;&#121;&#108;&#101;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#49;&#102;&#40;&#120;&#43;&#52;&#104;&#41;&#45;&#53;&#54;&#102;&#40;&#120;&#43;&#51;&#104;&#41;&#43;&#49;&#49;&#52;&#102;&#40;&#120;&#43;&#50;&#104;&#41;&#45;&#49;&#48;&#52;&#102;&#40;&#120;&#43;&#104;&#41;&#43;&#51;&#53;&#102;&#40;&#120;&#41;&#125;&#123;&#49;&#50;&#104;&#94;&#50;&#125;&#43;&#79;&#40;&#104;&#94;&#51;&#41;&#32;&#92;&#92; &#92;&#102;&#114;&#97;&#99;&#123;&#92;&#112;&#97;&#114;&#116;&#105;&#97;&#108;&#94;&#50;&#102;&#125;&#123;&#92;&#112;&#97;&#114;&#116;&#105;&#97;&#108;&#32;&#120;&#94;&#50;&#125;&#32;&#38;&#61;&#32;&#92;&#116;&#101;&#120;&#116;&#115;&#116;&#121;&#108;&#101;&#92;&#102;&#114;&#97;&#99;&#123;&#45;&#102;&#40;&#120;&#43;&#51;&#104;&#41;&#43;&#52;&#102;&#40;&#120;&#43;&#50;&#104;&#41;&#43;&#54;&#102;&#40;&#120;&#43;&#104;&#41;&#45;&#50;&#48;&#102;&#40;&#120;&#41;&#32;&#43;&#49;&#49;&#102;&#40;&#120;&#45;&#104;&#41;&#125;&#123;&#49;&#50;&#104;&#94;&#50;&#125;&#43;&#79;&#40;&#104;&#94;&#51;&#41;&#32;&#92;&#92; &#92;&#102;&#114;&#97;&#99;&#123;&#92;&#112;&#97;&#114;&#116;&#105;&#97;&#108;&#94;&#50;&#102;&#125;&#123;&#92;&#112;&#97;&#114;&#116;&#105;&#97;&#108;&#32;&#120;&#94;&#50;&#125;&#32;&#38;&#61;&#32;&#92;&#116;&#101;&#120;&#116;&#115;&#116;&#121;&#108;&#101;&#92;&#102;&#114;&#97;&#99;&#123;&#45;&#102;&#40;&#120;&#43;&#50;&#104;&#41;&#43;&#49;&#54;&#102;&#40;&#120;&#43;&#104;&#41;&#45;&#51;&#48;&#102;&#40;&#120;&#41;&#32;&#43;&#49;&#54;&#102;&#40;&#120;&#45;&#104;&#41;&#32;&#45;&#102;&#40;&#120;&#45;&#50;&#104;&#41;&#125;&#123;&#49;&#50;&#104;&#94;&#50;&#125;&#43;&#79;&#40;&#104;&#94;&#51;&#41; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>First derivative: 3 point rules, asymmetrical</h3>
<p>Asymmetrical approximation formula for the first derivative. These 3 point equations have second order accuracy. </p>
<p class="ql-center-displayed-equation" style="line-height: 89px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-06e046634c49142932184248dfd1edf5_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#92;&#102;&#114;&#97;&#99;&#123;&#92;&#112;&#97;&#114;&#116;&#105;&#97;&#108;&#32;&#102;&#40;&#120;&#41;&#125;&#123;&#92;&#112;&#97;&#114;&#116;&#105;&#97;&#108;&#32;&#120;&#125;&#38;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#102;&#40;&#120;&#43;&#104;&#95;&#49;&#41;&#45;&#102;&#40;&#120;&#45;&#104;&#95;&#50;&#41;&#125;&#123;&#104;&#95;&#49;&#43;&#104;&#95;&#50;&#125;&#43;&#79;&#40;&#104;&#94;&#50;&#41;&#32;&#92;&#92; &#92;&#102;&#114;&#97;&#99;&#123;&#92;&#112;&#97;&#114;&#116;&#105;&#97;&#108;&#32;&#102;&#40;&#120;&#41;&#125;&#123;&#92;&#112;&#97;&#114;&#116;&#105;&#97;&#108;&#32;&#120;&#125;&#38;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#102;&#40;&#120;&#43;&#104;&#95;&#49;&#41;&#45;&#102;&#40;&#120;&#43;&#104;&#95;&#50;&#41;&#125;&#123;&#104;&#95;&#49;&#45;&#104;&#95;&#50;&#125;&#43;&#79;&#40;&#104;&#94;&#50;&#41; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>First derivative: 5 point rules</h3>
<p>Approximation formula for the first derivative. These 5 point equations have fourth order accuracy. </p>
<p class="ql-center-displayed-equation" style="line-height: 152px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-6e23c41255a2c4908d3a64f1e1fd1ac3_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#92;&#102;&#114;&#97;&#99;&#123;&#92;&#112;&#97;&#114;&#116;&#105;&#97;&#108;&#32;&#102;&#40;&#120;&#95;&#48;&#41;&#125;&#123;&#92;&#112;&#97;&#114;&#116;&#105;&#97;&#108;&#32;&#120;&#125;&#32;&#38;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#45;&#51;&#102;&#40;&#120;&#95;&#52;&#41;&#43;&#49;&#54;&#102;&#40;&#120;&#95;&#51;&#41;&#45;&#51;&#54;&#102;&#40;&#120;&#95;&#50;&#41;&#43;&#52;&#56;&#102;&#40;&#120;&#95;&#49;&#41;&#45;&#50;&#53;&#102;&#40;&#120;&#95;&#48;&#41;&#125;&#123;&#49;&#50;&#104;&#125;&#32;&#43;&#32;&#79;&#40;&#104;&#94;&#52;&#41;&#32;&#92;&#92; &#92;&#102;&#114;&#97;&#99;&#123;&#92;&#112;&#97;&#114;&#116;&#105;&#97;&#108;&#32;&#102;&#40;&#120;&#95;&#48;&#41;&#125;&#123;&#92;&#112;&#97;&#114;&#116;&#105;&#97;&#108;&#32;&#120;&#125;&#32;&#38;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#102;&#40;&#120;&#95;&#51;&#41;&#45;&#54;&#102;&#40;&#120;&#95;&#50;&#41;&#43;&#49;&#56;&#102;&#40;&#120;&#95;&#49;&#41;&#45;&#49;&#48;&#102;&#40;&#120;&#95;&#48;&#41;&#45;&#51;&#102;&#40;&#120;&#95;&#123;&#45;&#49;&#125;&#41;&#125;&#123;&#49;&#50;&#104;&#125;&#32;&#43;&#32;&#79;&#40;&#104;&#94;&#52;&#41;&#32;&#92;&#92; &#92;&#102;&#114;&#97;&#99;&#123;&#92;&#112;&#97;&#114;&#116;&#105;&#97;&#108;&#32;&#102;&#40;&#120;&#95;&#48;&#41;&#125;&#123;&#92;&#112;&#97;&#114;&#116;&#105;&#97;&#108;&#32;&#120;&#125;&#38;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#45;&#102;&#40;&#120;&#95;&#50;&#41;&#43;&#56;&#102;&#40;&#120;&#95;&#49;&#41;&#45;&#56;&#102;&#40;&#120;&#95;&#123;&#45;&#49;&#125;&#41;&#43;&#102;&#40;&#120;&#95;&#123;&#45;&#50;&#125;&#41;&#125;&#123;&#49;&#50;&#104;&#125;&#32;&#43;&#32;&#79;&#40;&#104;&#94;&#52;&#41;&#32;&#92;&#92; &#104;&#32;&#38;&#61;&#32;&#120;&#95;&#123;&#105;&#43;&#49;&#125;&#45;&#120;&#95;&#105; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sitmo.com/article/numerical-differentiation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Popular Stochastic Processes in Finance</title>
		<link>http://www.sitmo.com/article/popular-stochastic-processes-in-finance/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=popular-stochastic-processes-in-finance</link>
		<comments>http://www.sitmo.com/article/popular-stochastic-processes-in-finance/#comments</comments>
		<pubDate>Mon, 06 Jun 2011 20:45:22 +0000</pubDate>
		<dc:creator>Thijs van den Berg</dc:creator>
				<category><![CDATA[Equations]]></category>

		<guid isPermaLink="false">http://www.sitmo.com/?p=524</guid>
		<description><![CDATA[This list contains the most common stochastic processes used in finance. Ornstein-Uhlenbeck process The Ornstein-Uhlenbeck process is the most common mean reverting stochastic process. &#160; &#160; Geometric Brownian motion SDE The Geometric Brownian describes the most widely used model in finance. It is used to simulate the stochastic behaviour of stocks, currencies, futures. The value [...]]]></description>
			<content:encoded><![CDATA[<p>This list contains the most common stochastic processes used in finance.<br />
<span id="more-524"></span></p>
<h3>Ornstein-Uhlenbeck process</h3>
<p>The Ornstein-Uhlenbeck process is the most common mean reverting stochastic process.</p>
<p class="ql-center-displayed-equation" style="line-height: 18px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-f7fcfe4624d720cce7fd4df13612d969_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#100;&#83;&#95;&#116;&#38;&#61;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#40;&#92;&#109;&#117;&#45;&#83;&#95;&#116;&#41;&#100;&#116;&#43;&#92;&#115;&#105;&#103;&#109;&#97;&#32;&#100;&#87;&#95;&#116;&#32; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Geometric Brownian motion SDE</h3>
<p>The Geometric Brownian describes the most widely used model in finance. It is used to simulate the stochastic behaviour of stocks, currencies, futures. </p>
<p>The value of this process is strick positive, St cannot get below zero.</p>
<p class="ql-center-displayed-equation" style="line-height: 17px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-6457e2fb142c4d67b3ac86e29fe900d7_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#100;&#83;&#95;&#116;&#32;&#38;&#61;&#32;&#92;&#109;&#117;&#32;&#83;&#95;&#116;&#32;&#100;&#116;&#32;&#43;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#32;&#83;&#95;&#116;&#32;&#100;&#87;&#95;&#116; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Vasicek stochastic process</h3>
<p class="ql-center-displayed-equation" style="line-height: 108px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-808b1affd2ac3fada0e4b6a1a2beb9b0_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#100;&#114;&#95;&#116;&#32;&#38;&#61;&#32;&#40;&#92;&#97;&#108;&#112;&#104;&#97;&#45;&#92;&#98;&#101;&#116;&#97;&#32;&#114;&#95;&#116;&#41;&#32;&#100;&#116;&#32;&#43;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#32;&#100;&#87;&#95;&#116;&#92;&#92; &#69;&#91;&#114;&#95;&#116;&#93;&#38;&#61;&#114;&#95;&#48;&#101;&#94;&#123;&#45;&#92;&#97;&#108;&#112;&#104;&#97;&#32;&#116;&#125;&#43;&#92;&#102;&#114;&#97;&#99;&#123;&#92;&#98;&#101;&#116;&#97;&#125;&#123;&#92;&#97;&#108;&#112;&#104;&#97;&#125;&#40;&#49;&#45;&#101;&#94;&#123;&#45;&#92;&#97;&#108;&#112;&#104;&#97;&#32;&#116;&#125;&#41;&#92;&#92; &#86;&#97;&#114;&#91;&#114;&#95;&#116;&#93;&#32;&#38;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#125;&#123;&#50;&#92;&#97;&#108;&#112;&#104;&#97;&#125;&#40;&#49;&#45;&#101;&#94;&#123;&#45;&#50;&#92;&#97;&#108;&#112;&#104;&#97;&#32;&#116;&#125;&#41; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Cox-Ingersoll-Ross interest rate model</h3>
<p class="ql-center-displayed-equation" style="line-height: 96px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-de739139a1cb71d935d74a0a3128769f_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#100;&#82;&#95;&#116;&#32;&#38;&#61;&#32;&#92;&#107;&#97;&#112;&#112;&#97;&#40;&#92;&#116;&#104;&#101;&#116;&#97;&#45;&#32;&#82;&#95;&#116;&#41;&#32;&#100;&#116;&#32;&#43;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#32;&#92;&#115;&#113;&#114;&#116;&#123;&#82;&#95;&#116;&#125;&#100;&#87;&#95;&#116;&#92;&#92; &#69;&#91;&#82;&#95;&#116;&#93;&#38;&#61;&#32;&#82;&#95;&#48;&#101;&#94;&#123;&#45;&#92;&#107;&#97;&#112;&#112;&#97;&#32;&#116;&#125;&#32;&#43;&#32;&#92;&#116;&#104;&#101;&#116;&#97;&#92;&#108;&#101;&#102;&#116;&#40;&#49;&#45;&#101;&#94;&#123;&#45;&#92;&#107;&#97;&#112;&#112;&#97;&#32;&#116;&#125;&#32;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#32;&#92;&#92; &#86;&#97;&#114;&#91;&#82;&#95;&#116;&#93;&#32;&#38;&#61;&#82;&#95;&#48;&#92;&#102;&#114;&#97;&#99;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#125;&#123;&#92;&#107;&#97;&#112;&#112;&#97;&#125;&#92;&#108;&#101;&#102;&#116;&#40;&#101;&#94;&#123;&#45;&#92;&#107;&#97;&#112;&#112;&#97;&#32;&#116;&#125;&#45;&#101;&#94;&#123;&#45;&#50;&#92;&#107;&#97;&#112;&#112;&#97;&#32;&#116;&#125;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#32;&#43;&#32;&#92;&#116;&#104;&#101;&#116;&#97;&#92;&#102;&#114;&#97;&#99;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#125;&#123;&#50;&#92;&#107;&#97;&#112;&#112;&#97;&#125;&#92;&#108;&#101;&#102;&#116;&#40;&#49;&#45;&#101;&#94;&#123;&#45;&#92;&#107;&#97;&#112;&#112;&#97;&#32;&#116;&#125;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#94;&#50; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Schwartz type 1 stochastic process</h3>
<p>The Schwartz type 1 model is a log price Ornstein-Uhlenbeck stochastic process.</p>
<p class="ql-center-displayed-equation" style="line-height: 18px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-7b198650cc14e1294f7f2e1fdcd04bf0_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#100;&#83;&#95;&#116;&#32;&#61;&#38;&#92;&#59;&#32;&#92;&#107;&#97;&#112;&#112;&#97;&#32;&#40;&#92;&#109;&#117;&#45;&#92;&#108;&#110;&#32;&#83;&#95;&#116;&#41;&#32;&#83;&#95;&#116;&#32;&#100;&#116;&#32;&#43;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#32;&#83;&#95;&#116;&#100;&#87;&#32;&#92;&#92; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Schwartz type 2 stochastic process</h3>
<p>Swartz type 2 stochastic process is a two-factor process. The first factor is the spot price, the second factor a instantaneous convenience yield.</p>
<p class="ql-center-displayed-equation" style="line-height: 77px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-0c96fe978021463d662efab17bfb1938_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#100;&#83;&#95;&#116;&#32;&#38;&#61;&#32;&#40;&#92;&#109;&#117;&#45;&#92;&#100;&#101;&#108;&#116;&#97;&#95;&#116;&#41;&#83;&#95;&#116;&#100;&#116;&#32;&#43;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#49;&#83;&#95;&#116;&#100;&#87;&#95;&#116;&#92;&#92; &#100;&#92;&#100;&#101;&#108;&#116;&#97;&#95;&#116;&#32;&#38;&#61;&#32;&#92;&#107;&#97;&#112;&#112;&#97;&#40;&#92;&#97;&#108;&#112;&#104;&#97;&#45;&#92;&#100;&#101;&#108;&#116;&#97;&#95;&#116;&#41;&#100;&#116;&#43;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#50;&#100;&#87;&#94;&#92;&#100;&#101;&#108;&#116;&#97;&#95;&#116;&#32;&#92;&#92; &#100;&#87;&#95;&#116;&#32;&#87;&#95;&#116;&#94;&#92;&#100;&#101;&#108;&#116;&#97;&#38;&#61;&#92;&#114;&#104;&#111;&#32;&#100;&#116; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Heston stochastic volatility model</h3>
<p class="ql-center-displayed-equation" style="line-height: 79px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-bc387c819c3dfa6f5f5ec3a166a7c444_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#100;&#83;&#95;&#116;&#32;&#38;&#61;&#32;&#92;&#109;&#117;&#32;&#83;&#95;&#116;&#32;&#32;&#100;&#116;&#32;&#43;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#116;&#32;&#83;&#95;&#116;&#100;&#87;&#94;&#83;&#95;&#116;&#92;&#92; &#100;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#95;&#116;&#38;&#61;&#92;&#108;&#101;&#102;&#116;&#40;&#92;&#97;&#108;&#112;&#104;&#97;&#45;&#92;&#107;&#97;&#112;&#112;&#97;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#100;&#116;&#43;&#92;&#103;&#97;&#109;&#109;&#97;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#116;&#100;&#87;&#94;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#116;&#92;&#92; &#100;&#87;&#94;&#83;&#95;&#116;&#32;&#87;&#94;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#116;&#32;&#38;&#61;&#32;&#92;&#114;&#104;&#111;&#32;&#100;&#116; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>GARCH(1,1) stochastic volatility model</h3>
<p>Generalized Auto-Regression Conditional Heteroskedacity (GARCH) stochastic volatility model.</p>
<p class="ql-center-displayed-equation" style="line-height: 72px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-765ff107632f49c74e97c23f661584c1_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#100;&#83;&#95;&#116;&#32;&#38;&#61;&#32;&#92;&#109;&#117;&#32;&#83;&#95;&#116;&#32;&#32;&#100;&#116;&#32;&#43;&#32;&#92;&#115;&#113;&#114;&#116;&#123;&#92;&#110;&#117;&#95;&#116;&#125;&#83;&#95;&#116;&#100;&#87;&#95;&#116;&#92;&#92; &#100;&#92;&#110;&#117;&#95;&#116;&#38;&#61;&#92;&#108;&#101;&#102;&#116;&#40;&#92;&#97;&#108;&#112;&#104;&#97;&#45;&#92;&#107;&#97;&#112;&#112;&#97;&#32;&#92;&#110;&#117;&#95;&#116;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#100;&#116;&#43;&#92;&#115;&#105;&#103;&#109;&#97;&#92;&#110;&#117;&#95;&#116;&#32;&#100;&#87;&#94;&#92;&#110;&#117;&#95;&#116;&#92;&#92; &#100;&#87;&#95;&#116;&#87;&#95;&#116;&#94;&#92;&#110;&#117;&#32;&#38;&#61;&#32;&#92;&#114;&#104;&#111;&#32;&#100;&#116; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Constant elasticity of volatility</h3>
<p class="ql-center-displayed-equation" style="line-height: 18px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-bfec57cd672d23c2d7d584194b26466a_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#100;&#83;&#95;&#116;&#61;&#92;&#109;&#117;&#32;&#83;&#95;&#116;&#32;&#100;&#116;&#32;&#43;&#92;&#115;&#105;&#103;&#109;&#97;&#32;&#83;&#95;&#116;&#94;&#92;&#97;&#108;&#112;&#104;&#97;&#32;&#100;&#87;&#95;&#116; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>General stochastic differential equation</h3>
<p>General stochastic differential equation</p>
<p class="ql-center-displayed-equation" style="line-height: 123px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-e1f325a937e16e4f1f0620a914db27dd_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#38;&#92;&#116;&#101;&#120;&#116;&#123;&#100;&#105;&#102;&#102;&#101;&#114;&#101;&#110;&#116;&#105;&#97;&#108;&#32;&#101;&#113;&#117;&#97;&#116;&#105;&#111;&#110;&#32;&#102;&#111;&#114;&#109;&#58;&#125;&#92;&#92; &#100;&#83;&#95;&#116;&#32;&#38;&#61;&#102;&#40;&#116;&#44;&#83;&#41;&#100;&#116;&#32;&#43;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#40;&#116;&#44;&#83;&#41;&#100;&#87;&#95;&#116;&#92;&#92; &#38;&#92;&#116;&#101;&#120;&#116;&#123;&#105;&#110;&#116;&#101;&#103;&#114;&#97;&#108;&#32;&#102;&#111;&#114;&#109;&#58;&#125;&#92;&#92; &#83;&#95;&#84;&#38;&#61;&#83;&#95;&#48;&#43;&#92;&#105;&#110;&#116;&#95;&#123;&#48;&#125;&#94;&#123;&#84;&#125;&#102;&#40;&#116;&#44;&#83;&#41;&#100;&#116;&#32;&#43;&#32;&#92;&#105;&#110;&#116;&#95;&#48;&#94;&#84;&#32;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#40;&#116;&#44;&#83;&#41;&#100;&#87;&#95;&#116; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Merton jump-diffusion</h3>
<p>The Merton jump-diffusion process is an extension to geometric Brownian motion. </p>
<p class="ql-center-displayed-equation" style="line-height: 38px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-e0129d290010e0ce2145f2eff315f79a_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#92;&#102;&#114;&#97;&#99;&#123;&#100;&#83;&#125;&#123;&#83;&#125;&#32;&#61;&#32;&#92;&#109;&#117;&#32;&#100;&#116;&#32;&#43;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#32;&#100;&#32;&#87;&#95;&#116;&#32;&#43;&#32;&#40;&#92;&#101;&#116;&#97;&#45;&#49;&#41;&#100;&#81;&#95;&#116; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Clewlow and Strickland jump-diffusion mean-reversion</h3>
<p>This is the Clewlow and Strickland jump-diffusion mean-reversion SDE. This process is used to describe processes in the energy markets.</p>
<p class="ql-center-displayed-equation" style="line-height: 38px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-ab4ef4ca5e3e07dedbb25cfb4e760139_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#92;&#102;&#114;&#97;&#99;&#123;&#100;&#83;&#125;&#123;&#83;&#125;&#61;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#32;&#40;&#92;&#109;&#117;&#45;&#92;&#84;&#104;&#101;&#116;&#97;&#32;&#75;&#95;&#92;&#109;&#117;&#32;&#45;&#92;&#108;&#110;&#32;&#83;&#41;&#100;&#116;&#43;&#92;&#115;&#105;&#103;&#109;&#97;&#32;&#100;&#87;&#32;&#43;&#32;&#75;&#100;&#81; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Black-Karasinski short term interest rate</h3>
<p>The Black Karasinski for the short term interest rate</p>
<p class="ql-center-displayed-equation" style="line-height: 18px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-05127972e1552a63e89a01ab4261258b_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#100;&#32;&#92;&#108;&#110;&#32;&#82;&#32;&#61;&#32;&#92;&#107;&#97;&#112;&#112;&#97;&#40;&#116;&#41;&#32;&#92;&#108;&#101;&#102;&#116;&#40;&#32;&#92;&#108;&#110;&#32;&#92;&#84;&#104;&#101;&#116;&#97;&#40;&#116;&#41;&#32;&#45;&#32;&#92;&#108;&#110;&#32;&#82;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#100;&#116;&#32;&#43;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#40;&#116;&#41;&#32;&#100;&#32;&#87;&#95;&#116; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Hull-White short term interest rate model</h3>
<p>The Hull-While model is an extended version of the Vasicek model. The short term interest rate is normal distributed, and is mean reverting.</p>
<p class="ql-center-displayed-equation" style="line-height: 18px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-5512dc8af912f9e1d2ce44512c854d66_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#100;&#32;&#82;&#32;&#61;&#32;&#92;&#107;&#97;&#112;&#112;&#97;&#40;&#116;&#41;&#92;&#108;&#101;&#102;&#116;&#40;&#92;&#84;&#104;&#101;&#116;&#97;&#40;&#116;&#41;&#45;&#114;&#32;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#100;&#116;&#32;&#43;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#40;&#116;&#41;&#32;&#100;&#87;&#95;&#116; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sitmo.com/article/popular-stochastic-processes-in-finance/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Probability Distributions</title>
		<link>http://www.sitmo.com/article/probability-distributions/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=probability-distributions</link>
		<comments>http://www.sitmo.com/article/probability-distributions/#comments</comments>
		<pubDate>Mon, 06 Jun 2011 20:30:23 +0000</pubDate>
		<dc:creator>Thijs van den Berg</dc:creator>
				<category><![CDATA[Equations]]></category>

		<guid isPermaLink="false">http://www.sitmo.com/?p=509</guid>
		<description><![CDATA[This page gives an overview of some well known probability distributions. Normal distribution &#160; &#160; Exponential distribution &#160; &#160; Lognormal distribution &#160; &#160; Gamma distribution &#160; &#160; Double exponential (Laplacian) distribution &#160; &#160; Uniform distribution &#160; &#160; Beta distribution &#160; &#160; Cauchy distribution The Cauchy distribution has an undefined mean and variance. &#160; &#160; Weibull [...]]]></description>
			<content:encoded><![CDATA[<p>This page gives an overview of some well known probability distributions.<br />
<span id="more-509"></span></p>
<h3>Normal distribution</h3>
<p class="ql-center-displayed-equation" style="line-height: 96px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-8c4a495e319e6ed00698b5653a4f7ae6_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#112;&#40;&#120;&#41;&#32;&#38;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#92;&#115;&#113;&#114;&#116;&#123;&#50;&#92;&#112;&#105;&#125;&#125;&#92;&#101;&#120;&#112;&#92;&#108;&#101;&#102;&#116;&#40;&#92;&#102;&#114;&#97;&#99;&#123;&#40;&#120;&#45;&#92;&#109;&#117;&#41;&#94;&#50;&#125;&#123;&#50;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#125;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#32;&#92;&#92; &#92;&#116;&#101;&#120;&#116;&#123;&#109;&#101;&#97;&#110;&#125;&#32;&#38;&#61;&#32;&#92;&#109;&#117;&#32;&#92;&#92; &#92;&#116;&#101;&#120;&#116;&#123;&#118;&#97;&#114;&#105;&#97;&#110;&#99;&#101;&#125;&#32;&#38;&#61;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Exponential distribution</h3>
<p class="ql-center-displayed-equation" style="line-height: 77px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-d66c1d9991daccf462ab2255dee8ef7e_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#112;&#40;&#120;&#41;&#32;&#38;&#61;&#32;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#32;&#101;&#94;&#123;&#45;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#32;&#120;&#125;&#32;&#92;&#92; &#92;&#116;&#101;&#120;&#116;&#123;&#109;&#101;&#97;&#110;&#125;&#32;&#38;&#61;&#32;&#92;&#116;&#101;&#120;&#116;&#115;&#116;&#121;&#108;&#101;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#125;&#32;&#92;&#92; &#92;&#116;&#101;&#120;&#116;&#123;&#118;&#97;&#114;&#105;&#97;&#110;&#99;&#101;&#125;&#32;&#38;&#61;&#32;&#92;&#116;&#101;&#120;&#116;&#115;&#116;&#121;&#108;&#101;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#94;&#50;&#125;&#32; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Lognormal distribution</h3>
<p class="ql-center-displayed-equation" style="line-height: 102px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-64eecc461321a6059379965e3d0834ce_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#112;&#40;&#120;&#41;&#32;&#38;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#120;&#92;&#115;&#105;&#103;&#109;&#97;&#92;&#115;&#113;&#114;&#116;&#123;&#50;&#92;&#112;&#105;&#125;&#125;&#92;&#101;&#120;&#112;&#92;&#108;&#101;&#102;&#116;&#40;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#45;&#40;&#92;&#108;&#110;&#32;&#120;&#32;&#45;&#32;&#92;&#109;&#117;&#41;&#94;&#50;&#125;&#123;&#50;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#125;&#32;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#32;&#92;&#92; &#92;&#116;&#101;&#120;&#116;&#123;&#109;&#101;&#97;&#110;&#125;&#32;&#38;&#32;&#61;&#32;&#92;&#101;&#120;&#112;&#92;&#108;&#101;&#102;&#116;&#32;&#40;&#32;&#92;&#109;&#117;&#32;&#43;&#32;&#92;&#116;&#101;&#120;&#116;&#115;&#116;&#121;&#108;&#101;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#50;&#125;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#92;&#92; &#92;&#116;&#101;&#120;&#116;&#123;&#118;&#97;&#114;&#105;&#97;&#110;&#99;&#101;&#125;&#32;&#38;&#61;&#32;&#92;&#101;&#120;&#112;&#92;&#108;&#101;&#102;&#116;&#32;&#40;&#32;&#50;&#92;&#109;&#117;&#32;&#43;&#32;&#50;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#32;&#45;&#32;&#32;&#92;&#101;&#120;&#112;&#92;&#108;&#101;&#102;&#116;&#32;&#40;&#32;&#50;&#92;&#109;&#117;&#32;&#43;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#92;&#92; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Gamma distribution</h3>
<p class="ql-center-displayed-equation" style="line-height: 119px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-03b37b9c6565f18cccfbe980f0a2e4db_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#112;&#40;&#120;&#41;&#32;&#38;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#94;&#114;&#125;&#123;&#92;&#71;&#97;&#109;&#109;&#97;&#40;&#114;&#41;&#125;&#120;&#94;&#123;&#114;&#45;&#49;&#125;&#32;&#101;&#94;&#123;&#45;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#32;&#120;&#125;&#32;&#92;&#92; &#92;&#116;&#101;&#120;&#116;&#123;&#109;&#101;&#97;&#110;&#125;&#32;&#38;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#114;&#125;&#123;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#125;&#32;&#92;&#92; &#92;&#116;&#101;&#120;&#116;&#123;&#118;&#97;&#114;&#105;&#97;&#110;&#99;&#101;&#125;&#32;&#38;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#114;&#125;&#123;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#94;&#50;&#125;&#32; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Double exponential (Laplacian) distribution</h3>
<p class="ql-center-displayed-equation" style="line-height: 97px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-4c083bc7d11223dab3b3725cbae180bb_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#112;&#40;&#120;&#41;&#32;&#38;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#50;&#92;&#98;&#101;&#116;&#97;&#125;&#92;&#101;&#120;&#112;&#32;&#92;&#108;&#101;&#102;&#116;&#40;&#32;&#45;&#92;&#102;&#114;&#97;&#99;&#123;&#124;&#120;&#45;&#92;&#97;&#108;&#112;&#104;&#97;&#124;&#125;&#123;&#92;&#98;&#101;&#116;&#97;&#125;&#32;&#32;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#92;&#92; &#92;&#116;&#101;&#120;&#116;&#123;&#109;&#101;&#97;&#110;&#125;&#38;&#61;&#92;&#97;&#108;&#112;&#104;&#97;&#92;&#92; &#92;&#116;&#101;&#120;&#116;&#123;&#118;&#97;&#114;&#105;&#97;&#110;&#99;&#101;&#125;&#38;&#61;&#50;&#92;&#98;&#101;&#116;&#97;&#94;&#50; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Uniform distribution</h3>
<p class="ql-center-displayed-equation" style="line-height: 134px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-6197a4a1aa6fb9555dd76021b40f21c8_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#112;&#40;&#120;&#41;&#32;&#38;&#61;&#32;&#92;&#108;&#101;&#102;&#116;&#92;&#123; &#32;&#32;&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#116;&#97;&#98;&#117;&#108;&#97;&#114;&#125;&#123;&#108;&#108;&#125; &#32;&#32;&#32;&#32;&#36;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#98;&#45;&#97;&#125;&#36;&#32;&#38;&#32;&#105;&#102;&#32;&#36;&#97;&#92;&#108;&#101;&#32;&#120;&#32;&#92;&#108;&#101;&#32;&#98;&#36;&#32;&#92;&#92; &#32;&#32;&#32;&#32;&#36;&#48;&#36;&#32;&#38;&#32;&#111;&#116;&#104;&#101;&#114;&#119;&#105;&#115;&#101; &#32;&#32;&#92;&#101;&#110;&#100;&#123;&#116;&#97;&#98;&#117;&#108;&#97;&#114;&#125; &#32;&#92;&#114;&#105;&#103;&#104;&#116;&#46;&#32;&#92;&#92; &#92;&#116;&#101;&#120;&#116;&#123;&#109;&#101;&#97;&#110;&#125;&#32;&#38;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#97;&#43;&#98;&#125;&#123;&#50;&#125;&#32;&#92;&#92; &#92;&#116;&#101;&#120;&#116;&#123;&#118;&#97;&#114;&#105;&#97;&#110;&#99;&#101;&#125;&#32;&#38;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#40;&#98;&#45;&#97;&#41;&#94;&#50;&#125;&#123;&#49;&#50;&#125; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Beta distribution</h3>
<p class="ql-center-displayed-equation" style="line-height: 127px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-368f929b3b928f625b5539f771779ca3_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#112;&#40;&#120;&#41;&#38;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#66;&#40;&#97;&#44;&#98;&#41;&#125;&#120;&#94;&#123;&#97;&#45;&#49;&#125;&#32;&#40;&#49;&#45;&#120;&#41;&#94;&#123;&#98;&#45;&#49;&#125;&#32;&#92;&#116;&#101;&#120;&#116;&#123;&#32;&#102;&#111;&#114;&#32;&#125;&#32;&#48;&#92;&#108;&#101;&#32;&#120;&#32;&#92;&#108;&#101;&#32;&#49;&#32;&#92;&#92; &#92;&#116;&#101;&#120;&#116;&#123;&#109;&#101;&#97;&#110;&#125;&#32;&#38;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#97;&#125;&#123;&#97;&#43;&#98;&#125;&#32;&#92;&#92; &#92;&#116;&#101;&#120;&#116;&#123;&#118;&#97;&#114;&#105;&#97;&#110;&#99;&#101;&#125;&#32;&#38;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#97;&#98;&#125;&#123;&#40;&#97;&#43;&#98;&#43;&#49;&#41;&#40;&#97;&#43;&#98;&#41;&#94;&#50;&#125; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Cauchy distribution</h3>
<p>The Cauchy distribution has an undefined mean and variance.</p>
<p class="ql-center-displayed-equation" style="line-height: 64px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-83e9990754f781ebe21b1c90c4797f5e_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#112;&#40;&#120;&#41;&#38;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#92;&#112;&#105;&#32;&#92;&#98;&#101;&#116;&#97;&#32;&#92;&#108;&#101;&#102;&#116;&#91;&#49;&#43;&#92;&#108;&#101;&#102;&#116;&#40;&#92;&#102;&#114;&#97;&#99;&#123;&#120;&#45;&#92;&#97;&#108;&#112;&#104;&#97;&#125;&#123;&#92;&#98;&#101;&#116;&#97;&#125;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#94;&#50;&#92;&#114;&#105;&#103;&#104;&#116;&#93;&#125; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Weibull distribution</h3>
<p class="ql-center-displayed-equation" style="line-height: 206px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-14c889c8fd53bccb4cb8345341bf7f80_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#80;&#40;&#120;&#41;&#32;&#38;&#61;&#32;&#97;&#98;&#120;&#94;&#123;&#98;&#45;&#49;&#125;&#32;&#92;&#101;&#120;&#112;&#92;&#108;&#101;&#102;&#116;&#40;&#45;&#97;&#120;&#94;&#98;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#32;&#92;&#92; &#92;&#116;&#101;&#120;&#116;&#123;&#109;&#101;&#97;&#110;&#125;&#32;&#38;&#61;&#97;&#94;&#123;&#45;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#98;&#125;&#125;&#92;&#71;&#97;&#109;&#109;&#97;&#92;&#108;&#101;&#102;&#116;&#40;&#49;&#43;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#98;&#125;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#92;&#92; &#92;&#116;&#101;&#120;&#116;&#123;&#118;&#97;&#114;&#105;&#97;&#110;&#99;&#101;&#125;&#32;&#38;&#61;&#97;&#94;&#123;&#45;&#92;&#102;&#114;&#97;&#99;&#123;&#50;&#125;&#123;&#98;&#125;&#125;&#92;&#108;&#101;&#102;&#116;&#91;&#92;&#71;&#97;&#109;&#109;&#97;&#92;&#108;&#101;&#102;&#116;&#40;&#49;&#43;&#92;&#102;&#114;&#97;&#99;&#123;&#50;&#125;&#123;&#98;&#125;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#45;&#92;&#71;&#97;&#109;&#109;&#97;&#94;&#50;&#92;&#108;&#101;&#102;&#116;&#40;&#49;&#43;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#98;&#125;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#92;&#114;&#105;&#103;&#104;&#116;&#93;&#92;&#92; &#92;&#116;&#101;&#120;&#116;&#123;&#71;&#97;&#109;&#109;&#97;&#32;&#102;&#117;&#110;&#99;&#116;&#105;&#111;&#110;&#58;&#125;&#92;&#92; &#92;&#71;&#97;&#109;&#109;&#97;&#40;&#120;&#41;&#38;&#61;&#92;&#105;&#110;&#116;&#95;&#123;&#48;&#125;&#94;&#123;&#92;&#105;&#110;&#102;&#116;&#121;&#125;&#117;&#94;&#123;&#120;&#45;&#49;&#125;&#101;&#94;&#123;&#45;&#117;&#125;&#100;&#117; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Pareto distribution</h3>
<p class="ql-center-displayed-equation" style="line-height: 130px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-acfeaa3a4cd3a742ce3a9e6acbdd85c8_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#112;&#40;&#120;&#41;&#38;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#92;&#97;&#108;&#112;&#104;&#97;&#92;&#98;&#101;&#116;&#97;&#94;&#92;&#97;&#108;&#112;&#104;&#97;&#125;&#123;&#120;&#94;&#123;&#92;&#97;&#108;&#112;&#104;&#97;&#43;&#49;&#125;&#125;&#32;&#92;&#116;&#101;&#120;&#116;&#123;&#32;&#102;&#111;&#114;&#32;&#125;&#120;&#62;&#92;&#98;&#101;&#116;&#97;&#92;&#116;&#101;&#120;&#116;&#123;&#32;&#97;&#110;&#100;&#32;&#125;&#92;&#97;&#108;&#112;&#104;&#97;&#44;&#92;&#98;&#101;&#116;&#97;&#62;&#48;&#32;&#92;&#92; &#92;&#116;&#101;&#120;&#116;&#123;&#109;&#101;&#97;&#110;&#125;&#38;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#92;&#97;&#108;&#112;&#104;&#97;&#92;&#98;&#101;&#116;&#97;&#125;&#123;&#92;&#97;&#108;&#112;&#104;&#97;&#45;&#49;&#125;&#92;&#92; &#92;&#116;&#101;&#120;&#116;&#123;&#118;&#97;&#114;&#105;&#97;&#110;&#99;&#101;&#125;&#38;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#92;&#97;&#108;&#112;&#104;&#97;&#92;&#98;&#101;&#116;&#97;&#94;&#50;&#125;&#123;&#40;&#92;&#97;&#108;&#112;&#104;&#97;&#45;&#49;&#41;&#94;&#50;&#40;&#92;&#97;&#108;&#112;&#104;&#97;&#45;&#50;&#41;&#125; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Normal-inverse Gaussian distribution</h3>
<p class="ql-center-displayed-equation" style="line-height: 488px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-5bfdc0b568ed1d1b75c496f589ec7b6e_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#80;&#40;&#120;&#41;&#38;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#92;&#97;&#108;&#112;&#104;&#97;&#32;&#92;&#100;&#101;&#108;&#116;&#97;&#32;&#75;&#95;&#49;&#40;&#92;&#97;&#108;&#112;&#104;&#97;&#92;&#111;&#109;&#101;&#103;&#97;&#41;&#125;&#123;&#92;&#112;&#105;&#32;&#92;&#111;&#109;&#101;&#103;&#97;&#125;&#101;&#94;&#123;&#92;&#100;&#101;&#108;&#116;&#97;&#92;&#103;&#97;&#109;&#109;&#97;&#43;&#92;&#98;&#101;&#116;&#97;&#40;&#120;&#45;&#92;&#109;&#117;&#41;&#125;&#32;&#92;&#92; &#92;&#109;&#117;&#32;&#38;&#92;&#116;&#101;&#120;&#116;&#123;&#32;&#45;&#32;&#108;&#111;&#99;&#97;&#116;&#105;&#111;&#110;&#125;&#92;&#92; &#92;&#97;&#108;&#112;&#104;&#97;&#38;&#92;&#116;&#101;&#120;&#116;&#123;&#32;&#45;&#32;&#115;&#104;&#97;&#112;&#101;&#32;&#125;&#92;&#92; &#92;&#98;&#101;&#116;&#97;&#38;&#92;&#116;&#101;&#120;&#116;&#123;&#32;&#45;&#32;&#115;&#107;&#101;&#119;&#125;&#92;&#92; &#92;&#100;&#101;&#108;&#116;&#97;&#38;&#92;&#116;&#101;&#120;&#116;&#123;&#32;&#45;&#32;&#115;&#99;&#97;&#108;&#101;&#125;&#92;&#92;&#32;&#92;&#92; &#92;&#103;&#97;&#109;&#109;&#97;&#38;&#61;&#92;&#115;&#113;&#114;&#116;&#123;&#92;&#97;&#108;&#112;&#104;&#97;&#94;&#50;&#45;&#92;&#98;&#101;&#116;&#97;&#94;&#50;&#125;&#92;&#92; &#92;&#111;&#109;&#101;&#103;&#97;&#38;&#61;&#32;&#92;&#115;&#113;&#114;&#116;&#123;&#92;&#100;&#101;&#108;&#116;&#97;&#94;&#50;&#43;&#40;&#120;&#45;&#92;&#109;&#117;&#41;&#94;&#50;&#125;&#92;&#92; &#75;&#95;&#49;&#32;&#38;&#61;&#32;&#92;&#116;&#101;&#120;&#116;&#123;&#77;&#111;&#100;&#105;&#102;&#105;&#101;&#100;&#32;&#66;&#101;&#115;&#115;&#101;&#108;&#32;&#102;&#117;&#110;&#99;&#116;&#105;&#111;&#110;&#32;&#111;&#102;&#32;&#116;&#104;&#101;&#32;&#51;&#114;&#100;&#32;&#107;&#105;&#110;&#100;&#125;&#32;&#92;&#92;&#32;&#92;&#92; &#92;&#116;&#101;&#120;&#116;&#123;&#109;&#101;&#97;&#110;&#125;&#32;&#38;&#61;&#32;&#92;&#109;&#117;&#43;&#92;&#102;&#114;&#97;&#99;&#123;&#92;&#100;&#101;&#108;&#116;&#97;&#92;&#98;&#101;&#116;&#97;&#125;&#123;&#92;&#103;&#97;&#109;&#109;&#97;&#125;&#92;&#92; &#92;&#116;&#101;&#120;&#116;&#123;&#118;&#97;&#114;&#105;&#97;&#110;&#99;&#101;&#125;&#32;&#38;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#92;&#100;&#101;&#108;&#116;&#97;&#92;&#97;&#108;&#112;&#104;&#97;&#94;&#50;&#32;&#125;&#123;&#92;&#103;&#97;&#109;&#109;&#97;&#94;&#51;&#125;&#32;&#92;&#92; &#92;&#116;&#101;&#120;&#116;&#123;&#115;&#107;&#101;&#119;&#125;&#32;&#38;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#51;&#92;&#98;&#101;&#116;&#97;&#125;&#123;&#92;&#97;&#108;&#112;&#104;&#97;&#92;&#115;&#113;&#114;&#116;&#123;&#92;&#100;&#101;&#108;&#116;&#97;&#92;&#103;&#97;&#109;&#109;&#97;&#125;&#125;&#32;&#92;&#92; &#92;&#116;&#101;&#120;&#116;&#123;&#107;&#117;&#116;&#111;&#115;&#105;&#115;&#125;&#38;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#51;&#43;&#49;&#50;&#92;&#102;&#114;&#97;&#99;&#123;&#92;&#98;&#101;&#116;&#97;&#94;&#50;&#125;&#123;&#92;&#97;&#108;&#112;&#104;&#97;&#94;&#50;&#125;&#125;&#123;&#92;&#100;&#101;&#108;&#116;&#97;&#92;&#103;&#97;&#109;&#109;&#97;&#125; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Bivariate normal distribution</h3>
<p>The bivariate normal probability density function for two correlated normal distributed variables x and y.</p>
<p class="ql-center-displayed-equation" style="line-height: 100px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-f74b2643c4730b84fc983d9dbe595e62_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#112;&#40;&#120;&#44;&#121;&#41;&#38;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#50;&#92;&#112;&#105;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#120;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#121;&#32;&#92;&#115;&#113;&#114;&#116;&#123;&#49;&#45;&#92;&#114;&#104;&#111;&#94;&#50;&#125;&#125;&#32;&#92;&#101;&#120;&#112;&#92;&#108;&#101;&#102;&#116;&#40;&#32;&#45;&#92;&#102;&#114;&#97;&#99;&#123;&#92;&#110;&#117;&#95;&#120;&#94;&#50;&#45;&#50;&#92;&#114;&#104;&#111;&#92;&#110;&#117;&#95;&#120;&#92;&#110;&#117;&#95;&#121;&#43;&#92;&#110;&#117;&#95;&#121;&#94;&#50;&#125;&#123;&#50;&#40;&#49;&#45;&#92;&#114;&#104;&#111;&#94;&#50;&#41;&#125;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#32;&#92;&#92; &#92;&#110;&#117;&#95;&#120;&#38;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#120;&#45;&#92;&#109;&#117;&#95;&#120;&#125;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#120;&#125;&#44;&#32;&#32;&#92;&#110;&#117;&#95;&#121;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#121;&#45;&#92;&#109;&#117;&#95;&#121;&#125;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#121;&#125; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Bivariate normal distribution, alternative expression</h3>
<p>The bivariate normal density function can also be expressed as the product of a normal distributed variable with a conditional probability distribution function.</p>
<p class="ql-center-displayed-equation" style="line-height: 167px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-de10e6e40cbd8e0a5b1053fdeda03b43_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#112;&#40;&#120;&#44;&#121;&#41;&#38;&#61;&#32;&#112;&#40;&#120;&#41;&#112;&#40;&#121;&#124;&#120;&#41;&#92;&#92; &#112;&#40;&#120;&#41;&#32;&#38;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#120;&#92;&#115;&#113;&#114;&#116;&#123;&#50;&#92;&#112;&#105;&#125;&#125;&#92;&#101;&#120;&#112;&#32;&#92;&#108;&#101;&#102;&#116;&#40;&#32;&#45;&#92;&#102;&#114;&#97;&#99;&#123;&#92;&#110;&#117;&#95;&#120;&#125;&#123;&#50;&#125;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#32;&#92;&#92; &#112;&#40;&#121;&#124;&#120;&#41;&#32;&#38;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#32;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#121;&#32;&#92;&#115;&#113;&#114;&#116;&#123;&#50;&#92;&#112;&#105;&#125;&#32;&#92;&#115;&#113;&#114;&#116;&#123;&#49;&#45;&#92;&#114;&#104;&#111;&#94;&#50;&#125;&#125;&#32;&#92;&#101;&#120;&#112;&#92;&#108;&#101;&#102;&#116;&#40;&#32;&#45;&#92;&#102;&#114;&#97;&#99;&#123;&#40;&#92;&#110;&#117;&#95;&#121;&#45;&#92;&#114;&#104;&#111;&#92;&#110;&#117;&#95;&#120;&#41;&#94;&#50;&#125;&#123;&#50;&#40;&#49;&#45;&#92;&#114;&#104;&#111;&#94;&#50;&#41;&#125; &#92;&#114;&#105;&#103;&#104;&#116;&#41;&#32;&#92;&#92; &#92;&#110;&#117;&#95;&#120;&#38;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#120;&#45;&#92;&#109;&#117;&#95;&#120;&#125;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#120;&#125;&#44;&#32;&#32;&#92;&#110;&#117;&#95;&#121;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#121;&#45;&#92;&#109;&#117;&#95;&#121;&#125;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#121;&#125; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Erlang distribution</h3>
<p>Random value with Erlang distribution results as sum of k exponential distributed random values</p>
<p class="ql-center-displayed-equation" style="line-height: 152px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-41ec6b4cb6a5b29a17dd992989fe9341_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#102;&#40;&#120;&#41;&#32;&#38;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#32;&#101;&#94;&#123;&#45;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#32;&#120;&#125;&#32;&#40;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#32;&#120;&#41;&#94;&#123;&#107;&#45;&#49;&#125;&#32;&#32;&#125;&#123;&#40;&#107;&#45;&#49;&#41;&#33;&#125;&#44;&#92;&#92; &#70;&#40;&#120;&#41;&#32;&#38;&#61;&#32;&#49;&#45;&#101;&#94;&#123;&#45;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#32;&#120;&#125;&#32;&#32;&#92;&#115;&#117;&#109;&#95;&#123;&#106;&#61;&#48;&#125;&#94;&#123;&#107;&#45;&#49;&#125;&#92;&#102;&#114;&#97;&#99;&#123;&#40;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#32;&#120;&#41;&#94;&#123;&#106;&#125;&#125;&#123;&#106;&#33;&#125;&#44;&#92;&#92; &#69;&#88;&#32;&#38;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#107;&#125;&#123;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#125;&#44;&#92;&#115;&#112;&#97;&#99;&#101;&#32;&#86;&#97;&#114;&#88;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#107;&#125;&#123;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#94;&#50;&#125; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Jointly Normal Distribution density function</h3>
<p class="ql-center-displayed-equation" style="line-height: 125px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-23f8b2d123320820436da8dcbf2b5b36_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#102;&#40;&#120;&#44;&#121;&#41;&#32;&#38;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#50;&#32;&#92;&#112;&#105;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#49;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#50;&#32;&#92;&#115;&#113;&#114;&#116;&#123;&#49;&#45;&#114;&#94;&#50;&#125;&#125;&#32;&#92;&#116;&#101;&#120;&#116;&#123;&#101;&#120;&#112;&#125;&#32;&#92;&#108;&#101;&#102;&#116;&#91;&#45;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#50;&#40;&#49;&#45;&#114;&#94;&#50;&#41;&#125;&#32;&#92;&#108;&#101;&#102;&#116;&#91;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#40;&#120;&#45;&#92;&#109;&#117;&#95;&#49;&#41;&#94;&#50;&#125;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#49;&#94;&#50;&#125;&#32;&#45;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#50;&#114;&#40;&#120;&#32;&#45;&#32;&#92;&#109;&#117;&#95;&#49;&#41;&#40;&#121;&#32;&#45;&#32;&#92;&#109;&#117;&#95;&#50;&#41;&#125;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#49;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#50;&#125;&#32;&#32;&#43;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#40;&#121;&#45;&#92;&#109;&#117;&#95;&#50;&#41;&#94;&#50;&#125;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#50;&#94;&#50;&#125;&#32;&#32;&#92;&#114;&#105;&#103;&#104;&#116;&#93;&#32;&#92;&#114;&#105;&#103;&#104;&#116;&#93;&#32;&#32;&#92;&#92; &#92;&#32;&#92;&#92;&#32;&#92;&#92; &#124;&#114;&#124;&#32;&#38;&#60;&#32;&#49;&#32;&#92;&#32;&#32;&#92;&#32;&#92;&#32;&#92;&#32;&#92;&#116;&#101;&#120;&#116;&#123;&#99;&#111;&#114;&#114;&#101;&#108;&#97;&#116;&#105;&#111;&#110;&#32;&#99;&#111;&#101;&#102;&#102;&#105;&#99;&#105;&#101;&#110;&#116;&#125; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sitmo.com/article/probability-distributions/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Spread Option Pricing Model</title>
		<link>http://www.sitmo.com/article/spread-option-pricing-model/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=spread-option-pricing-model</link>
		<comments>http://www.sitmo.com/article/spread-option-pricing-model/#comments</comments>
		<pubDate>Fri, 03 Jun 2011 23:26:32 +0000</pubDate>
		<dc:creator>Thijs van den Berg</dc:creator>
				<category><![CDATA[Equations]]></category>

		<guid isPermaLink="false">http://www.sitmo.com/?p=487</guid>
		<description><![CDATA[This equation uses the Gauss-Legendre quadrature to approximate the value of a spread option. The Gauss-Legendre quadrature abscissas (Xi) are rescaled in the range -4 to +4. The equation is unbiased and gives very accurate results, typical 6 digit accuracy with 16 quadrature points. The method was describes by K. Ravindran in his paper &#8220;Low-fat [...]]]></description>
			<content:encoded><![CDATA[<p>This equation uses the Gauss-Legendre quadrature to approximate the value of a spread option. The Gauss-Legendre quadrature abscissas  (Xi) are rescaled in the range -4 to +4. The equation is unbiased and gives very accurate results, typical 6 digit accuracy with 16 quadrature points. The method was describes by K. Ravindran in his paper &#8220;Low-fat spreads&#8221; (1993) RISK 6 (10) 56&#8211;57.<br />
<span id="more-487"></span></p>
<h3>Equations</h3>
<p class="ql-center-displayed-equation" style="line-height: 167px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-99c9a38d4db1aae1d06d2c430e3cbb0c_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#67;&#95;&#123;&#83;&#80;&#125;&#32;&#38;&#92;&#97;&#112;&#112;&#114;&#111;&#120;&#32;&#92;&#115;&#117;&#109;&#95;&#105;&#32;&#119;&#95;&#105;&#32;&#110;&#40;&#120;&#95;&#105;&#41;&#32;&#67;&#95;&#123;&#66;&#83;&#125;&#40;&#83;&#39;&#44;&#88;&#39;&#44;&#92;&#115;&#105;&#103;&#109;&#97;&#39;&#44;&#89;&#95;&#49;&#44;&#116;&#41;&#92;&#92; &#83;&#39;&#38;&#61;&#83;&#95;&#49;&#32;&#32;&#92;&#101;&#120;&#112;&#92;&#108;&#101;&#102;&#116;&#40;&#92;&#114;&#104;&#111;&#32;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#49;&#32;&#32;&#92;&#115;&#113;&#114;&#116;&#123;&#116;&#125;&#32;&#32;&#120;&#95;&#105;&#32;&#45;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#50;&#125;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#49;&#94;&#50;&#32;&#92;&#114;&#104;&#111;&#94;&#50;&#32;&#116;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#92;&#92; &#88;&#39;&#32;&#38;&#61;&#32;&#32;&#83;&#95;&#50;&#32;&#92;&#101;&#120;&#112;&#92;&#108;&#101;&#102;&#116;&#40;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#50;&#32;&#92;&#115;&#113;&#114;&#116;&#123;&#116;&#125;&#32;&#32;&#120;&#95;&#105;&#32;&#43;&#32;&#40;&#89;&#95;&#50;&#32;&#45;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#50;&#125;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#50;&#94;&#50;&#41;&#32;&#32;&#116;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#32;&#43;&#32;&#88;&#92;&#92; &#92;&#115;&#105;&#103;&#109;&#97;&#39;&#38;&#61;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#49;&#32;&#92;&#115;&#113;&#114;&#116;&#123;&#49;&#45;&#92;&#114;&#104;&#111;&#94;&#50;&#125; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<p>with</p>
<table>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-c16103d0244b7e6cc9b2d4738a4ad2ba_l3.png" class="ql-img-inline-formula" alt="&#67;&#95;&#123;&#83;&#80;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/></td>
<td> Price of the spread call option with payoff <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-c6ab0bd8495c17b606184a73d9ec55fb_l3.png" class="ql-img-inline-formula" alt="&#109;&#97;&#120;&#40;&#83;&#49;&#45;&#83;&#50;&#45;&#88;&#44;&#48;&#41;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/></td>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-eec41c5574553671e0768caf182db04f_l3.png" class="ql-img-inline-formula" alt="&#67;&#95;&#123;&#66;&#83;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/></td>
<td> Price of a Black &#038; Scholes vanilla option</td>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-b04985ab74ff705ec05c507ed58afebd_l3.png" class="ql-img-inline-formula" alt="&#119;&#95;&#105;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/></td>
<td>  Gauss-Legendre quadrature weights</td>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-c8700e0258243116de0d4f288e2e3b44_l3.png" class="ql-img-inline-formula" alt="&#120;&#95;&#105;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/></td>
<td>  Gauss-Legendre quadrature abscissas in the range -4 to +4</td>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-94366be0a490b276dfa891caf550bb9b_l3.png" class="ql-img-inline-formula" alt="&#83;&#95;&#49;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/></td>
<td> Value of the long underlying </td>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-465f83ac90ca1844a03b41e8ca8d99b1_l3.png" class="ql-img-inline-formula" alt="&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#49;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/></td>
<td> Volatility of the long underlying</td>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-f0fbc49b636dba76f816b015b295e5c0_l3.png" class="ql-img-inline-formula" alt="&#89;&#95;&#49;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/></td>
<td> Yield of the long underlying</td>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-42795ee87a3faf709a8854b21544cbf4_l3.png" class="ql-img-inline-formula" alt="&#83;&#95;&#50;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/></td>
<td> Value of the short underlying </td>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-c6030cff658103fea681714084e20839_l3.png" class="ql-img-inline-formula" alt="&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#50;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/></td>
<td> Volatility of the short underlying</td>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-1c63891a8105037f26830a65b5661016_l3.png" class="ql-img-inline-formula" alt="&#89;&#95;&#50;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/></td>
<td> Yield of the short underlying</td>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-da039068127cf2ec5fc05123d4d3546f_l3.png" class="ql-img-inline-formula" alt="&#92;&#114;&#104;&#111;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/></td>
<td> Correlation between the underlyings</td>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-d4ee28752517d6062a3ca0314890342d_l3.png" class="ql-img-inline-formula" alt="&#88;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/></td>
<td> Strike</td>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-b4e3cbf5d4c5c6d9b702dd139f14c147_l3.png" class="ql-img-inline-formula" alt="&#116;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/></td>
<td> Time till expiration</td>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-3e9d2e1120c0b3dfec22588dbf0646e7_l3.png" class="ql-img-inline-formula" alt="&#110;&#40;&#120;&#41;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/></td>
<td> Normal density function</td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.sitmo.com/article/spread-option-pricing-model/feed/</wfw:commentRss>
		<slash:comments>44</slash:comments>
		</item>
		<item>
		<title>Joint high-low probability of geometric Brownian motion</title>
		<link>http://www.sitmo.com/article/joint-high-low-probability-of-geometric-brownian-motion/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=joint-high-low-probability-of-geometric-brownian-motion</link>
		<comments>http://www.sitmo.com/article/joint-high-low-probability-of-geometric-brownian-motion/#comments</comments>
		<pubDate>Fri, 03 Jun 2011 23:09:28 +0000</pubDate>
		<dc:creator>Thijs van den Berg</dc:creator>
				<category><![CDATA[Equations]]></category>

		<guid isPermaLink="false">http://www.sitmo.com/?p=476</guid>
		<description><![CDATA[This equation gives the probability that the high and the low of an underlying are within the range [L,H]. The underlying behavior is geometric Brownian motion with a yield (drift) , volatility , and has an initial value of Equation &#160; &#160;]]></description>
			<content:encoded><![CDATA[<p>This equation gives the probability that the high and the low of an underlying are within the range [L,H].  The underlying behavior is geometric Brownian motion with a yield (drift) <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-461fe1a58a75801541487ddf10d32abd_l3.png" class="ql-img-inline-formula" alt="&#92;&#109;&#117;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/>, volatility <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-1c9cc40f96a1492e298e7da85a2c1692_l3.png" class="ql-img-inline-formula" alt="&#92;&#115;&#105;&#103;&#109;&#97;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/>, and has an initial value of <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-d93e619cd77e3f792ef6dbca1079f902_l3.png" class="ql-img-inline-formula" alt="&#83;&#95;&#48;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/><br />
<span id="more-476"></span></p>
<h3>Equation</h3>
<p class="ql-center-displayed-equation" style="line-height: 343px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-b210498c86b46347be83f76780d4c07c_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#80;&#32;&#38;&#92;&#108;&#101;&#102;&#116;&#40;&#76;&#32;&#92;&#108;&#101;&#32;&#92;&#109;&#105;&#110;&#95;&#123;&#48;&#60;&#116;&#60;&#84;&#125;&#32;&#83;&#95;&#116;&#32;&#32;&#59;&#32;&#92;&#109;&#97;&#120;&#95;&#123;&#48;&#60;&#116;&#60;&#84;&#125;&#32;&#83;&#95;&#116;&#32;&#92;&#108;&#101;&#32;&#72;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#61;&#92;&#92; &#38;&#92;&#102;&#114;&#97;&#99;&#123;&#92;&#101;&#120;&#112;&#92;&#108;&#101;&#102;&#116;&#91;&#32;&#45;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#50;&#125;&#32;&#92;&#108;&#101;&#102;&#116;&#40;&#92;&#102;&#114;&#97;&#99;&#123;&#89;&#125;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#125;&#45;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#50;&#125;&#92;&#115;&#105;&#103;&#109;&#97;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#94;&#50;&#32;&#84;&#92;&#114;&#105;&#103;&#104;&#116;&#93;&#125;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#32;&#92;&#115;&#113;&#114;&#116;&#123;&#50;&#92;&#112;&#105;&#32;&#84;&#125;&#125;&#32;&#46;&#92;&#92; &#38;&#92;&#115;&#117;&#109;&#95;&#123;&#110;&#61;&#45;&#92;&#105;&#110;&#102;&#116;&#121;&#125;&#94;&#123;&#92;&#105;&#110;&#102;&#116;&#121;&#125;&#92;&#105;&#110;&#116;&#95;&#123;&#76;&#125;&#94;&#123;&#72;&#125;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#120;&#125;&#92;&#108;&#101;&#102;&#116;&#40;&#92;&#102;&#114;&#97;&#99;&#123;&#120;&#125;&#123;&#83;&#95;&#48;&#125;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#94;&#123;&#92;&#102;&#114;&#97;&#99;&#123;&#89;&#125;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#125;&#45;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#50;&#125;&#125;&#32;&#92;&#108;&#101;&#102;&#116;&#40;&#32;&#65;&#45;&#66;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#100;&#120;&#92;&#92;&#32;&#92;&#92; &#38;&#92;&#116;&#101;&#120;&#116;&#123;&#119;&#105;&#116;&#104;&#125;&#92;&#92; &#65;&#38;&#61;&#92;&#101;&#120;&#112;&#92;&#108;&#101;&#102;&#116;&#91;&#45;&#92;&#102;&#114;&#97;&#99;&#123;&#92;&#108;&#101;&#102;&#116;&#40;&#32;&#92;&#108;&#110;&#40;&#120;&#47;&#83;&#95;&#48;&#41;&#43;&#50;&#32;&#110;&#32;&#92;&#108;&#110;&#40;&#72;&#47;&#76;&#41;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#94;&#50;&#125;&#123;&#50;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#32;&#84;&#125;&#92;&#114;&#105;&#103;&#104;&#116;&#93;&#32;&#92;&#92; &#66;&#38;&#61;&#92;&#101;&#120;&#112;&#92;&#108;&#101;&#102;&#116;&#91;&#45;&#92;&#102;&#114;&#97;&#99;&#123;&#92;&#108;&#101;&#102;&#116;&#40;&#32;&#92;&#108;&#110;&#40;&#120;&#32;&#83;&#95;&#48;&#32;&#47;&#32;&#76;&#94;&#50;&#41;&#43;&#50;&#32;&#110;&#32;&#92;&#108;&#110;&#40;&#72;&#47;&#76;&#41;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#94;&#50;&#125;&#123;&#50;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#32;&#84;&#125;&#92;&#114;&#105;&#103;&#104;&#116;&#93;&#32;&#92;&#92; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sitmo.com/article/joint-high-low-probability-of-geometric-brownian-motion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Calculating Correlation and Means with Missing Data</title>
		<link>http://www.sitmo.com/article/calculating-correlation-and-means-with-missing-data/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=calculating-correlation-and-means-with-missing-data</link>
		<comments>http://www.sitmo.com/article/calculating-correlation-and-means-with-missing-data/#comments</comments>
		<pubDate>Fri, 03 Jun 2011 11:32:13 +0000</pubDate>
		<dc:creator>Thijs van den Berg</dc:creator>
				<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://www.sitmo.com/?p=454</guid>
		<description><![CDATA[A great deal has been written about fixing &#8216;invalid correlation matrices&#8217; for risk management purposes. Correlation matrices are invalid when it&#8217;s mathematically impossible to generate random numbers with those mutual correlations. The most common cause of this problem -as seen in finance- is that the correlation matrices numbers are made up, or are based on [...]]]></description>
			<content:encoded><![CDATA[<p>A great deal has been written about fixing &#8216;invalid correlation matrices&#8217;  for risk management purposes. Correlation matrices are invalid when it&#8217;s mathematically impossible to generate random numbers with those mutual correlations. The most common cause of this problem -as seen in finance- is that the correlation matrices numbers are made up, or are based on historical data with a wrong treatment of missing data. This article will show how to solve the later type of problems by explaining how to do a correct estimation of correlation coefficient for data-sets with missing data. The technique to do so is called &#8216;expectation maximization&#8217; (EM). We will illustrate the method by solving a practical example.</p>
<p><span id="more-454"></span></p>
<p>Suppose we have the following set of observations for the two variables <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-2f03c1f47584927899d11e486d005b9e_l3.png" class="ql-img-inline-formula" alt="&#120;&#95;&#49;&#44;&#32;&#120;&#95;&#50;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/>.<br />
The first two observations of <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-01a7b7b5dca66cb33a1207e1f39c1140_l3.png" class="ql-img-inline-formula" alt="&#120;&#95;&#49;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> and the last two observations of <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-f1cd6be340b4fce14489cf5b565a169e_l3.png" class="ql-img-inline-formula" alt="&#120;&#95;&#50;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/> are missing (denoted by &#8216;?&#8217;).</p>
<table class='matrix'>
<caption>Table 1</caption>
<tr>
<th><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-01a7b7b5dca66cb33a1207e1f39c1140_l3.png" class="ql-img-inline-formula" alt="&#120;&#95;&#49;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/></th>
<td style="color:red">?</td>
<td style="color:red">?</td>
<td>15 </td</p>
<td>12 </td>
<td>14 </td>
<td>13 </td>
<td>14 </td>
<td>10 </td>
<td>15 </td>
<td>16 </td>
</tr>
<tr>
<th><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-f1cd6be340b4fce14489cf5b565a169e_l3.png" class="ql-img-inline-formula" alt="&#120;&#95;&#50;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/></th>
<td>12 </td>
<td>11 </td>
<td>18 </td>
<td>16 </td>
<td>19 </td>
<td>17 </td>
<td>15 </td>
<td>19 </td>
<td style="color:red">?</td>
<td style="color:red">?</td>
</tr>
</table>
<p>The first thing to do is to get initial estimates of the means and (co)variances.  These first estimate are made using only <b>complete data</b>. This data is show in  table 2 in bold. All the pairs of data with a value missing are thrown away.</p>
<h3>Estimating the mean</h3>
<table class='matrix'>
<caption>Table 2</caption>
<tr>
<th style="border-right:1px solid #999;text-align*:center">
<img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-01a7b7b5dca66cb33a1207e1f39c1140_l3.png" class="ql-img-inline-formula" alt="&#120;&#95;&#49;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/></th>
<td>? </td>
<td>? </td>
<td><b>15</b> </td>
<td><b>12</b> </td>
<td><b>14</b> </td>
<td><b>13</b> </td>
<td><b>14</b> </td>
<td><b>10</b> </td>
<td>15 </td>
<td>16 </td>
</tr>
<tr>
<th style="border-right:1px solid #999;text-align*:center">
<img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-f1cd6be340b4fce14489cf5b565a169e_l3.png" class="ql-img-inline-formula" alt="&#120;&#95;&#50;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/>
</th>
<td>12 </td>
<td>11 </td>
<td><b>18</b> </td>
<td><b>16</b> </td>
<td><b>19</b> </td>
<td><b>17</b> </td>
<td><b>15</b> </td>
<td><b>19</b> </td>
<td>?  </td>
<td>? </td>
</tr>
</table>
<p>We estimate the means for the two variables <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-2c3ba56a2503367292650af2375155b6_l3.png" class="ql-img-inline-formula" alt="&#92;&#109;&#117;&#95;&#49;&#44;&#92;&#109;&#117;&#95;&#50;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/></p>
<table>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-d149c113f8f37609c8e55fb3c93c8640_l3.png" class="ql-img-inline-formula" alt="&#92;&#109;&#117;&#95;&#49;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/></td>
<td>= (15 </td>
<td>+ 12 </td>
<td>+ &#8230; </td>
<td>+ 10)/6 </td>
<td>= 13</td>
</tr>
<tr>
<td>
<img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-ffdb6b6a231a0c42b4ec6db89b5d09b6_l3.png" class="ql-img-inline-formula" alt="&#92;&#109;&#117;&#95;&#50;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/></td>
<td>= (18 </td>
<td>+ 16 </td>
<td>+ &#8230; </td>
<td>+ 19)/6 </td>
<td>= 17.333</td>
</tr>
</table>
<h3>Esitmating (co)variances</h3>
<p>Next we estimate the covariances using one of the formulas below. Is this case we use the second method.</p>
<p class="ql-center-displayed-equation" style="line-height: 94px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-3ef189eaa0d16d5e63383e025a9e1213_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#95;&#123;&#105;&#106;&#125;&#32;&#38;&#61;&#32;&#92;&#115;&#117;&#109;&#95;&#107;&#32;&#40;&#120;&#95;&#105;&#91;&#107;&#93;&#45;&#92;&#109;&#117;&#95;&#105;&#41;&#40;&#120;&#95;&#106;&#91;&#107;&#93;&#45;&#92;&#109;&#117;&#95;&#106;&#41;&#47;&#110;&#32;&#92;&#92;&#32; &#38;&#61;&#32;&#92;&#115;&#117;&#109;&#95;&#107;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#120;&#95;&#105;&#91;&#107;&#93;&#32;&#120;&#95;&#106;&#91;&#107;&#93;&#125;&#123;&#110;&#125;&#45;&#32;&#92;&#109;&#117;&#95;&#105;&#32;&#92;&#109;&#117;&#95;&#107; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<table>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-a512bc9c8c3b156571157ed28cf88861_l3.png" class="ql-img-inline-formula" alt="&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#95;&#123;&#49;&#49;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -6px;"/></td>
<td>=(15^2 </td>
<td>+ 12^2 </td>
<td>+ &#8230; </td>
<td>+ 10^2</td>
<td>)/6 </td>
<td>- 13^2 </td>
<td>= 2.667</td>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-b90618c8bdfd7e2316582b3551679fac_l3.png" class="ql-img-inline-formula" alt="&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#95;&#123;&#49;&#50;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -6px;"/></td>
<td>=(15*18 </td>
<td>+ 12*16 </td>
<td>+ &#8230; </td>
<td>+ 10*19</td>
<td>)/6 </td>
<td>- 13*17.333 </td>
<td>= -0.5</td>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-a0478069a8f8ae7052fa13d27b8122ac_l3.png" class="ql-img-inline-formula" alt="&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#95;&#123;&#50;&#50;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -5px;"/></td>
<td>=(18^2 </td>
<td>+ 16^2 </td>
<td>+ &#8230; </td>
<td>+ 19^2</td>
<td>)/6 </td>
<td>- 17.333^2 </td>
<td>= 2.222</td>
</tr>
</table>
<h3>Estimating the correlation</h3>
<p>Finally, we get the first estimate of the correlation:</p>
<p class="ql-center-displayed-equation" style="line-height: 33px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-1a5364d8dcc77f5e947355732cba0f3b_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#92;&#114;&#104;&#111;&#32;&#61;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#95;&#123;&#49;&#50;&#125;&#47;&#92;&#115;&#113;&#114;&#116;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#95;&#123;&#49;&#49;&#125;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#95;&#123;&#50;&#50;&#125;&#125; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<table>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-da039068127cf2ec5fc05123d4d3546f_l3.png" class="ql-img-inline-formula" alt="&#92;&#114;&#104;&#111;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/></td>
<td>= -0.2054</td>
</tr>
</table>
<h3>Using a linear model to fill in the missing data</h3>
<p>The EM algorithms starts by finding values for the missing data, and the uncertainty of those estimates. The best guesses for the missing values are made using a least squares linear fits.  </p>
<p>This first model will predict the missing values of <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-01a7b7b5dca66cb33a1207e1f39c1140_l3.png" class="ql-img-inline-formula" alt="&#120;&#95;&#49;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> based on <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-f1cd6be340b4fce14489cf5b565a169e_l3.png" class="ql-img-inline-formula" alt="&#120;&#95;&#50;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/> using <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-aa3c36ff3911968d563335b8cce9aa7f_l3.png" class="ql-img-inline-formula" alt="&#120;&#95;&#49;&#32;&#61;&#32;&#97;&#32;&#120;&#95;&#50;&#32;&#43;&#32;&#98;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/>. This is illustrated in the plot below.  The line is the linear fit, and  values for <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-01a7b7b5dca66cb33a1207e1f39c1140_l3.png" class="ql-img-inline-formula" alt="&#120;&#95;&#49;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> are determined for <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-4051cf70ddb965fc9b3e45d42587ec21_l3.png" class="ql-img-inline-formula" alt="&#120;&#95;&#50;&#61;&#49;&#49;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/> and  <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-77fade6c76eef11c28346b64c356a680_l3.png" class="ql-img-inline-formula" alt="&#120;&#95;&#50;&#61;&#49;&#50;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/>. </p>
<p><img src="http://www.sitmo.com/wp-content/uploads/2011/06/em_correlation2.png" alt="" title="em_correlation2" width="300" height="200" class="align*center size-full wp-image-460" /></p>
<p>The second model is the other way around, <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-29a5905a32312afbf37ea7da749875db_l3.png" class="ql-img-inline-formula" alt="&#120;&#95;&#50;&#32;&#61;&#32;&#97;&#32;&#120;&#95;&#49;&#32;&#43;&#32;&#98;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> and will be used to predict the missing values of <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-f1cd6be340b4fce14489cf5b565a169e_l3.png" class="ql-img-inline-formula" alt="&#120;&#95;&#50;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/>.<br />
<img src="http://www.sitmo.com/wp-content/uploads/2011/06/em_correlation.png" alt="" title="em_correlation" width="300" height="200" class="align*center size-full wp-image-459" /></p>
<p>Using the means and covariances, we get the following linear models</p>
<p class="ql-center-displayed-equation" style="line-height: 51px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-5fbab646da562911cc974b1b8ff4918f_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#120;&#95;&#49;&#32;&#38;&#61;&#32;&#92;&#109;&#117;&#95;&#49;&#32;&#43;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#95;&#123;&#49;&#50;&#125;&#32;&#47;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#95;&#123;&#50;&#50;&#125;&#32;&#92;&#108;&#101;&#102;&#116;&#40;&#32;&#120;&#95;&#50;&#32;&#45;&#32;&#92;&#109;&#117;&#95;&#50;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#92;&#92;&#32; &#120;&#95;&#50;&#32;&#38;&#61;&#32;&#92;&#109;&#117;&#95;&#50;&#32;&#43;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#95;&#123;&#49;&#50;&#125;&#32;&#47;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#95;&#123;&#49;&#49;&#125;&#32;&#92;&#108;&#101;&#102;&#116;&#40;&#32;&#120;&#95;&#49;&#32;&#45;&#32;&#92;&#109;&#117;&#95;&#49;&#92;&#114;&#105;&#103;&#104;&#116;&#41; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<p>The estimate for the first missing value of  <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-01a7b7b5dca66cb33a1207e1f39c1140_l3.png" class="ql-img-inline-formula" alt="&#120;&#95;&#49;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> that corresponds with the value 12 for <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-f1cd6be340b4fce14489cf5b565a169e_l3.png" class="ql-img-inline-formula" alt="&#120;&#95;&#50;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/> will thus be</p>
<table>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-c546b5334e2fc57ba871b7589f4c0bc4_l3.png" class="ql-img-inline-formula" alt="&#120;&#95;&#49;&#91;&#49;&#93;" title="Rendered by QuickLaTeX.com" style="vertical-align: -5px;"/> = 13 + -0.5 / 2.222 (12 &#8211; 17.333) = 14.2</td>
</tr>
</table>
<p>Table 3 shows the completed table with all four missing values estimated</p>
<table class="matrix">
<caption>Table 3</caption>
<tr>
<th style="border-right:1px solid #999;text-align*:center">
<img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-01a7b7b5dca66cb33a1207e1f39c1140_l3.png" class="ql-img-inline-formula" alt="&#120;&#95;&#49;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/>
</th>
<td><b>14.2</b> </td>
<td><b>14.4</b> </td>
<td>15 </td>
<td>12 </td>
<td>14 </td>
<td>13 </td>
<td>14 </td>
<td>10 </td>
<td>15 </td>
<td>16 </td>
</tr>
<tr>
<th style="border-right:1px solid #999;text-align*:center">
<img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-f1cd6be340b4fce14489cf5b565a169e_l3.png" class="ql-img-inline-formula" alt="&#120;&#95;&#50;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/>
</th>
<td>12 </td>
<td>11 </td>
<td>18 </td>
<td>16 </td>
<td>19 </td>
<td>17 </td>
<td>15 </td>
<td>19 </td>
<td><b>17.0</b> </td>
<td><b>16.8</b> </td>
</tr>
</table>
<h3>Main loop</h3>
<p>After estimating values for the missing data using least squares linear regression, we are ready to enter the iterative loop that converges to an optimal solution of the correlation estimate.</p>
<h3>Updating the means</h3>
<p>We estimate new values for means <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-afb09d2cf1452e48746ad5c58665d0a6_l3.png" class="ql-img-inline-formula" alt="&#92;&#109;&#117;&#94;&#92;&#112;&#114;&#105;&#109;&#101;&#95;&#49;&#44;&#92;&#109;&#117;&#94;&#92;&#112;&#114;&#105;&#109;&#101;&#95;&#50;" title="Rendered by QuickLaTeX.com" style="vertical-align: -6px;"/> using the completed data </p>
<table>
<tr>
<td>
<img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-45d47f2d0463758295a41345b4204349_l3.png" class="ql-img-inline-formula" alt="&#92;&#109;&#117;&#94;&#92;&#112;&#114;&#105;&#109;&#101;&#95;&#49;" title="Rendered by QuickLaTeX.com" style="vertical-align: -6px;"/></td>
<td>= (14.2 </td>
<td>+ 14.4 </td>
<td>+ 15 &#8230; </td>
<td>+ 10 </td>
<td>+ 15 </td>
<td>+ 16 </td>
<td>)/10 </td>
<td>= 13.76</td>
</tr>
<tr>
<td>
<img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-942d7ae4bab7ade96c14543d06d0aba2_l3.png" class="ql-img-inline-formula" alt="&#92;&#109;&#117;&#94;&#92;&#112;&#114;&#105;&#109;&#101;&#95;&#50;" title="Rendered by QuickLaTeX.com" style="vertical-align: -5px;"/></td>
<td>= (12 </td>
<td>+ 11 </td>
<td>+ 18  &#8230; </td>
<td>+ 19 </td>
<td>+ 17.0 </td>
<td>+ 16.8 </td>
<td>)/10 </td>
<td>= 16.07 </td>
</tr>
</table>
<h3>Updating the (co)variances</h3>
<p>Next we update the covariances using one of the formulas below. These equations are the same as before, except that they have an additional term in the variance estimates that correct for the uncertainty in estimates of <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-d6d703ffbc595d34de6fd65fdbaa27e6_l3.png" class="ql-img-inline-formula" alt="&#109;&#95;&#105;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/> <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-c8700e0258243116de0d4f288e2e3b44_l3.png" class="ql-img-inline-formula" alt="&#120;&#95;&#105;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/></p>
<p class="ql-center-displayed-equation" style="line-height: 197px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-a9d7deb158ed2d20233075fde996c748_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#92;&#115;&#105;&#103;&#109;&#97;&#94;&#123;&#50;&#92;&#112;&#114;&#105;&#109;&#101;&#125;&#95;&#123;&#105;&#105;&#125;&#32;&#38;&#61;&#32;&#92;&#115;&#117;&#109;&#95;&#107;&#32;&#40;&#120;&#95;&#105;&#91;&#107;&#93;&#45;&#92;&#109;&#117;&#95;&#105;&#41;&#94;&#50;&#47;&#110;&#32;&#43;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#95;&#123;&#105;&#105;&#125;&#40;&#49;&#45;&#92;&#114;&#104;&#111;&#94;&#50;&#41;&#109;&#95;&#105;&#47;&#110;&#92;&#92;&#32; &#38;&#61;&#32;&#92;&#115;&#117;&#109;&#95;&#107;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#120;&#95;&#105;&#91;&#107;&#93;&#32;&#120;&#95;&#106;&#91;&#107;&#93;&#125;&#123;&#110;&#125;&#45;&#32;&#92;&#109;&#117;&#94;&#50;&#95;&#105;&#32;&#43;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#95;&#123;&#105;&#105;&#125;&#40;&#49;&#45;&#92;&#114;&#104;&#111;&#94;&#50;&#41;&#109;&#95;&#105;&#47;&#110;&#92;&#92;&#32; &#92;&#115;&#105;&#103;&#109;&#97;&#94;&#123;&#50;&#92;&#112;&#114;&#105;&#109;&#101;&#125;&#95;&#123;&#105;&#106;&#125;&#32;&#38;&#61;&#32;&#92;&#115;&#117;&#109;&#95;&#107;&#32;&#40;&#120;&#95;&#105;&#91;&#107;&#93;&#45;&#92;&#109;&#117;&#95;&#105;&#41;&#40;&#120;&#95;&#106;&#91;&#107;&#93;&#45;&#92;&#109;&#117;&#95;&#106;&#41;&#47;&#110;&#32;&#92;&#92;&#32; &#38;&#61;&#32;&#92;&#115;&#117;&#109;&#95;&#107;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#120;&#95;&#105;&#91;&#107;&#93;&#32;&#120;&#95;&#106;&#91;&#107;&#93;&#125;&#123;&#110;&#125;&#45;&#32;&#92;&#109;&#117;&#95;&#105;&#32;&#92;&#109;&#117;&#95;&#107;&#32;&#92;&#92;&#32; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<table>
<tr>
<td>
<img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-3063d8de0e03b5ac5f272a14bf20622c_l3.png" class="ql-img-inline-formula" alt="&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#123;&#50;&#92;&#112;&#114;&#105;&#109;&#101;&#125;&#95;&#123;&#49;&#49;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -6px;"/>
</td>
<td>=(14.2^2 </td>
<td>+ 14.4^2 </td>
<td>+ &#8230; </td>
<td>+ 16^2</td>
<td>)/10 </td>
<td>- 13.76^2 </td>
<td>+ 2.667 (1 &#8211; 0.042) 2/10</td>
<td>= 3.18</td>
</tr>
<tr>
<td>
<img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-f00c66db9d907979604ccf52631b8772_l3.png" class="ql-img-inline-formula" alt="&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#123;&#50;&#92;&#112;&#114;&#105;&#109;&#101;&#125;&#95;&#123;&#49;&#50;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -6px;"/>
</td>
<td>=(14.2*12 </td>
<td>+ 14.4*11 </td>
<td>+ &#8230; </td>
<td>+ 16*16.8</td>
<td>)/10 </td>
<td>- 13.76*16.07 </td>
<td> </td>
<td>= -1.13</td>
</tr>
<tr>
<td>
<img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-ccab98ce1386f301ed1cac57564c74e9_l3.png" class="ql-img-inline-formula" alt="&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#123;&#50;&#92;&#112;&#114;&#105;&#109;&#101;&#125;&#95;&#123;&#50;&#50;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -5px;"/>
</td>
<td>=(12^2 </td>
<td>+ 11^2 </td>
<td>+ &#8230; </td>
<td>+ 16.8^2</td>
<td>)/10 </td>
<td>- 16.07^2 </td>
<td> +2.222(1 &#8211; 0.042) 2/10 </td>
<td>= 7.07</td>
</tr>
</table>
<h3>Updating the correlation</h3>
<p>Finally, we get an update of the correlation:</p>
<p class="ql-center-displayed-equation" style="line-height: 33px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-c96e6098b01d62650079999f143ca9d5_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#92;&#114;&#104;&#111;&#94;&#92;&#112;&#114;&#105;&#109;&#101;&#32;&#61;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#123;&#50;&#92;&#112;&#114;&#105;&#109;&#101;&#125;&#95;&#123;&#49;&#50;&#125;&#47;&#92;&#115;&#113;&#114;&#116;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#123;&#50;&#92;&#112;&#114;&#105;&#109;&#101;&#125;&#95;&#123;&#49;&#49;&#125;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#123;&#50;&#92;&#112;&#114;&#105;&#109;&#101;&#125;&#95;&#123;&#50;&#50;&#125;&#125; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<table>
<tr>
<td>
<img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-aa2812929891c876b2d98ad7b75fc975_l3.png" class="ql-img-inline-formula" alt="&#92;&#114;&#104;&#111;&#94;&#92;&#112;&#114;&#105;&#109;&#101;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/></td>
<td>= -0.2374</td>
</tr>
</table>
<h3>Updating the estimates of the missing data</h3>
<p>Using the updated means and covariances, we get the following linear models</p>
<p class="ql-center-displayed-equation" style="line-height: 52px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-96f59723a2d934bef0fe14de23554ff7_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#120;&#95;&#49;&#32;&#38;&#61;&#32;&#92;&#109;&#117;&#94;&#92;&#112;&#114;&#105;&#109;&#101;&#95;&#49;&#32;&#43;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#123;&#50;&#92;&#112;&#114;&#105;&#109;&#101;&#125;&#95;&#123;&#49;&#50;&#125;&#32;&#47;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#123;&#50;&#92;&#112;&#114;&#105;&#109;&#101;&#125;&#95;&#123;&#50;&#50;&#125;&#32;&#92;&#108;&#101;&#102;&#116;&#40;&#32;&#120;&#95;&#50;&#32;&#45;&#32;&#92;&#109;&#117;&#94;&#92;&#112;&#114;&#105;&#109;&#101;&#95;&#50;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#92;&#92;&#32; &#120;&#95;&#50;&#32;&#38;&#61;&#32;&#92;&#109;&#117;&#94;&#92;&#112;&#114;&#105;&#109;&#101;&#95;&#50;&#32;&#43;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#123;&#50;&#92;&#112;&#114;&#105;&#109;&#101;&#125;&#95;&#123;&#49;&#50;&#125;&#32;&#47;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#123;&#50;&#92;&#112;&#114;&#105;&#109;&#101;&#125;&#95;&#123;&#49;&#49;&#125;&#32;&#92;&#108;&#101;&#102;&#116;&#40;&#32;&#120;&#95;&#49;&#32;&#45;&#32;&#92;&#109;&#117;&#94;&#92;&#112;&#114;&#105;&#109;&#101;&#95;&#49;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#32; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<p>The first missing value of <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-2f03c1f47584927899d11e486d005b9e_l3.png" class="ql-img-inline-formula" alt="&#120;&#95;&#49;&#44;&#32;&#120;&#95;&#50;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> will thus become</p>
<table>
<tr>
<td>
<img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-c546b5334e2fc57ba871b7589f4c0bc4_l3.png" class="ql-img-inline-formula" alt="&#120;&#95;&#49;&#91;&#49;&#93;" title="Rendered by QuickLaTeX.com" style="vertical-align: -5px;"/> = 13.76 + -1.13 / 7.07 (12 &#8211; 16.07) = 14.41
</td>
</tr>
</table>
<p>Table 4 shows the completed table with all four missing values updated</p>
<table class='matrix'>
<caption>Table 4</caption>
<tr>
<th style="border-right:1px solid #999;text-align*:center">
<img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-01a7b7b5dca66cb33a1207e1f39c1140_l3.png" class="ql-img-inline-formula" alt="&#120;&#95;&#49;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/>
</th>
<td><b>14.4</b> </td>
<td><b>14.6</b> </td>
<td>15 </td>
<td>12 </td>
<td>14 </td>
<td>13 </td>
<td>14 </td>
<td>10 </td>
<td>15 </td>
<td>16 </td>
</tr>
<tr>
<th style="border-right:1px solid #999;text-align*:center">
<img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-f1cd6be340b4fce14489cf5b565a169e_l3.png" class="ql-img-inline-formula" alt="&#120;&#95;&#50;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/>
</th>
<td>12 </td>
<td>11 </td>
<td>18 </td>
<td>16 </td>
<td>19 </td>
<td>17 </td>
<td>15 </td>
<td>19 </td>
<td><b>15.6</b>  </td>
<td><b>15.3</b>
</td>
</tr>
</table>
<h3>Repeating the process</h3>
<p>These steps are repeated -starting with updating the means- a number of times untill the values converge.</p>
<table class='matrix'>
<caption></caption>
<tr>
<th> step	</th>
<th> <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-d149c113f8f37609c8e55fb3c93c8640_l3.png" class="ql-img-inline-formula" alt="&#92;&#109;&#117;&#95;&#49;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> </th>
<th> <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-ffdb6b6a231a0c42b4ec6db89b5d09b6_l3.png" class="ql-img-inline-formula" alt="&#92;&#109;&#117;&#95;&#50;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> </th>
<th> <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-a512bc9c8c3b156571157ed28cf88861_l3.png" class="ql-img-inline-formula" alt="&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#95;&#123;&#49;&#49;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -6px;"/> </th>
<th> <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-b90618c8bdfd7e2316582b3551679fac_l3.png" class="ql-img-inline-formula" alt="&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#95;&#123;&#49;&#50;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -6px;"/> </th>
<th> <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-a0478069a8f8ae7052fa13d27b8122ac_l3.png" class="ql-img-inline-formula" alt="&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#95;&#123;&#50;&#50;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -5px;"/> </th>
<th> <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-da039068127cf2ec5fc05123d4d3546f_l3.png" class="ql-img-inline-formula" alt="&#92;&#114;&#104;&#111;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> </th>
<th> <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-c546b5334e2fc57ba871b7589f4c0bc4_l3.png" class="ql-img-inline-formula" alt="&#120;&#95;&#49;&#91;&#49;&#93;" title="Rendered by QuickLaTeX.com" style="vertical-align: -5px;"/>	</th>
<th> <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-cf74c990dbb92837839315202aa2a948_l3.png" class="ql-img-inline-formula" alt="&#120;&#95;&#49;&#91;&#50;&#93;" title="Rendered by QuickLaTeX.com" style="vertical-align: -5px;"/> </th>
<th> <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-58214270071e5ea30c84fe334ffe8090_l3.png" class="ql-img-inline-formula" alt="&#120;&#95;&#50;&#91;&#57;&#93;" title="Rendered by QuickLaTeX.com" style="vertical-align: -5px;"/> </th>
<th> <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-0986ac284703d18ad76850b8a72347fc_l3.png" class="ql-img-inline-formula" alt="&#120;&#95;&#50;&#91;&#49;&#48;&#93;" title="Rendered by QuickLaTeX.com" style="vertical-align: -5px;"/> </th>
</tr>
<tr>
<td> 0	</td>
<td> 13.00	</td>
<td> 17.33	</td>
<td> 2.67	</td>
<td> -0.50	</td>
<td> 2.22	</td>
<td> -0.21	</td>
<td> 14.20	</td>
<td> 14.42	</td>
<td> 16.96	</td>
<td> 16.77
</td>
</tr>
<tr>
<td> 1	</td>
<td> 13.76	</td>
<td> 16.07	</td>
<td> 3.18	</td>
<td> -1.13	</td>
<td> 7.07	</td>
<td> -0.24	</td>
<td> 14.41	</td>
<td> 14.57	</td>
<td> 15.63	</td>
<td> 15.28
</td>
</tr>
<tr>
<td> 2	</td>
<td> 13.80	</td>
<td> 15.79	</td>
<td> 3.31	</td>
<td> -1.77	</td>
<td> 7.86	</td>
<td> -0.35	</td>
<td> 14.65	</td>
<td> 14.88	</td>
<td> 15.15	</td>
<td> 14.61
</td>
</tr>
<tr>
<td> 3	</td>
<td> 13.85	</td>
<td> 15.68	</td>
<td> 3.38	</td>
<td> -2.21	</td>
<td> 8.04	</td>
<td> -0.42	</td>
<td> 14.86	</td>
<td> 15.14	</td>
<td> 14.93	</td>
<td> 14.27
</td>
</tr>
<tr>
<td> 4	</td>
<td> 13.90	</td>
<td> 15.62	</td>
<td> 3.45	</td>
<td> -2.51	</td>
<td> 8.09	</td>
<td> -0.47	</td>
<td> 15.02	</td>
<td> 15.33	</td>
<td> 14.82	</td>
<td> 14.09
</td>
</tr>
<tr>
<td> 5	</td>
<td> 13.94	</td>
<td> 15.59	</td>
<td> 3.51	</td>
<td> -2.70	</td>
<td> 8.09	</td>
<td> -0.51	</td>
<td> 15.13	</td>
<td> 15.47	</td>
<td> 14.77	</td>
<td> 14.00
</td>
</tr>
<tr>
<td> 6	</td>
<td> 13.96	</td>
<td> 15.58	</td>
<td> 3.56	</td>
<td> -2.83	</td>
<td> 8.07	</td>
<td> -0.53	</td>
<td> 15.21	</td>
<td> 15.56	</td>
<td> 14.75	</td>
<td> 13.96
</td>
</tr>
<tr>
<td> 7	</td>
<td> 13.98	</td>
<td> 15.57	</td>
<td> 3.61	</td>
<td> -2.91	</td>
<td> 8.05	</td>
<td> -0.54	</td>
<td> 15.27	</td>
<td> 15.63	</td>
<td> 14.75	</td>
<td> 13.94
</td>
</tr>
<tr>
<td> 8	</td>
<td> 13.99	</td>
<td> 15.57	</td>
<td> 3.64	</td>
<td> -2.96	</td>
<td> 8.04	</td>
<td> -0.55	</td>
<td> 15.31	</td>
<td> 15.67	</td>
<td> 14.75	</td>
<td> 13.93
</td>
</tr>
<tr>
<td> 9	</td>
<td> 14.00	</td>
<td> 15.57	</td>
<td> 3.66	</td>
<td> -3.00	</td>
<td> 8.02	</td>
<td> -0.55	</td>
<td> 15.33	</td>
<td> 15.71	</td>
<td> 14.75	</td>
<td> 13.93
</td>
</tr>
<tr>
<td> 10	</td>
<td> 14.00	</td>
<td> 15.57	</td>
<td> 3.68	</td>
<td> -3.02	</td>
<td> 8.01	</td>
<td> -0.56	</td>
<td> 15.35	</td>
<td> 15.73	</td>
<td> 14.75	</td>
<td> 13.93
</td>
</tr>
<tr>
<td> 11	</td>
<td> 14.01	</td>
<td> 15.57	</td>
<td> 3.69	</td>
<td> -3.04	</td>
<td> 8.01	</td>
<td> -0.56	</td>
<td> 15.36	</td>
<td> 15.74	</td>
<td> 14.75	</td>
<td> 13.92
</td>
</tr>
<tr>
<td> 12	</td>
<td> 14.01	</td>
<td> 15.57	</td>
<td> 3.70	</td>
<td> -3.05	</td>
<td> 8.00	</td>
<td> -0.56	</td>
<td> 15.37	</td>
<td> 15.75	</td>
<td> 14.75	</td>
<td> 13.92
</td>
</tr>
<tr>
<td> 13	</td>
<td> 14.01	</td>
<td> 15.57	</td>
<td> 3.70	</td>
<td> -3.06	</td>
<td> 8.00	</td>
<td> -0.56	</td>
<td> 15.38	</td>
<td> 15.76	</td>
<td> 14.75	</td>
<td> 13.92
</td>
</tr>
<tr>
<td> 14	</td>
<td> 14.01	</td>
<td> 15.57	</td>
<td> 3.71	</td>
<td> -3.07	</td>
<td> 7.99	</td>
<td> -0.56	</td>
<td> 15.38	</td>
<td> 15.77	</td>
<td> 14.75	</td>
<td> 13.92
</td>
</tr>
<tr>
<td> 15	</td>
<td> 14.01	</td>
<td> 15.57	</td>
<td> 3.71	</td>
<td> -3.07	</td>
<td> 7.99	</td>
<td> -0.56	</td>
<td> 15.38	</td>
<td> 15.77	</td>
<td> 14.75	</td>
<td> 13.92
</td>
</tr>
</table>
<h3>Conclusions</h3>
<p>This example shows that estimating correlation based on missing data can give substantial different values compared to methods that throw away all  samples that have missing data. The initial guess of this algorithm gives a correlation of -0.21, which is a correlation estimate based on removing all missing data sampled. The final results is a correlation of -0.56. An explanation for this big difference is that two samples of <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-f1cd6be340b4fce14489cf5b565a169e_l3.png" class="ql-img-inline-formula" alt="&#120;&#95;&#50;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/> are thrown away deviate strongly from the other values of <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-f1cd6be340b4fce14489cf5b565a169e_l3.png" class="ql-img-inline-formula" alt="&#120;&#95;&#50;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/>. When including those samples, the estimate of the mean changes considerably (17.33 vs 16.07), which in turns has a strong impact in the estimate of the variance of <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-f1cd6be340b4fce14489cf5b565a169e_l3.png" class="ql-img-inline-formula" alt="&#120;&#95;&#50;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/> (2.22 vs 7.07).</p>
<h3>Bibliography</h3>
<p><i>R. Rebonato, P. Jackel</i> &#8211; <b>The most general methodology to create a valid correlation matrix for risk management and option pricing purposes</b><a href="http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.16.49&#038;rank=1">URL</a></p>
<p><i>Mortaza Jamshidian, Peter M. Bentler</i> &#8211; <b>ML Estimation of Mean and Covariance Structures with Missing Data Using Complete Data Routines</b> <a href="http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.36.2205&#038;rank=1">URL</a></p>
<p><i>Roderick J A Little, Donald B Rubin</i> &#8211; <b>Statistical analysis with missing data</b><br />
John Wiley \&amp; Sons, Inc., New York, NY, USA, 1986</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sitmo.com/article/calculating-correlation-and-means-with-missing-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Probability of the High of Geometric Brownian Motion</title>
		<link>http://www.sitmo.com/article/probability-of-the-high-of-geometric-brownian-motion/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=probability-of-the-high-of-geometric-brownian-motion</link>
		<comments>http://www.sitmo.com/article/probability-of-the-high-of-geometric-brownian-motion/#comments</comments>
		<pubDate>Tue, 31 May 2011 20:00:26 +0000</pubDate>
		<dc:creator>Thijs van den Berg</dc:creator>
				<category><![CDATA[Equations]]></category>

		<guid isPermaLink="false">http://www.sitmo.com/?p=417</guid>
		<description><![CDATA[This article describes the probability distribution of the high of a geometric Brownian motion. An equation is given that calculates the probability that the high is above a certain level H within a given timeframe 0&#60;t&#60;T. Equation &#160; &#160; The highest value of in the time period 0]]></description>
			<content:encoded><![CDATA[<p>This article describes the probability distribution of the high of a geometric Brownian motion.<br />
An equation is given that calculates the probability that the high is above a<br />
certain level H within a given timeframe 0&lt;t&lt;T.<br />
<span id="more-417"></span></p>
<div id="attachment_420" class="wp-caption aligncenter" style="width: 310px"><img src="http://www.sitmo.com/wp-content/uploads/2011/05/GBMHigh.png" alt="" title="GBMHigh" width="300" height="200" class="size-full wp-image-420" /><p class="wp-caption-text">Three scenarios of a stock price, of which one has a high above 180.</p></div>
<h3>Equation</h3>
<p class="ql-center-displayed-equation" style="line-height: 152px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-c206e4fa9720801c287509c73885479a_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#80;&#32;&#32;&#92;&#108;&#101;&#102;&#116;&#40;&#92;&#109;&#97;&#120;&#95;&#123;&#48;&#60;&#116;&#60;&#84;&#125;&#32;&#83;&#95;&#116;&#32;&#92;&#103;&#101;&#32;&#72;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#38;&#61;&#92;&#116;&#101;&#120;&#116;&#115;&#116;&#121;&#108;&#101;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#50;&#125;&#32;&#92;&#116;&#101;&#120;&#116;&#123;&#69;&#114;&#102;&#99;&#125;&#40;&#100;&#95;&#49;&#41;&#43;&#92;&#116;&#101;&#120;&#116;&#115;&#116;&#121;&#108;&#101;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#50;&#125;&#92;&#108;&#101;&#102;&#116;&#40;&#92;&#102;&#114;&#97;&#99;&#123;&#72;&#125;&#123;&#83;&#95;&#48;&#125;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#94;&#123;&#92;&#102;&#114;&#97;&#99;&#123;&#50;&#92;&#109;&#117;&#125;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#125;&#45;&#49;&#125;&#92;&#116;&#101;&#120;&#116;&#123;&#69;&#114;&#102;&#99;&#125;&#40;&#100;&#95;&#50;&#41;&#92;&#92; &#100;&#95;&#49;&#32;&#38;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#92;&#108;&#110;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#72;&#125;&#123;&#83;&#95;&#48;&#125;&#32;&#45;&#32;&#32;&#40;&#92;&#109;&#117;&#45;&#92;&#116;&#101;&#120;&#116;&#115;&#116;&#121;&#108;&#101;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#50;&#125;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#41;&#84;&#125;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#92;&#115;&#113;&#114;&#116;&#123;&#50;&#84;&#125;&#32;&#125;&#92;&#92; &#100;&#95;&#50;&#32;&#38;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#92;&#108;&#110;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#72;&#125;&#123;&#83;&#95;&#48;&#125;&#32;&#43;&#32;&#40;&#92;&#109;&#117;&#45;&#92;&#116;&#101;&#120;&#116;&#115;&#116;&#121;&#108;&#101;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#50;&#125;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#41;&#84;&#125;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#92;&#115;&#113;&#114;&#116;&#123;&#50;&#84;&#125;&#32;&#125;&#32;&#92;&#92; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<table>
<tr>
<td> <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-f5021a981d2cd4349fdd4f5a8f2a528f_l3.png" class="ql-img-inline-formula" alt="&#92;&#109;&#97;&#120;&#95;&#123;&#48;&#60;&#116;&#60;&#84;&#125;&#32;&#32;&#83;&#95;&#116;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/></td>
<td> The highest value of <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-3e279cd3791c554f6a9337bcf21d1b1b_l3.png" class="ql-img-inline-formula" alt="&#83;&#95;&#116;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/> in the time period 0<t<T</td>
</tr>
<tr>
<td> H</td>
<td> The level of the high for which the probability is calculated</td>
</tr>
<tr>
<td> <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-d93e619cd77e3f792ef6dbca1079f902_l3.png" class="ql-img-inline-formula" alt="&#83;&#95;&#48;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/></td>
<td> The current value of the geometric Brownian motion</td>
</tr>
<tr>
<td> <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-3e279cd3791c554f6a9337bcf21d1b1b_l3.png" class="ql-img-inline-formula" alt="&#83;&#95;&#116;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/></td>
<td> The value of the geometric Brownian motion at time t</td>
</tr>
<tr>
<td> <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-461fe1a58a75801541487ddf10d32abd_l3.png" class="ql-img-inline-formula" alt="&#92;&#109;&#117;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/></td>
<td> The drift of the geometric Brownian motion</td>
</tr>
<tr>
<td> <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-1c9cc40f96a1492e298e7da85a2c1692_l3.png" class="ql-img-inline-formula" alt="&#92;&#115;&#105;&#103;&#109;&#97;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/></td>
<td> The volatility of the geometric Brownian motion </td>
</tr>
<tr>
<td> Erfc</td>
<td> The complementary error function</td>
</tr>
<tr>
<td> ln</td>
<td> Natural logarithm</td>
</tr>
</table>
<h2>Example equation usage</h2>
<div class='note'>
We want to know the probability that the high of a stock in the upcoming<br />
three years is above 180. The current stock price is 100,<br />
and its volatility 30%. Current interest rates are 5%, and<br />
we assume that the stock has a yield equal to the interest rate.
</div>
<h3>Parameter values</h3>
<table class='matrix'>
<tr>
<td> T</td>
<td> 3</td>
</tr>
<tr>
<td> H</td>
<td> 180</td>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-d93e619cd77e3f792ef6dbca1079f902_l3.png" class="ql-img-inline-formula" alt="&#83;&#95;&#48;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/></td>
<td> 100</td>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-461fe1a58a75801541487ddf10d32abd_l3.png" class="ql-img-inline-formula" alt="&#92;&#109;&#117;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/></td>
<td> 0.05</td>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-1c9cc40f96a1492e298e7da85a2c1692_l3.png" class="ql-img-inline-formula" alt="&#92;&#115;&#105;&#103;&#109;&#97;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/></td>
<td> 0.30</td>
</tr>
</table>
<h3>Substitution of values &#8230; </h3>
<p class="ql-center-displayed-equation" style="line-height: 113px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-8afa2ccfe2fcef998a86ce3f79f4e089_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#100;&#95;&#49;&#32;&#32;&#38;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#92;&#108;&#110;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#56;&#48;&#125;&#123;&#49;&#48;&#48;&#125;&#32;&#45;&#32;&#32;&#40;&#48;&#46;&#48;&#53;&#32;&#45;&#32;&#92;&#116;&#101;&#120;&#116;&#115;&#116;&#121;&#108;&#101;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#50;&#125;&#48;&#46;&#51;&#48;&#94;&#50;&#41;&#51;&#125;&#123;&#48;&#46;&#51;&#48;&#92;&#115;&#113;&#114;&#116;&#123;&#50;&#42;&#51;&#125;&#32;&#125;&#92;&#92; &#32;&#38;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#48;&#46;&#53;&#55;&#50;&#55;&#57;&#32;&#45;&#32;&#32;&#40;&#48;&#46;&#48;&#53;&#32;&#45;&#32;&#48;&#46;&#48;&#52;&#53;&#41;&#51;&#125;&#123;&#48;&#46;&#55;&#51;&#52;&#56;&#53;&#125;&#92;&#92; &#32;&#38;&#61;&#32;&#48;&#46;&#55;&#55;&#57;&#52;&#54; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<p>and</p>
<p class="ql-center-displayed-equation" style="line-height: 112px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-471dbcf61da3ec4ecccd6e20633b11c3_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#100;&#95;&#50;&#32;&#32;&#38;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#92;&#108;&#110;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#56;&#48;&#125;&#123;&#49;&#48;&#48;&#125;&#32;&#43;&#32;&#32;&#40;&#48;&#46;&#48;&#53;&#32;&#45;&#32;&#92;&#116;&#101;&#120;&#116;&#115;&#116;&#121;&#108;&#101;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#50;&#125;&#48;&#46;&#51;&#48;&#94;&#50;&#41;&#51;&#125;&#123;&#48;&#46;&#51;&#48;&#92;&#115;&#113;&#114;&#116;&#123;&#50;&#42;&#51;&#125;&#32;&#125;&#92;&#92; &#32;&#38;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#48;&#46;&#53;&#55;&#50;&#55;&#57;&#32;&#43;&#32;&#40;&#48;&#46;&#48;&#53;&#32;&#45;&#32;&#48;&#46;&#48;&#52;&#53;&#41;&#51;&#125;&#123;&#48;&#46;&#55;&#51;&#52;&#56;&#53;&#125;&#92;&#92; &#38;&#61;&#32;&#48;&#46;&#56;&#50;&#48;&#50;&#57; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<p>thus</p>
<p class="ql-center-displayed-equation" style="line-height: 78px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-c0931d11a4f10f5aa11b179452cba00e_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#80;&#32;&#32;&#38;&#61;&#32;&#92;&#116;&#101;&#120;&#116;&#115;&#116;&#121;&#108;&#101;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#50;&#125;&#32;&#92;&#116;&#101;&#120;&#116;&#123;&#69;&#114;&#102;&#99;&#125;&#40;&#100;&#95;&#49;&#41;&#43;&#92;&#116;&#101;&#120;&#116;&#115;&#116;&#121;&#108;&#101;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#50;&#125;&#92;&#108;&#101;&#102;&#116;&#40;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#56;&#48;&#125;&#123;&#49;&#48;&#48;&#125;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#94;&#123;&#92;&#102;&#114;&#97;&#99;&#123;&#50;&#32;&#32;&#42;&#48;&#46;&#48;&#53;&#125;&#123;&#48;&#46;&#51;&#48;&#94;&#50;&#125;&#45;&#49;&#125;&#92;&#116;&#101;&#120;&#116;&#123;&#69;&#114;&#102;&#99;&#125;&#40;&#100;&#95;&#50;&#41;&#32;&#92;&#92; &#38;&#61;&#32;&#92;&#116;&#101;&#120;&#116;&#115;&#116;&#121;&#108;&#101;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#50;&#125;&#32;&#48;&#46;&#50;&#55;&#48;&#51;&#50;&#32;&#43;&#32;&#92;&#116;&#101;&#120;&#116;&#115;&#116;&#121;&#108;&#101;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#50;&#125;&#32;&#92;&#108;&#101;&#102;&#116;&#40;&#49;&#46;&#56;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#94;&#123;&#48;&#46;&#49;&#49;&#49;&#49;&#125;&#32;&#48;&#46;&#50;&#52;&#54;&#48;&#50;&#32;&#92;&#92; &#38;&#61;&#32;&#48;&#46;&#50;&#54;&#54;&#53; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<p>The probability that the high of stock gets above 180 is thus 26.7%, and  that is stays below 73.3%</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sitmo.com/article/probability-of-the-high-of-geometric-brownian-motion/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>A Simple and Extremely Fast C++ Template for Matrices and Tensors</title>
		<link>http://www.sitmo.com/article/a-simple-and-extremely-fast-c-template-for-matrices-and-tensors/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=a-simple-and-extremely-fast-c-template-for-matrices-and-tensors</link>
		<comments>http://www.sitmo.com/article/a-simple-and-extremely-fast-c-template-for-matrices-and-tensors/#comments</comments>
		<pubDate>Tue, 31 May 2011 15:01:31 +0000</pubDate>
		<dc:creator>Thijs van den Berg</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.sitmo.com/?p=378</guid>
		<description><![CDATA[This article describes a very simple and efficient solution for handling matrices and tensors in C++. The idea is to store the matrix (or tensor) in a standard vector by translating the multidimensional index to a one dimensional index. E.g. we can store this matrix &#160; c0 c1 c2 c3 r0 (0,0) (0,1) (0,2) (0,3) [...]]]></description>
			<content:encoded><![CDATA[<p>This  article describes a very simple and efficient solution for handling matrices and tensors in C++. The idea is to store the matrix (or tensor) in a standard vector by translating the multidimensional index to a one dimensional index.<br />
<span id="more-378"></span></p>
<p>E.g. we can store this matrix</p>
<table class="matrix">
<tr>
<th>&nbsp;</th>
<th>c0</th>
<th>c1</th>
<th>c2</th>
<th>c3</th>
</tr>
<tr>
<th>r0</th>
<td>(0,0)</td>
<td>(0,1)</td>
<td>(0,2)</td>
<td>(0,3)</td>
</tr>
<tr>
<th>r1</th>
<td>(1,0)</td>
<td>(1,1)</td>
<td>(1,2)</td>
<td>(1,3)</td>
</tr>
<tr>
<th>r2</th>
<td>(2,0)</td>
<td>(2,1)</td>
<td>(2,2)</td>
<td>(2,3)</td>
</tr>
</table>
<p>in a vector like this</p>
<table class="matrix">
<tr>
<th>0</th>
<th>1</th>
<th>2</th>
<th>3</th>
<th>4</th>
<th>&#8230;</th>
<th>11</th>
</tr>
<tr>
<td>(0,0)</td>
<td>(0,1)</td>
<td>(0,2)</td>
<td>(0,3)</td>
<td>(1,0)</td>
<td>&#8230;</td>
<td>(2,3)</td>
</tr>
</table>
<p>The only thing we need to do is to convert two dimensional indices (r,c) into a one dimensional index. Using template we can do this very efficiently compile time, minimizing the run-time overhead.</p>
<p>This template version support up to 4 dimensional tensors.</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">template</span> <span style="color: #000080;">&lt;</span><span style="color: #0000ff;">int</span> d1,<span style="color: #0000ff;">int</span> d2<span style="color: #000080;">=</span><span style="color: #0000dd;">1</span>,<span style="color: #0000ff;">int</span> d3<span style="color: #000080;">=</span><span style="color: #0000dd;">1</span>,<span style="color: #0000ff;">int</span> d4<span style="color: #000080;">=</span><span style="color: #0000dd;">1</span><span style="color: #000080;">&gt;</span>
<span style="color: #0000ff;">class</span> TensorIndex <span style="color: #008000;">&#123;</span>
  <span style="color: #0000ff;">public</span><span style="color: #008080;">:</span>
	<span style="color: #0000ff;">enum</span> <span style="color: #008000;">&#123;</span>SIZE <span style="color: #000080;">=</span> d1<span style="color: #000040;">*</span>d2<span style="color: #000040;">*</span>d3<span style="color: #000040;">*</span>d4 <span style="color: #008000;">&#125;</span><span style="color: #008080;">;</span>
	<span style="color: #0000ff;">enum</span> <span style="color: #008000;">&#123;</span>LEN1 <span style="color: #000080;">=</span> d1 <span style="color: #008000;">&#125;</span><span style="color: #008080;">;</span>
	<span style="color: #0000ff;">enum</span> <span style="color: #008000;">&#123;</span>LEN2 <span style="color: #000080;">=</span> d2 <span style="color: #008000;">&#125;</span><span style="color: #008080;">;</span>
	<span style="color: #0000ff;">enum</span> <span style="color: #008000;">&#123;</span>LEN3 <span style="color: #000080;">=</span> d3 <span style="color: #008000;">&#125;</span><span style="color: #008080;">;</span>
	<span style="color: #0000ff;">enum</span> <span style="color: #008000;">&#123;</span>LEN4 <span style="color: #000080;">=</span> d4 <span style="color: #008000;">&#125;</span><span style="color: #008080;">;</span>
&nbsp;
    <span style="color: #0000ff;">static</span> <span style="color: #0000ff;">int</span> indexOf<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">const</span> <span style="color: #0000ff;">int</span> i<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span> 
      <span style="color: #0000ff;">return</span> i<span style="color: #008080;">;</span>
    <span style="color: #008000;">&#125;</span>
    <span style="color: #0000ff;">static</span> <span style="color: #0000ff;">int</span> indexOf<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">const</span> <span style="color: #0000ff;">int</span> i,<span style="color: #0000ff;">const</span> <span style="color: #0000ff;">int</span> j<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
      <span style="color: #0000ff;">return</span> j<span style="color: #000040;">*</span>d1 <span style="color: #000040;">+</span> i<span style="color: #008080;">;</span>
    <span style="color: #008000;">&#125;</span>
    <span style="color: #0000ff;">static</span> <span style="color: #0000ff;">int</span> indexOf<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">const</span> <span style="color: #0000ff;">int</span> i,<span style="color: #0000ff;">const</span> <span style="color: #0000ff;">int</span> j, <span style="color: #0000ff;">const</span> <span style="color: #0000ff;">int</span> k<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
      <span style="color: #0000ff;">return</span> <span style="color: #008000;">&#40;</span>k<span style="color: #000040;">*</span>d2 <span style="color: #000040;">+</span> j<span style="color: #008000;">&#41;</span><span style="color: #000040;">*</span>d1 <span style="color: #000040;">+</span> i<span style="color: #008080;">;</span>
    <span style="color: #008000;">&#125;</span>
    <span style="color: #0000ff;">static</span> <span style="color: #0000ff;">int</span> indexOf<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">const</span> <span style="color: #0000ff;">int</span> i,<span style="color: #0000ff;">const</span> <span style="color: #0000ff;">int</span> j, <span style="color: #0000ff;">const</span> <span style="color: #0000ff;">int</span> k,<span style="color: #0000ff;">const</span> <span style="color: #0000ff;">int</span> l<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
      <span style="color: #0000ff;">return</span> <span style="color: #008000;">&#40;</span><span style="color: #008000;">&#40;</span>l<span style="color: #000040;">*</span>d3 <span style="color: #000040;">+</span> k<span style="color: #008000;">&#41;</span><span style="color: #000040;">*</span>d2 <span style="color: #000040;">+</span> j<span style="color: #008000;">&#41;</span><span style="color: #000040;">*</span>d1 <span style="color: #000040;">+</span> i<span style="color: #008080;">;</span>
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span><span style="color: #008080;">;</span></pre></div></div>

<h3>Example Usage</h3>
<p>The examples below demonstrate:</p>
<ul>
<li>to work with a <b>matrix</b>, using a std::vector as storage</li>
<li> work with a <b>four dimensional tensor</b> using a simple array as storage</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #339900;">#include &lt;vector&gt;</span>
&nbsp;
<span style="color: #0000ff;">int</span> main<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> argc, <span style="color: #0000ff;">char</span><span style="color: #000040;">*</span> argv<span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
    <span style="color: #666666;">// First example</span>
    <span style="color: #666666;">//=================================</span>
&nbsp;
    <span style="color: #666666;">// A matrix of 3 rows and 4 columns.</span>
    <span style="color: #0000ff;">typedef</span> TensorIndex<span style="color: #000080;">&lt;</span><span style="color: #0000dd;">3</span>,<span style="color: #0000dd;">4</span><span style="color: #000080;">&gt;</span> M<span style="color: #008080;">;</span>
&nbsp;
    <span style="color: #666666;">// Store the matrix in a std::vector</span>
    std<span style="color: #008080;">::</span><span style="color: #007788;">vector</span><span style="color: #000080;">&lt;</span><span style="color: #0000ff;">double</span><span style="color: #000080;">&gt;</span> M_Storage<span style="color: #008000;">&#40;</span>M<span style="color: #008080;">::</span><span style="color: #007788;">SIZE</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
    <span style="color: #666666;">// Fill it with ones</span>
    <span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> row<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> row<span style="color: #000080;">&lt;</span>M<span style="color: #008080;">::</span><span style="color: #007788;">LEN1</span><span style="color: #008080;">;</span> <span style="color: #000040;">++</span>row<span style="color: #008000;">&#41;</span>
        <span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> col<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> col<span style="color: #000080;">&lt;</span>M<span style="color: #008080;">::</span><span style="color: #007788;">LEN2</span><span style="color: #008080;">;</span> <span style="color: #000040;">++</span>col<span style="color: #008000;">&#41;</span>
            M_Storage<span style="color: #008000;">&#91;</span>M<span style="color: #008080;">::</span><span style="color: #007788;">indexOf</span><span style="color: #008000;">&#40;</span>row,col<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#93;</span> <span style="color: #000080;">=</span> <span style="color:#800080;">1.0</span><span style="color: #008080;">;</span>
&nbsp;
&nbsp;
    <span style="color: #666666;">// Second example</span>
    <span style="color: #666666;">//=================================</span>
    <span style="color: #666666;">// A 4 x 5 x 6 x 7 cube</span>
    <span style="color: #0000ff;">typedef</span> TensorIndex<span style="color: #000080;">&lt;</span><span style="color: #0000dd;">4</span>,<span style="color: #0000dd;">5</span>,<span style="color: #0000dd;">6</span>,<span style="color: #0000dd;">7</span><span style="color: #000080;">&gt;</span> T<span style="color: #008080;">;</span>
&nbsp;
    <span style="color: #666666;">// Use an array for storage</span>
    <span style="color: #0000ff;">double</span> T_Storage<span style="color: #008000;">&#91;</span>T<span style="color: #008080;">::</span><span style="color: #007788;">SIZE</span><span style="color: #008000;">&#93;</span><span style="color: #008080;">;</span>
&nbsp;
    <span style="color: #666666;">// Fill it with ones</span>
    <span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> i<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> i<span style="color: #000080;">&lt;</span>T<span style="color: #008080;">::</span><span style="color: #007788;">LEN1</span><span style="color: #008080;">;</span> <span style="color: #000040;">++</span>i<span style="color: #008000;">&#41;</span>
        <span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> j<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> j<span style="color: #000080;">&lt;</span>T<span style="color: #008080;">::</span><span style="color: #007788;">LEN2</span><span style="color: #008080;">;</span> <span style="color: #000040;">++</span>j<span style="color: #008000;">&#41;</span>
            <span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> k<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> k<span style="color: #000080;">&lt;</span>T<span style="color: #008080;">::</span><span style="color: #007788;">LEN3</span><span style="color: #008080;">;</span> <span style="color: #000040;">++</span>k<span style="color: #008000;">&#41;</span>
                <span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> l<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> l<span style="color: #000080;">&lt;</span>T<span style="color: #008080;">::</span><span style="color: #007788;">LEN4</span><span style="color: #008080;">;</span> <span style="color: #000040;">++</span>l<span style="color: #008000;">&#41;</span>
                    T_Storage<span style="color: #008000;">&#91;</span>T<span style="color: #008080;">::</span><span style="color: #007788;">indexOf</span><span style="color: #008000;">&#40;</span>i,j,k,l<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#93;</span> <span style="color: #000080;">=</span> <span style="color:#800080;">1.0</span><span style="color: #008080;">;</span>
&nbsp;
	<span style="color: #0000ff;">return</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<h3>Efficiency and speed</h3>
<p>The translation of the indices is done <strong>compile time</strong>. The code snippet from the above example</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">typedef</span> TensorIndex<span style="color: #000080;">&lt;</span><span style="color: #0000dd;">3</span>,<span style="color: #0000dd;">4</span><span style="color: #000080;">&gt;</span> M<span style="color: #008080;">;</span>
&nbsp;
std<span style="color: #008080;">::</span><span style="color: #007788;">vector</span><span style="color: #000080;">&lt;</span><span style="color: #0000ff;">double</span><span style="color: #000080;">&gt;</span> M_Storage<span style="color: #008000;">&#40;</span>M<span style="color: #008080;">::</span><span style="color: #007788;">SIZE</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
<span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> row<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> row<span style="color: #000080;">&lt;</span>M<span style="color: #008080;">::</span><span style="color: #007788;">LEN1</span><span style="color: #008080;">;</span> <span style="color: #000040;">++</span>row<span style="color: #008000;">&#41;</span>
    <span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> col<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> col<span style="color: #000080;">&lt;</span>M<span style="color: #008080;">::</span><span style="color: #007788;">LEN2</span><span style="color: #008080;">;</span> <span style="color: #000040;">++</span>col<span style="color: #008000;">&#41;</span>
        M_Storage<span style="color: #008000;">&#91;</span>M<span style="color: #008080;">::</span><span style="color: #007788;">indexOf</span><span style="color: #008000;">&#40;</span>row,col<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#93;</span> <span style="color: #000080;">=</span> <span style="color:#800080;">1.0</span><span style="color: #008080;">;</span></pre></div></div>

<p>gets translated to</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;">std<span style="color: #008080;">::</span><span style="color: #007788;">vector</span><span style="color: #000080;">&lt;</span><span style="color: #0000ff;">double</span><span style="color: #000080;">&gt;</span> M_Storage<span style="color: #008000;">&#40;</span><span style="color: #0000dd;">12</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
<span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> row<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> row<span style="color: #000080;">&lt;</span><span style="color: #0000dd;">3</span><span style="color: #008080;">;</span> <span style="color: #000040;">++</span>row<span style="color: #008000;">&#41;</span>
    <span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> col<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> col<span style="color: #000080;">&lt;</span><span style="color: #0000dd;">4</span><span style="color: #008080;">;</span> <span style="color: #000040;">++</span>col<span style="color: #008000;">&#41;</span>
        M_Storage<span style="color: #008000;">&#91;</span><span style="color: #0000dd;">4</span><span style="color: #000040;">*</span>row<span style="color: #000040;">+</span>col<span style="color: #008000;">&#93;</span> <span style="color: #000080;">=</span> <span style="color:#800080;">1.0</span><span style="color: #008080;">;</span></pre></div></div>

<h3>Alternative Template: 1-based indices</h3>
<p>Many numerical algorithms and mathematical articles use a notation where indices start counting from 1 (instead of 0 as in C++). The following template can be used to make the transition from that notation to the zero based C++ standard easy.</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">template</span> <span style="color: #000080;">&lt;</span><span style="color: #0000ff;">int</span> d1,<span style="color: #0000ff;">int</span> d2<span style="color: #000080;">=</span><span style="color: #0000dd;">1</span>,<span style="color: #0000ff;">int</span> d3<span style="color: #000080;">=</span><span style="color: #0000dd;">1</span>,<span style="color: #0000ff;">int</span> d4<span style="color: #000080;">=</span><span style="color: #0000dd;">1</span><span style="color: #000080;">&gt;</span>
<span style="color: #0000ff;">class</span> TensorIndex_base1 <span style="color: #008000;">&#123;</span>
  <span style="color: #0000ff;">public</span><span style="color: #008080;">:</span>
	<span style="color: #0000ff;">enum</span> <span style="color: #008000;">&#123;</span>SIZE <span style="color: #000080;">=</span> d1<span style="color: #000040;">*</span>d2<span style="color: #000040;">*</span>d3<span style="color: #000040;">*</span>d4 <span style="color: #008000;">&#125;</span><span style="color: #008080;">;</span>
	<span style="color: #0000ff;">enum</span> <span style="color: #008000;">&#123;</span>LEN1 <span style="color: #000080;">=</span> d1 <span style="color: #008000;">&#125;</span><span style="color: #008080;">;</span>
	<span style="color: #0000ff;">enum</span> <span style="color: #008000;">&#123;</span>LEN2 <span style="color: #000080;">=</span> d2 <span style="color: #008000;">&#125;</span><span style="color: #008080;">;</span>
	<span style="color: #0000ff;">enum</span> <span style="color: #008000;">&#123;</span>LEN3 <span style="color: #000080;">=</span> d3 <span style="color: #008000;">&#125;</span><span style="color: #008080;">;</span>
	<span style="color: #0000ff;">enum</span> <span style="color: #008000;">&#123;</span>LEN4 <span style="color: #000080;">=</span> d4 <span style="color: #008000;">&#125;</span><span style="color: #008080;">;</span>
&nbsp;
    <span style="color: #0000ff;">static</span> <span style="color: #0000ff;">int</span> indexOf<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">const</span> <span style="color: #0000ff;">int</span> i<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span> 
      <span style="color: #0000ff;">return</span> i <span style="color: #000040;">-</span><span style="color: #0000dd;">1</span><span style="color: #008080;">;</span>
    <span style="color: #008000;">&#125;</span>
    <span style="color: #0000ff;">static</span> <span style="color: #0000ff;">int</span> indexOf<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">const</span> <span style="color: #0000ff;">int</span> i,<span style="color: #0000ff;">const</span> <span style="color: #0000ff;">int</span> j<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
      <span style="color: #0000ff;">return</span> j<span style="color: #000040;">*</span>d1 <span style="color: #000040;">+</span> i <span style="color: #000040;">-</span><span style="color: #0000dd;">1</span> <span style="color: #000040;">-</span>d1<span style="color: #008080;">;</span>
    <span style="color: #008000;">&#125;</span>
    <span style="color: #0000ff;">static</span> <span style="color: #0000ff;">int</span> indexOf<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">const</span> <span style="color: #0000ff;">int</span> i,<span style="color: #0000ff;">const</span> <span style="color: #0000ff;">int</span> j, <span style="color: #0000ff;">const</span> <span style="color: #0000ff;">int</span> k<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
      <span style="color: #0000ff;">return</span> <span style="color: #008000;">&#40;</span>k<span style="color: #000040;">*</span>d2 <span style="color: #000040;">+</span> j<span style="color: #008000;">&#41;</span><span style="color: #000040;">*</span>d1 <span style="color: #000040;">+</span> i <span style="color: #000040;">-</span><span style="color: #0000dd;">1</span> <span style="color: #000040;">-</span>d1 <span style="color: #000040;">-</span>d1<span style="color: #000040;">*</span>d2<span style="color: #008080;">;</span>
    <span style="color: #008000;">&#125;</span>
    <span style="color: #0000ff;">static</span> <span style="color: #0000ff;">int</span> indexOf<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">const</span> <span style="color: #0000ff;">int</span> i,<span style="color: #0000ff;">const</span> <span style="color: #0000ff;">int</span> j, <span style="color: #0000ff;">const</span> <span style="color: #0000ff;">int</span> k,<span style="color: #0000ff;">const</span> <span style="color: #0000ff;">int</span> l<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
      <span style="color: #0000ff;">return</span> <span style="color: #008000;">&#40;</span><span style="color: #008000;">&#40;</span>l<span style="color: #000040;">*</span>d3 <span style="color: #000040;">+</span> k<span style="color: #008000;">&#41;</span><span style="color: #000040;">*</span>d2 <span style="color: #000040;">+</span> j<span style="color: #008000;">&#41;</span><span style="color: #000040;">*</span>d1 <span style="color: #000040;">+</span> i <span style="color: #000040;">-</span><span style="color: #0000dd;">1</span> <span style="color: #000040;">-</span>d1 <span style="color: #000040;">-</span>d1<span style="color: #000040;">*</span>d2 <span style="color: #000040;">-</span> d1<span style="color: #000040;">*</span>d2<span style="color: #000040;">*</span>d3<span style="color: #008080;">;</span>
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span><span style="color: #008080;">;</span>
&nbsp;
...
&nbsp;
<span style="color: #666666;">// Example Usage</span>
    <span style="color: #0000ff;">typedef</span> TensorIndex_base1<span style="color: #000080;">&lt;</span><span style="color: #0000dd;">3</span>,<span style="color: #0000dd;">4</span><span style="color: #000080;">&gt;</span> M<span style="color: #008080;">;</span>
&nbsp;
    <span style="color: #0000ff;">double</span> M_Storage<span style="color: #008000;">&#91;</span>M<span style="color: #008080;">::</span><span style="color: #007788;">SIZE</span><span style="color: #008000;">&#93;</span><span style="color: #008080;">;</span>
&nbsp;
    <span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> i<span style="color: #000080;">=</span><span style="color: #0000dd;">1</span><span style="color: #008080;">;</span> i<span style="color: #000080;">&lt;=</span>M<span style="color: #008080;">::</span><span style="color: #007788;">LEN1</span><span style="color: #008080;">;</span> <span style="color: #000040;">++</span>i<span style="color: #008000;">&#41;</span>
        <span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> j<span style="color: #000080;">=</span><span style="color: #0000dd;">1</span><span style="color: #008080;">;</span> j<span style="color: #000080;">&lt;=</span>M<span style="color: #008080;">::</span><span style="color: #007788;">LEN2</span><span style="color: #008080;">;</span> <span style="color: #000040;">++</span>j<span style="color: #008000;">&#41;</span>
            M_Storage<span style="color: #008000;">&#91;</span>M<span style="color: #008080;">::</span><span style="color: #007788;">indexOf</span><span style="color: #008000;">&#40;</span>i,j<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#93;</span> <span style="color: #000080;">=</span> <span style="color:#800080;">1.0</span><span style="color: #008080;">;</span></pre></div></div>

<p> <img src="http://www.sitmo.com/wp-content/uploads/2011/05/source_cpp.png" alt="" title="source_cpp" width="128" height="128" class="alignright size-full wp-image-404" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sitmo.com/article/a-simple-and-extremely-fast-c-template-for-matrices-and-tensors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Model Validation: Production Optimization</title>
		<link>http://www.sitmo.com/article/model-validation-production-optimization/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=model-validation-production-optimization</link>
		<comments>http://www.sitmo.com/article/model-validation-production-optimization/#comments</comments>
		<pubDate>Tue, 31 May 2011 12:53:45 +0000</pubDate>
		<dc:creator>Thijs van den Berg</dc:creator>
				<category><![CDATA[Client Projects]]></category>

		<guid isPermaLink="false">http://www.sitmo.com/?p=352</guid>
		<description><![CDATA[A Dutch energy firm has asked us to run a model validation. The model is designed to optimize the electricity cost of a large industrial plant, and uses hourly electricity prices curves for the cost part, and a mixed integer linear programming model for the plant constrained optimization with the production flexibility limits.]]></description>
			<content:encoded><![CDATA[<p>A Dutch energy firm has asked us to run a model validation. The model is designed to optimize  the electricity cost of a large industrial plant, and uses hourly electricity prices curves for the cost part, and a mixed integer linear programming model for the plant constrained optimization with the production flexibility limits.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sitmo.com/article/model-validation-production-optimization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Weighted Single-pass Mean and Covariance</title>
		<link>http://www.sitmo.com/article/weigthed-single-pass-mean-and-covariance/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=weigthed-single-pass-mean-and-covariance</link>
		<comments>http://www.sitmo.com/article/weigthed-single-pass-mean-and-covariance/#comments</comments>
		<pubDate>Mon, 30 May 2011 19:57:15 +0000</pubDate>
		<dc:creator>Thijs van den Berg</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.sitmo.com/?p=319</guid>
		<description><![CDATA[One of the algorithms used in the Probability Engine is a weighted covariance calculation. Instead of using a simple two pass algorithm, we chose for a single pass algorithm that improves both speed and accuracy. A particular nice feature of this single-pass weighted covariance algorithms is that it also allows for parallel execution and merging [...]]]></description>
			<content:encoded><![CDATA[<p>One of the algorithms used in the <a href="http://www.sitmo.com/products/">Probability Engine</a> is a weighted covariance calculation. Instead of using a simple two pass algorithm, we chose for a single pass algorithm that improves both speed and accuracy.<br />
<span id="more-319"></span></p>
<p>A particular nice feature of this single-pass weighted covariance algorithms is that it also allows for parallel execution and merging of subset statistics.</p>
<p>The algorithm is based on the paper :<br />
Chan, Tony F.; Golub, Gene H.; LeVeque, Randall J. (1979),<em><a href="ftp://reports.stanford.edu/pub/cstr/reports/cs/tr/79/773/CS-TR-79-773.pdf "> &#8220;Updating Formulae and a Pairwise Algorithm for Computing Sample Variances.&#8221;</a></em>, <strong>Technical Report STAN-CS-79-773</strong>, Department of Computer Science, Stanford University.</p>
<h3>The algorithm: sp_mean_covariance.hpp</h3>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #339900;">#ifndef SP_MEAN_COVARIANCE_HPP</span>
<span style="color: #339900;">#define SP_MEAN_COVARIANCE_HPP</span>
&nbsp;
<span style="color: #339900;">#include &lt;vector&gt;</span>
&nbsp;
<span style="color: #0000ff;">struct</span> sp_mean_covariance <span style="color: #008000;">&#123;</span>
    <span style="color: #0000ff;">int</span>     D<span style="color: #008080;">;</span>
    <span style="color: #0000ff;">int</span>     D2<span style="color: #008080;">;</span>
    <span style="color: #0000ff;">double</span>  W<span style="color: #008080;">;</span>
    std<span style="color: #008080;">::</span><span style="color: #007788;">vector</span><span style="color: #000080;">&lt;</span><span style="color: #0000ff;">double</span><span style="color: #000080;">&gt;</span> T<span style="color: #008080;">;</span>
    std<span style="color: #008080;">::</span><span style="color: #007788;">vector</span><span style="color: #000080;">&lt;</span><span style="color: #0000ff;">double</span><span style="color: #000080;">&gt;</span> S<span style="color: #008080;">;</span>
    std<span style="color: #008080;">::</span><span style="color: #007788;">vector</span><span style="color: #000080;">&lt;</span><span style="color: #0000ff;">double</span><span style="color: #000080;">&gt;</span> dX<span style="color: #008080;">;</span>
&nbsp;
    sp_mean_covariance<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> 
    <span style="color: #008000;">&#123;</span>
        D <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>
        D2 <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>
        T.<span style="color: #007788;">clear</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
        dX.<span style="color: #007788;">clear</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
        S.<span style="color: #007788;">clear</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    sp_mean_covariance<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> D_<span style="color: #008000;">&#41;</span> 
    <span style="color: #008000;">&#123;</span>
        resize<span style="color: #008000;">&#40;</span> D_ <span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #0000ff;">void</span> resize<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> D_<span style="color: #008000;">&#41;</span> 
    <span style="color: #008000;">&#123;</span>
        D <span style="color: #000080;">=</span> D_<span style="color: #008080;">;</span>
        D2 <span style="color: #000080;">=</span> <span style="color: #008000;">&#40;</span>D_<span style="color: #000040;">*</span><span style="color: #008000;">&#40;</span>D_<span style="color: #000040;">+</span><span style="color: #0000dd;">1</span><span style="color: #008000;">&#41;</span><span style="color: #000040;">/</span><span style="color: #0000dd;">2</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
        T.<span style="color: #007788;">resize</span><span style="color: #008000;">&#40;</span>D_<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
        dX.<span style="color: #007788;">resize</span><span style="color: #008000;">&#40;</span>D_<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
        S.<span style="color: #007788;">resize</span><span style="color: #008000;">&#40;</span> D_<span style="color: #000040;">*</span><span style="color: #008000;">&#40;</span>D_<span style="color: #000040;">+</span><span style="color: #0000dd;">1</span><span style="color: #008000;">&#41;</span><span style="color: #000040;">/</span><span style="color: #0000dd;">2</span> <span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
        clear<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #0000ff;">void</span> clear<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> d<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> d<span style="color: #000080;">&lt;</span>D<span style="color: #008080;">;</span> <span style="color: #000040;">++</span>d<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
            T<span style="color: #008000;">&#91;</span>d<span style="color: #008000;">&#93;</span> <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span>.<span style="color: #008080;">;</span>
            dX<span style="color: #008000;">&#91;</span>d<span style="color: #008000;">&#93;</span> <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span>.<span style="color: #008080;">;</span>
        <span style="color: #008000;">&#125;</span>
        <span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> d<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> d<span style="color: #000080;">&lt;</span>D2<span style="color: #008080;">;</span> <span style="color: #000040;">++</span>d<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
            S<span style="color: #008000;">&#91;</span>d<span style="color: #008000;">&#93;</span> <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span>.<span style="color: #008080;">;</span>
        <span style="color: #008000;">&#125;</span>
        W <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span>.<span style="color: #008080;">;</span>
&nbsp;
    <span style="color: #008000;">&#125;</span>
&nbsp;
&nbsp;
    <span style="color: #0000ff;">void</span> add<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">double</span><span style="color: #000040;">*</span> x<span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>W <span style="color: #000080;">==</span> <span style="color: #0000dd;">0</span>.<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
            W <span style="color: #000080;">=</span> <span style="color: #0000dd;">1</span>.<span style="color: #008080;">;</span>
            <span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> i<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> i<span style="color: #000080;">&lt;</span>D <span style="color: #008080;">;</span> <span style="color: #000040;">++</span>i<span style="color: #008000;">&#41;</span> T<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span> <span style="color: #000080;">=</span> x<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span><span style="color: #008080;">;</span>
            <span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> i<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> i<span style="color: #000080;">&lt;</span>D2<span style="color: #008080;">;</span> <span style="color: #000040;">++</span>i<span style="color: #008000;">&#41;</span> S<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span> <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span>.<span style="color: #008080;">;</span>
            <span style="color: #0000ff;">return</span><span style="color: #008080;">;</span>
        <span style="color: #008000;">&#125;</span>
        W <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #0000dd;">1</span>.<span style="color: #008080;">;</span>
        <span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> i<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> i<span style="color: #000080;">&lt;</span>D<span style="color: #008080;">;</span> <span style="color: #000040;">++</span>i<span style="color: #008000;">&#41;</span>     
            T<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> x<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span><span style="color: #008080;">;</span>
&nbsp;
        <span style="color: #0000ff;">double</span><span style="color: #000040;">*</span> Si <span style="color: #000080;">=</span> <span style="color: #000040;">&amp;</span>S<span style="color: #008000;">&#91;</span><span style="color: #0000dd;">0</span><span style="color: #008000;">&#93;</span><span style="color: #008080;">;</span>
        <span style="color: #0000ff;">double</span>  f  <span style="color: #000080;">=</span> <span style="color: #0000dd;">1</span>. <span style="color: #000040;">/</span> W <span style="color: #000040;">/</span> <span style="color: #008000;">&#40;</span>W<span style="color: #000040;">-</span><span style="color: #0000dd;">1</span>.<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
        <span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> i<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> i<span style="color: #000080;">&lt;</span>D<span style="color: #008080;">;</span> <span style="color: #000040;">++</span>i<span style="color: #008000;">&#41;</span> dX<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span> <span style="color: #000080;">=</span> W<span style="color: #000040;">*</span>x<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span><span style="color: #000040;">-</span>T<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span><span style="color: #008080;">;</span>
&nbsp;
        <span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> r<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> r<span style="color: #000080;">&lt;</span>D<span style="color: #008080;">;</span> <span style="color: #000040;">++</span>r<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
            <span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> c<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> c<span style="color: #000080;">&lt;=</span>r<span style="color: #008080;">;</span> <span style="color: #000040;">++</span>c<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
                <span style="color: #000040;">*</span>Si <span style="color: #000040;">+</span><span style="color: #000080;">=</span> f <span style="color: #000040;">*</span> dX<span style="color: #008000;">&#91;</span>r<span style="color: #008000;">&#93;</span> <span style="color: #000040;">*</span> dX<span style="color: #008000;">&#91;</span>c<span style="color: #008000;">&#93;</span><span style="color: #008080;">;</span>
                Si<span style="color: #000040;">++</span><span style="color: #008080;">;</span>
            <span style="color: #008000;">&#125;</span>
        <span style="color: #008000;">&#125;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
&nbsp;
    <span style="color: #0000ff;">inline</span> <span style="color: #0000ff;">void</span> add<span style="color: #008000;">&#40;</span>sp_mean_covariance<span style="color: #000040;">&amp;</span> M<span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        add<span style="color: #008000;">&#40;</span>M.<span style="color: #007788;">W</span>, <span style="color: #000040;">&amp;</span>M.<span style="color: #007788;">T</span><span style="color: #008000;">&#91;</span><span style="color: #0000dd;">0</span><span style="color: #008000;">&#93;</span>, <span style="color: #000040;">&amp;</span>M.<span style="color: #007788;">S</span><span style="color: #008000;">&#91;</span><span style="color: #0000dd;">0</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #0000ff;">void</span> add<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">double</span> W_, <span style="color: #0000ff;">double</span><span style="color: #000040;">*</span> T_, <span style="color: #0000ff;">double</span><span style="color: #000040;">*</span> S_<span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
&nbsp;
        <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>W <span style="color: #000080;">==</span> <span style="color: #0000dd;">0</span>.<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
            W <span style="color: #000080;">=</span> W_<span style="color: #008080;">;</span>
            <span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> i<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> i<span style="color: #000080;">&lt;</span>D <span style="color: #008080;">;</span> <span style="color: #000040;">++</span>i<span style="color: #008000;">&#41;</span> T<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span> <span style="color: #000080;">=</span> T_<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span><span style="color: #008080;">;</span>
            <span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> i<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> i<span style="color: #000080;">&lt;</span>D2<span style="color: #008080;">;</span> <span style="color: #000040;">++</span>i<span style="color: #008000;">&#41;</span> S<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span> <span style="color: #000080;">=</span> S_<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span><span style="color: #008080;">;</span>
            <span style="color: #0000ff;">return</span><span style="color: #008080;">;</span>
        <span style="color: #008000;">&#125;</span>
        <span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> i<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> i<span style="color: #000080;">&lt;</span>D <span style="color: #008080;">;</span> <span style="color: #000040;">++</span>i<span style="color: #008000;">&#41;</span> 
            dX<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span> <span style="color: #000080;">=</span> T_<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span><span style="color: #000040;">/</span>W_ <span style="color: #000040;">-</span> T<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span><span style="color: #000040;">/</span>W<span style="color: #008080;">;</span>
&nbsp;
        <span style="color: #0000ff;">double</span><span style="color: #000040;">*</span> Si <span style="color: #000080;">=</span> <span style="color: #000040;">&amp;</span>S<span style="color: #008000;">&#91;</span><span style="color: #0000dd;">0</span><span style="color: #008000;">&#93;</span><span style="color: #008080;">;</span>
        <span style="color: #0000ff;">double</span><span style="color: #000040;">*</span> Si_ <span style="color: #000080;">=</span> <span style="color: #000040;">&amp;</span>S_<span style="color: #008000;">&#91;</span><span style="color: #0000dd;">0</span><span style="color: #008000;">&#93;</span><span style="color: #008080;">;</span>
        <span style="color: #0000ff;">double</span>  f  <span style="color: #000080;">=</span> W <span style="color: #000040;">*</span> W_ <span style="color: #000040;">/</span> <span style="color: #008000;">&#40;</span>W <span style="color: #000040;">+</span> W_<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
        <span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> r<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> r<span style="color: #000080;">&lt;</span>D<span style="color: #008080;">;</span> <span style="color: #000040;">++</span>r<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
            <span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> c<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> c<span style="color: #000080;">&lt;=</span>r<span style="color: #008080;">;</span> <span style="color: #000040;">++</span>c<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
                <span style="color: #000040;">*</span>Si <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #000040;">*</span>Si_ <span style="color: #000040;">+</span> f <span style="color: #000040;">*</span> dX<span style="color: #008000;">&#91;</span>r<span style="color: #008000;">&#93;</span> <span style="color: #000040;">*</span> dX<span style="color: #008000;">&#91;</span>c<span style="color: #008000;">&#93;</span><span style="color: #008080;">;</span>
                Si<span style="color: #000040;">++</span><span style="color: #008080;">;</span>
                Si_<span style="color: #000040;">++</span><span style="color: #008080;">;</span>
            <span style="color: #008000;">&#125;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> i<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> i<span style="color: #000080;">&lt;</span>D <span style="color: #008080;">;</span> <span style="color: #000040;">++</span>i<span style="color: #008000;">&#41;</span>
            T<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> T_<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span><span style="color: #008080;">;</span>
        W <span style="color: #000040;">+</span><span style="color: #000080;">=</span> W_<span style="color: #008080;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
&nbsp;
    <span style="color: #0000ff;">inline</span> <span style="color: #0000ff;">void</span> addw<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">double</span> w, <span style="color: #0000ff;">double</span><span style="color: #000040;">*</span> x<span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        <span style="color: #666666;">//--------------------------------</span>
        <span style="color: #666666;">// add( w, w*x, 0. );</span>
        <span style="color: #666666;">//--------------------------------</span>
        <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>W <span style="color: #000080;">==</span> <span style="color: #0000dd;">0</span>.<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
            W <span style="color: #000080;">=</span> w<span style="color: #008080;">;</span>
            <span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> i<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> i<span style="color: #000080;">&lt;</span>D <span style="color: #008080;">;</span> <span style="color: #000040;">++</span>i<span style="color: #008000;">&#41;</span> T<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span> <span style="color: #000080;">=</span> w<span style="color: #000040;">*</span>x<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span><span style="color: #008080;">;</span>
            <span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> i<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> i<span style="color: #000080;">&lt;</span>D2<span style="color: #008080;">;</span> <span style="color: #000040;">++</span>i<span style="color: #008000;">&#41;</span> S<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span> <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span>.<span style="color: #008080;">;</span>
            <span style="color: #0000ff;">return</span><span style="color: #008080;">;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> i<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> i<span style="color: #000080;">&lt;</span>D <span style="color: #008080;">;</span> <span style="color: #000040;">++</span>i<span style="color: #008000;">&#41;</span> 
            dX<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span> <span style="color: #000080;">=</span> x<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span> <span style="color: #000040;">-</span> T<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span><span style="color: #000040;">/</span>W<span style="color: #008080;">;</span>
&nbsp;
        <span style="color: #0000ff;">double</span><span style="color: #000040;">*</span> Si <span style="color: #000080;">=</span> <span style="color: #000040;">&amp;</span>S<span style="color: #008000;">&#91;</span><span style="color: #0000dd;">0</span><span style="color: #008000;">&#93;</span><span style="color: #008080;">;</span>
        <span style="color: #0000ff;">double</span>  f  <span style="color: #000080;">=</span> W <span style="color: #000040;">*</span> w <span style="color: #000040;">/</span> <span style="color: #008000;">&#40;</span>W <span style="color: #000040;">+</span> w<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
        <span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> r<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> r<span style="color: #000080;">&lt;</span>D<span style="color: #008080;">;</span> <span style="color: #000040;">++</span>r<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
            <span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> c<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> c<span style="color: #000080;">&lt;=</span>r<span style="color: #008080;">;</span> <span style="color: #000040;">++</span>c<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
                <span style="color: #000040;">*</span>Si <span style="color: #000040;">+</span><span style="color: #000080;">=</span> f <span style="color: #000040;">*</span> dX<span style="color: #008000;">&#91;</span>r<span style="color: #008000;">&#93;</span> <span style="color: #000040;">*</span> dX<span style="color: #008000;">&#91;</span>c<span style="color: #008000;">&#93;</span><span style="color: #008080;">;</span>
                Si<span style="color: #000040;">++</span><span style="color: #008080;">;</span>
            <span style="color: #008000;">&#125;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> i<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> i<span style="color: #000080;">&lt;</span>D <span style="color: #008080;">;</span> <span style="color: #000040;">++</span>i<span style="color: #008000;">&#41;</span> T<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> w<span style="color: #000040;">*</span>x<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span><span style="color: #008080;">;</span>
        W <span style="color: #000040;">+</span><span style="color: #000080;">=</span> w<span style="color: #008080;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #0000ff;">double</span> mean<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> i<span style="color: #008000;">&#41;</span> <span style="color: #0000ff;">const</span> <span style="color: #008000;">&#123;</span> <span style="color: #0000ff;">return</span> T<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span><span style="color: #000040;">/</span>W<span style="color: #008080;">;</span> <span style="color: #008000;">&#125;</span>
    <span style="color: #0000ff;">double</span> cov<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> i<span style="color: #008000;">&#41;</span> <span style="color: #0000ff;">const</span> <span style="color: #008000;">&#123;</span> <span style="color: #0000ff;">return</span> S<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span><span style="color: #000040;">/</span>W<span style="color: #008080;">;</span> <span style="color: #008000;">&#125;</span> 
    <span style="color: #0000ff;">double</span> covp<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> i<span style="color: #008000;">&#41;</span> <span style="color: #0000ff;">const</span> <span style="color: #008000;">&#123;</span> <span style="color: #0000ff;">return</span> S<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span><span style="color: #000040;">/</span><span style="color: #008000;">&#40;</span>W<span style="color: #000040;">-</span><span style="color: #0000dd;">1</span>.<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span><span style="color: #008080;">;</span>
&nbsp;
<span style="color: #339900;">#endif</span></pre></div></div>

<h3>1D scalar test</h3>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;">    <span style="color: #008000;">&#123;</span>
        <span style="color: #0000ff;">int</span> N <span style="color: #000080;">=</span> <span style="color: #0000dd;">10</span><span style="color: #008080;">;</span>
        <span style="color: #0000ff;">double</span> x<span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> <span style="color: #000080;">=</span> <span style="color: #008000;">&#123;</span> <span style="color: #0000dd;">4</span>., <span style="color: #0000dd;">1</span>., <span style="color: #0000dd;">9</span>., <span style="color: #0000dd;">4</span>., <span style="color: #0000dd;">9</span>., <span style="color: #0000dd;">6</span>., <span style="color: #0000dd;">8</span>., <span style="color: #0000dd;">9</span>., <span style="color: #0000dd;">5</span>., <span style="color: #0000dd;">5</span>. <span style="color: #008000;">&#125;</span><span style="color: #008080;">;</span>
        <span style="color: #0000ff;">double</span> ans_mu <span style="color: #000080;">=</span> <span style="color: #0000dd;">6</span><span style="color: #008080;">;</span>
        <span style="color: #0000ff;">double</span> ans_var <span style="color: #000080;">=</span> <span style="color:#800080;">6.6</span><span style="color: #008080;">;</span>
&nbsp;
        sp_mean_variance M<span style="color: #008080;">;</span>
&nbsp;
        <span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> i<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> i<span style="color: #000080;">&lt;</span>N<span style="color: #008080;">;</span> <span style="color: #000040;">++</span>i<span style="color: #008000;">&#41;</span>
            M.<span style="color: #007788;">add</span><span style="color: #008000;">&#40;</span> x<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span> <span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
        <span style="color: #0000dd;">assert</span><span style="color: #008000;">&#40;</span> std<span style="color: #008080;">::</span><span style="color: #0000dd;">abs</span><span style="color: #008000;">&#40;</span> ans_mu  <span style="color: #000040;">-</span> M.<span style="color: #007788;">mean</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#41;</span> <span style="color: #000080;">&lt;</span> <span style="color:#800080;">0.0001</span> <span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
        <span style="color: #0000dd;">assert</span><span style="color: #008000;">&#40;</span> std<span style="color: #008080;">::</span><span style="color: #0000dd;">abs</span><span style="color: #008000;">&#40;</span> ans_var <span style="color: #000040;">-</span> M.<span style="color: #007788;">var</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>  <span style="color: #008000;">&#41;</span> <span style="color: #000080;">&lt;</span> <span style="color:#800080;">0.0001</span> <span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    <span style="color: #008000;">&#125;</span></pre></div></div>

<h3>3D weighted test</h3>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;">    <span style="color: #008000;">&#123;</span>
        <span style="color: #0000ff;">int</span> N <span style="color: #000080;">=</span> <span style="color: #0000dd;">10</span><span style="color: #008080;">;</span>
        <span style="color: #0000ff;">int</span> D <span style="color: #000080;">=</span> <span style="color: #0000dd;">3</span><span style="color: #008080;">;</span>
&nbsp;
        <span style="color: #0000ff;">double</span> x<span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> <span style="color: #000080;">=</span> <span style="color: #008000;">&#123;</span>
            <span style="color: #0000dd;">5</span>., <span style="color: #0000dd;">7</span>., <span style="color: #0000dd;">1</span>.,
            <span style="color: #0000dd;">7</span>., <span style="color: #0000dd;">8</span>., <span style="color: #0000dd;">3</span>.,
            <span style="color: #0000dd;">8</span>., <span style="color: #0000dd;">4</span>., <span style="color: #0000dd;">2</span>.,
            <span style="color: #0000dd;">7</span>., <span style="color: #0000dd;">2</span>., <span style="color: #0000dd;">8</span>.,
            <span style="color: #0000dd;">1</span>., <span style="color: #0000dd;">7</span>., <span style="color: #0000dd;">3</span>.,
            <span style="color: #0000dd;">3</span>., <span style="color: #0000dd;">8</span>., <span style="color: #0000dd;">6</span>.,
            <span style="color: #0000dd;">2</span>., <span style="color: #0000dd;">7</span>., <span style="color: #0000dd;">5</span>.,
            <span style="color: #0000dd;">6</span>., <span style="color: #0000dd;">5</span>., <span style="color: #0000dd;">7</span>.,
            <span style="color: #0000dd;">9</span>., <span style="color: #0000dd;">1</span>., <span style="color: #0000dd;">8</span>.,
            <span style="color: #0000dd;">6</span>., <span style="color: #0000dd;">7</span>., <span style="color: #0000dd;">1</span>.
        <span style="color: #008000;">&#125;</span><span style="color: #008080;">;</span>
&nbsp;
        <span style="color: #0000ff;">double</span> ans_mu<span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> <span style="color: #000080;">=</span> <span style="color: #008000;">&#123;</span> <span style="color:#800080;">5.4</span>, <span style="color:#800080;">5.6</span>, <span style="color:#800080;">4.4</span> <span style="color: #008000;">&#125;</span><span style="color: #008080;">;</span>
&nbsp;
        <span style="color: #0000ff;">double</span> ans_cov<span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> <span style="color: #000080;">=</span> <span style="color: #008000;">&#123;</span> 
             <span style="color:#800080;">6.24</span>, 
            <span style="color: #000040;">-</span><span style="color:#800080;">3.94</span>, <span style="color:#800080;">5.64</span>,
             <span style="color:#800080;">1.14</span>,<span style="color: #000040;">-</span><span style="color:#800080;">3.74</span>, <span style="color:#800080;">6.84</span> 
        <span style="color: #008000;">&#125;</span><span style="color: #008080;">;</span>
&nbsp;
        sp_mean_covariance M<span style="color: #008000;">&#40;</span><span style="color: #0000dd;">3</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
        <span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> i<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> i<span style="color: #000080;">&lt;</span>N<span style="color: #008080;">;</span> <span style="color: #000040;">++</span>i<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
            M.<span style="color: #007788;">addw</span><span style="color: #008000;">&#40;</span><span style="color: #0000dd;">1</span>., <span style="color: #000040;">&amp;</span>x<span style="color: #008000;">&#91;</span>i<span style="color: #000040;">*</span>D<span style="color: #008000;">&#93;</span> <span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
        <span style="color: #008000;">&#125;</span>
        std<span style="color: #008080;">::</span><span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;W=&quot;</span> <span style="color: #000080;">&lt;&lt;</span> M.<span style="color: #007788;">W</span> <span style="color: #000080;">&lt;&lt;</span> std<span style="color: #008080;">::</span><span style="color: #007788;">endl</span><span style="color: #008080;">;</span>
        <span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> i<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> i<span style="color: #000080;">&lt;</span>M.<span style="color: #007788;">D</span><span style="color: #008080;">;</span> <span style="color: #000040;">++</span>i<span style="color: #008000;">&#41;</span> std<span style="color: #008080;">::</span><span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;mean=&quot;</span> <span style="color: #000080;">&lt;&lt;</span> M.<span style="color: #007788;">mean</span><span style="color: #008000;">&#40;</span>i<span style="color: #008000;">&#41;</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot; &quot;</span><span style="color: #008080;">;</span>
        std<span style="color: #008080;">::</span><span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> std<span style="color: #008080;">::</span><span style="color: #007788;">endl</span><span style="color: #008080;">;</span>
        <span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> i<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> i<span style="color: #000080;">&lt;</span>M.<span style="color: #007788;">D2</span><span style="color: #008080;">;</span> <span style="color: #000040;">++</span>i<span style="color: #008000;">&#41;</span> std<span style="color: #008080;">::</span><span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;cov=&quot;</span> <span style="color: #000080;">&lt;&lt;</span> M.<span style="color: #007788;">cov</span><span style="color: #008000;">&#40;</span>i<span style="color: #008000;">&#41;</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot; &quot;</span><span style="color: #008080;">;</span>
        std<span style="color: #008080;">::</span><span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> std<span style="color: #008080;">::</span><span style="color: #007788;">endl</span><span style="color: #008080;">;</span>
    <span style="color: #008000;">&#125;</span></pre></div></div>

<h3>3D weighted and parallel merge test</h3>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;">    <span style="color: #008000;">&#123;</span>
        <span style="color: #0000ff;">int</span> N <span style="color: #000080;">=</span> <span style="color: #0000dd;">10</span><span style="color: #008080;">;</span>
        <span style="color: #0000ff;">int</span> D <span style="color: #000080;">=</span> <span style="color: #0000dd;">3</span><span style="color: #008080;">;</span>
&nbsp;
        <span style="color: #0000ff;">double</span> x<span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> <span style="color: #000080;">=</span> <span style="color: #008000;">&#123;</span>
            <span style="color: #0000dd;">5</span>., <span style="color: #0000dd;">7</span>., <span style="color: #0000dd;">1</span>.,
            <span style="color: #0000dd;">7</span>., <span style="color: #0000dd;">8</span>., <span style="color: #0000dd;">3</span>.,
            <span style="color: #0000dd;">8</span>., <span style="color: #0000dd;">4</span>., <span style="color: #0000dd;">2</span>.,
            <span style="color: #0000dd;">7</span>., <span style="color: #0000dd;">2</span>., <span style="color: #0000dd;">8</span>.,
            <span style="color: #0000dd;">1</span>., <span style="color: #0000dd;">7</span>., <span style="color: #0000dd;">3</span>.,
            <span style="color: #0000dd;">3</span>., <span style="color: #0000dd;">8</span>., <span style="color: #0000dd;">6</span>.,
            <span style="color: #0000dd;">2</span>., <span style="color: #0000dd;">7</span>., <span style="color: #0000dd;">5</span>.,
            <span style="color: #0000dd;">6</span>., <span style="color: #0000dd;">5</span>., <span style="color: #0000dd;">7</span>.,
            <span style="color: #0000dd;">9</span>., <span style="color: #0000dd;">1</span>., <span style="color: #0000dd;">8</span>.,
            <span style="color: #0000dd;">6</span>., <span style="color: #0000dd;">7</span>., <span style="color: #0000dd;">1</span>.
        <span style="color: #008000;">&#125;</span><span style="color: #008080;">;</span>
&nbsp;
        <span style="color: #0000ff;">double</span> ans_mu<span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> <span style="color: #000080;">=</span> <span style="color: #008000;">&#123;</span> <span style="color:#800080;">5.4</span>, <span style="color:#800080;">5.6</span>, <span style="color:#800080;">4.4</span> <span style="color: #008000;">&#125;</span><span style="color: #008080;">;</span>
&nbsp;
        <span style="color: #0000ff;">double</span> ans_cov<span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> <span style="color: #000080;">=</span> <span style="color: #008000;">&#123;</span> 
             <span style="color:#800080;">6.24</span>, 
            <span style="color: #000040;">-</span><span style="color:#800080;">3.94</span>, <span style="color:#800080;">5.64</span>,
             <span style="color:#800080;">1.14</span>,<span style="color: #000040;">-</span><span style="color:#800080;">3.74</span>, <span style="color:#800080;">6.84</span> 
        <span style="color: #008000;">&#125;</span><span style="color: #008080;">;</span>
&nbsp;
        sp_mean_covariance M<span style="color: #008000;">&#40;</span><span style="color: #0000dd;">3</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
        sp_mean_covariance M2<span style="color: #008000;">&#40;</span><span style="color: #0000dd;">3</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
        <span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> i<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> i<span style="color: #000080;">&lt;</span><span style="color: #0000dd;">6</span><span style="color: #008080;">;</span> <span style="color: #000040;">++</span>i<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
            M.<span style="color: #007788;">addw</span><span style="color: #008000;">&#40;</span><span style="color: #0000dd;">1</span>., <span style="color: #000040;">&amp;</span>x<span style="color: #008000;">&#91;</span>i<span style="color: #000040;">*</span>D<span style="color: #008000;">&#93;</span> <span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
        <span style="color: #008000;">&#125;</span>
        <span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> i<span style="color: #000080;">=</span><span style="color: #0000dd;">6</span><span style="color: #008080;">;</span> i<span style="color: #000080;">&lt;</span>N<span style="color: #008080;">;</span> <span style="color: #000040;">++</span>i<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
            M2.<span style="color: #007788;">addw</span><span style="color: #008000;">&#40;</span><span style="color: #0000dd;">1</span>., <span style="color: #000040;">&amp;</span>x<span style="color: #008000;">&#91;</span>i<span style="color: #000040;">*</span>D<span style="color: #008000;">&#93;</span> <span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
        <span style="color: #008000;">&#125;</span>
        M.<span style="color: #007788;">add</span><span style="color: #008000;">&#40;</span>M2<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
        std<span style="color: #008080;">::</span><span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;W=&quot;</span> <span style="color: #000080;">&lt;&lt;</span> M.<span style="color: #007788;">W</span> <span style="color: #000080;">&lt;&lt;</span> std<span style="color: #008080;">::</span><span style="color: #007788;">endl</span><span style="color: #008080;">;</span>
        <span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> i<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> i<span style="color: #000080;">&lt;</span>M.<span style="color: #007788;">D</span><span style="color: #008080;">;</span> <span style="color: #000040;">++</span>i<span style="color: #008000;">&#41;</span> std<span style="color: #008080;">::</span><span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;mean=&quot;</span> <span style="color: #000080;">&lt;&lt;</span> M.<span style="color: #007788;">mean</span><span style="color: #008000;">&#40;</span>i<span style="color: #008000;">&#41;</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot; &quot;</span><span style="color: #008080;">;</span>
        std<span style="color: #008080;">::</span><span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> std<span style="color: #008080;">::</span><span style="color: #007788;">endl</span><span style="color: #008080;">;</span>
        <span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> i<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> i<span style="color: #000080;">&lt;</span>M.<span style="color: #007788;">D2</span><span style="color: #008080;">;</span> <span style="color: #000040;">++</span>i<span style="color: #008000;">&#41;</span> std<span style="color: #008080;">::</span><span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;cov=&quot;</span> <span style="color: #000080;">&lt;&lt;</span> M.<span style="color: #007788;">cov</span><span style="color: #008000;">&#40;</span>i<span style="color: #008000;">&#41;</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot; &quot;</span><span style="color: #008080;">;</span>
        std<span style="color: #008080;">::</span><span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> std<span style="color: #008080;">::</span><span style="color: #007788;">endl</span><span style="color: #008080;">;</span>
    <span style="color: #008000;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.sitmo.com/article/weigthed-single-pass-mean-and-covariance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Digital Spread Option Pricing Model</title>
		<link>http://www.sitmo.com/article/digital-spread-option-pricing-model/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=digital-spread-option-pricing-model</link>
		<comments>http://www.sitmo.com/article/digital-spread-option-pricing-model/#comments</comments>
		<pubDate>Sun, 29 May 2011 06:38:27 +0000</pubDate>
		<dc:creator>Thijs van den Berg</dc:creator>
				<category><![CDATA[Equations]]></category>

		<guid isPermaLink="false">http://www.sitmo.com/?p=186</guid>
		<description><![CDATA[Digital spread options have a payoff that depends on the difference -spread- between two underlying S1,S2. The payoff is 1 unit (Dollar, Euro) if the spread S1-S2 is greater that a strike K, and zero otherwise. This article gives the pricing formula of the option considering a Black &#38; Scholes world. Digital spread options have [...]]]></description>
			<content:encoded><![CDATA[<p>Digital spread options have a payoff that depends on the difference -spread- between two underlying S1,S2. The payoff is 1 unit (Dollar, Euro) if the spread S1-S2 is greater that a strike K, and zero otherwise. This article gives the pricing formula of the option considering a Black &amp; Scholes world.<br />
<span id="more-186"></span></p>
<div id="attachment_188" class="wp-caption aligncenter" style="width: 310px"><img class="size-full wp-image-188" title="OptionDigitalSpread" src="http://www.sitmo.com/wp-content/uploads/2011/05/OptionDigitalSpread.png" alt="" width="300" height="200" /><p class="wp-caption-text">Payoff of the digital spread option</p></div>
<p>Digital spread options have a payoff that depends on the difference -spread- between two underlying S1,S2. The payoff is 1 unit (Dollar, Euro) if the spread S1-S2 is greater that a strike K, and zero otherwise.</p>
<p>An example contract would be: you get 1 dollar is the price of Apple stocks is more than 50 dollars higher than that of IBM exactly one year from now.</p>
<p class="ql-center-displayed-equation" style="line-height: 79px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-673f281884cb6fa203486e434384f287_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#38;&#92;&#116;&#101;&#120;&#116;&#123;&#98;&#105;&#110;&#97;&#114;&#121;&#32;&#115;&#112;&#114;&#101;&#97;&#100;&#32;&#99;&#97;&#108;&#108;&#32;&#111;&#112;&#116;&#105;&#111;&#110;&#58;&#32;&#125;&#92;&#92; &#67;&#95;&#84;&#32;&#38;&#61; &#92;&#98;&#101;&#103;&#105;&#110;&#123;&#99;&#97;&#115;&#101;&#115;&#125; &#49;&#32;&#38;&#32;&#92;&#109;&#98;&#111;&#120;&#123;&#105;&#102;&#32;&#125;&#83;&#95;&#49;&#45;&#83;&#95;&#50;&#32;&#62;&#32;&#75;&#32;&#92;&#92; &#48;&#32;&#38;&#32;&#92;&#109;&#98;&#111;&#120;&#123;&#111;&#116;&#104;&#101;&#114;&#119;&#105;&#115;&#101;&#125; &#92;&#101;&#110;&#100;&#123;&#99;&#97;&#115;&#101;&#115;&#125; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<p class="ql-center-displayed-equation" style="line-height: 79px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-2093bad3589a8a9ac213e6a2b265b4a0_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#38;&#92;&#116;&#101;&#120;&#116;&#123;&#98;&#105;&#110;&#97;&#114;&#121;&#32;&#115;&#112;&#114;&#101;&#97;&#100;&#32;&#112;&#117;&#116;&#32;&#111;&#112;&#116;&#105;&#111;&#110;&#58;&#32;&#125;&#92;&#92; &#80;&#95;&#84;&#32;&#38;&#61; &#92;&#98;&#101;&#103;&#105;&#110;&#123;&#99;&#97;&#115;&#101;&#115;&#125; &#49;&#32;&#38;&#92;&#109;&#98;&#111;&#120;&#123;&#105;&#102;&#32;&#125;&#83;&#95;&#49;&#45;&#83;&#95;&#50;&#32;&#60;&#32;&#75;&#32;&#92;&#92; &#48;&#32;&#38;&#32;&#92;&#109;&#98;&#111;&#120;&#123;&#111;&#116;&#104;&#101;&#114;&#119;&#105;&#115;&#101;&#125; &#92;&#101;&#110;&#100;&#123;&#99;&#97;&#115;&#101;&#115;&#125;&#92;&#92; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h2>Pricing Formula</h2>
<p>There is no analytical simple formula for the price of digital spread options. High accurate (arbitrary precision) approximations can however be calculating using the formula&#8217;s below. The pricing formulas for the digital spread call and put option are given by:</p>
<p class="ql-center-displayed-equation" style="line-height: 114px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-95434b8de378aacaaa7a6eb935de3707_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#67;&#32;&#38;&#61;&#32;&#101;&#94;&#123;&#45;&#114;&#116;&#125;&#92;&#115;&#117;&#109;&#95;&#105;&#32;&#119;&#95;&#105;&#32;&#32;&#78;&#92;&#108;&#101;&#102;&#116;&#40;&#92;&#102;&#114;&#97;&#99;&#123;&#109;&#95;&#105;&#32;&#45;&#32;&#92;&#114;&#104;&#111;&#32;&#120;&#95;&#105;&#125;&#123;&#92;&#115;&#113;&#114;&#116;&#123;&#49;&#45;&#92;&#114;&#104;&#111;&#94;&#50;&#125;&#125;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#110;&#40;&#120;&#95;&#105;&#41;&#92;&#92; &#80;&#32;&#38;&#61;&#32;&#101;&#94;&#123;&#45;&#114;&#116;&#125;&#92;&#115;&#117;&#109;&#95;&#105;&#32;&#119;&#95;&#105;&#32;&#32;&#78;&#92;&#108;&#101;&#102;&#116;&#40;&#45;&#92;&#102;&#114;&#97;&#99;&#123;&#109;&#95;&#105;&#32;&#45;&#32;&#92;&#114;&#104;&#111;&#32;&#120;&#95;&#105;&#125;&#123;&#92;&#115;&#113;&#114;&#116;&#123;&#49;&#45;&#92;&#114;&#104;&#111;&#94;&#50;&#125;&#125;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#110;&#40;&#120;&#95;&#105;&#41; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<p class="ql-center-displayed-equation" style="line-height: 98px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-7fdf7cb5eabf34a60ef1d92eb20548de_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#109;&#95;&#105;&#32;&#38;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#32;&#92;&#108;&#110;&#40;&#32;&#69;&#95;&#49;&#32;&#32;&#92;&#101;&#120;&#112;&#40;&#120;&#95;&#105;&#32;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#49;&#32;&#32;&#92;&#115;&#113;&#114;&#116;&#123;&#116;&#125;&#41;&#32;&#45;&#32;&#75;&#41;&#45;&#92;&#108;&#110;&#40;&#69;&#95;&#50;&#41;&#125;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#50;&#32;&#92;&#115;&#113;&#114;&#116;&#123;&#116;&#125;&#125;&#92;&#92; &#69;&#95;&#49;&#38;&#61;&#83;&#95;&#49;&#32;&#92;&#101;&#120;&#112;&#40;&#92;&#59;&#91;&#92;&#109;&#117;&#95;&#49;&#45;&#92;&#116;&#101;&#120;&#116;&#115;&#116;&#121;&#108;&#101;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#50;&#125;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#49;&#94;&#50;&#93;&#116;&#92;&#59;&#41;&#92;&#92; &#69;&#95;&#50;&#38;&#61;&#83;&#95;&#50;&#32;&#92;&#101;&#120;&#112;&#40;&#92;&#59;&#91;&#92;&#109;&#117;&#95;&#50;&#45;&#92;&#116;&#101;&#120;&#116;&#115;&#116;&#121;&#108;&#101;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#50;&#125;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#50;&#94;&#50;&#93;&#116;&#92;&#59;&#41; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<p>with the following functions and symbols</p>
<table class="grid">
<tbody>
<tr>
<th>Symbol</th>
<th>Description</th>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-4496b3095cb74d9d9852a16af29a6982_l3.png" class="ql-img-inline-formula" alt="&#83;&#95;&#49;&#44;&#83;&#95;&#50;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/></td>
<td>Present value of the underlying</td>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-45d19afb35d8b2d19b3df0fb204635c6_l3.png" class="ql-img-inline-formula" alt="&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#49;&#44;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#50;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/></td>
<td>Volatility of the underlying</td>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-2c3ba56a2503367292650af2375155b6_l3.png" class="ql-img-inline-formula" alt="&#92;&#109;&#117;&#95;&#49;&#44;&#92;&#109;&#117;&#95;&#50;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/></td>
<td>Yield of the underlying</td>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-da039068127cf2ec5fc05123d4d3546f_l3.png" class="ql-img-inline-formula" alt="&#92;&#114;&#104;&#111;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/></td>
<td>Correlation between the underlying</td>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-ea9c87a513e4a72624155d392fae86e2_l3.png" class="ql-img-inline-formula" alt="&#75;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/></td>
<td>Strike</td>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-c409433a9e2dfcdb83360a974d243f18_l3.png" class="ql-img-inline-formula" alt="&#114;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/></td>
<td>The interest rate (continuously compounded)</td>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-b4e3cbf5d4c5c6d9b702dd139f14c147_l3.png" class="ql-img-inline-formula" alt="&#116;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/></td>
<td>Time till expiration in years</td>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-3e9d2e1120c0b3dfec22588dbf0646e7_l3.png" class="ql-img-inline-formula" alt="&#110;&#40;&#120;&#41;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/></td>
<td>The density of the normal (Gaussian) distribution function.</td>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-774d1f69d8c696dd632a32299d799df0_l3.png" class="ql-img-inline-formula" alt="&#78;&#40;&#120;&#41;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/></td>
<td>The cumulative probability of the normal (Gaussian) distribution function.</td>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-3f558b184d6af543b0c722989a38ba44_l3.png" class="ql-img-inline-formula" alt="&#92;&#101;&#120;&#112;&#40;&#120;&#41;&#61;&#101;&#94;&#120;&#92;&#44;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/></td>
<td>e to the power of x</td>
</tr>
</tbody>
</table>
<p>The values <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-c8700e0258243116de0d4f288e2e3b44_l3.png" class="ql-img-inline-formula" alt="&#120;&#95;&#105;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/> <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-b04985ab74ff705ec05c507ed58afebd_l3.png" class="ql-img-inline-formula" alt="&#119;&#95;&#105;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/> are the abscesses and weights of Gauss Legendre quadrature scaled to a region in which the standard normal density function is significantly positive.</p>
<p>The table below gives the numbers for the 16 point Gauss Legendre quadrature scales to the range [-4 to 4]</p>
<table class='matrix'>
<tbody>
<tr>
<th><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-c8700e0258243116de0d4f288e2e3b44_l3.png" class="ql-img-inline-formula" alt="&#120;&#95;&#105;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/></th>
<th><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-b04985ab74ff705ec05c507ed58afebd_l3.png" class="ql-img-inline-formula" alt="&#119;&#95;&#105;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/></th>
</tr>
<tr>
<td>-3.9576037399666</td>
<td>0.108609837647007</td>
</tr>
<tr>
<td>-3.77830009229293</td>
<td>0.249014095754591</td>
</tr>
<tr>
<td>-3.46252480955133</td>
<td>0.380634046729972</td>
</tr>
<tr>
<td>-3.02161763342001</td>
<td>0.498515885022136</td>
</tr>
<tr>
<td>-2.47150497761058</td>
<td>0.598383955266293</td>
</tr>
<tr>
<td>-1.83206711062891</td>
<td>0.67662607758001</td>
</tr>
<tr>
<td>-1.12641420311704</td>
<td>0.730413660179694</td>
</tr>
<tr>
<td>-0.38005003935055</td>
<td>0.757802441820274</td>
</tr>
<tr>
<td>0.38005003935055</td>
<td>0.757802441820274</td>
</tr>
<tr>
<td>1.12641420311704</td>
<td>0.730413660179694</td>
</tr>
<tr>
<td>1.83206711062891</td>
<td>0.67662607758001</td>
</tr>
<tr>
<td>2.47150497761058</td>
<td>0.598383955266293</td>
</tr>
<tr>
<td>3.02161763342001</td>
<td>0.498515885022136</td>
</tr>
<tr>
<td>3.46252480955133</td>
<td>0.380634046729972</td>
</tr>
<tr>
<td>3.77830009229293</td>
<td>0.249014095754591</td>
</tr>
<tr>
<td>3.9576037399666</td>
<td>0.108609837647007</td>
</tr>
</tbody>
</table>
<h2>Example</h2>
<h3>What is the value of the following digital spread call?</h3>
<p>The contract pays 1 dollar is the price of Apple stock is at least<br />
40 dollar higher than that of IBM in one year time. The current market<br />
prices for Apple stock is 146, and for IBM 116. The risk free interest<br />
rate is 5%. The stocks have a correlation of 0.55, and both Apple and<br />
IBM stock have a volatility of 0.25</p>
<p><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-9394d34b436c6d82638ee9df1de5b475_l3.png" class="ql-img-inline-formula" alt="&#69;&#95;&#49;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> = 148.7633252<br />
<img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-c4b8eef8eeb68285d1c2a7e35083ddbc_l3.png" class="ql-img-inline-formula" alt="&#69;&#95;&#50;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/> = 118.1955187<br />
For i=1 we get:<br />
<img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-01a7b7b5dca66cb33a1207e1f39c1140_l3.png" class="ql-img-inline-formula" alt="&#120;&#95;&#49;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> = -3.957604<br />
<img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-9bc68498e7482f1dfc39d5831c40371a_l3.png" class="ql-img-inline-formula" alt="&#119;&#95;&#49;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> = 0.108610<br />
<img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-51921237944fd6e43f0640228a37376f_l3.png" class="ql-img-inline-formula" alt="&#109;&#95;&#49;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> = -8.175308<br />
<img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-a0306e7f5899c945e3c11601d7d4739b_l3.png" class="ql-img-inline-formula" alt="&#78;&#40;&#41;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> = 3.4207E-13<br />
<img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-7fa16276099d10876b9fd7001aaa652f_l3.png" class="ql-img-inline-formula" alt="&#110;&#40;&#41;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> = 1.5842E-04<br />
<img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-f01b4cd1de66bfdfb67fb3c67bbe25a3_l3.png" class="ql-img-inline-formula" alt="&#119;&#95;&#49;&#32;&#42;&#32;&#78;&#40;&#41;&#32;&#42;&#32;&#110;&#40;&#41;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/>= 5.88577E-18</p>
<p>Repeating this for i=2 to 16, summing the results and multiplying with <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-8b6f945a470b12f036a85f28a5f3f94b_l3.png" class="ql-img-inline-formula" alt="&#101;&#94;&#123;&#45;&#114;&#116;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> we finally get a value of  0.3588</p>
<h2>VBA (Visual Basic for Applications) code</h2>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #E56717; font-weight: bold;">Function</span> DigitalSpreadOption( _
    S1 <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #F660AB; font-weight: bold;">Double</span>, _
    S2 <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #F660AB; font-weight: bold;">Double</span>, _
    v1 <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #F660AB; font-weight: bold;">Double</span>, _
    v2 <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #F660AB; font-weight: bold;">Double</span>, _
    Y1 <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #F660AB; font-weight: bold;">Double</span>, _
    Y2 <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #F660AB; font-weight: bold;">Double</span>, _
    c <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #F660AB; font-weight: bold;">Double</span>, _
    r <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #F660AB; font-weight: bold;">Double</span>, _
    t <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #F660AB; font-weight: bold;">Double</span>, _
    K <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #F660AB; font-weight: bold;">Double</span>, _
    IsCall <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #F660AB; font-weight: bold;">Boolean</span>) <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #F660AB; font-weight: bold;">Double</span>
&nbsp;
<span style="color: #008000;">'The Digital Spread call has a payoff of 1 if S1-S2&gt;K and else zero.
</span><span style="color: #008000;">'The Digital Spread put has a payoff of 1 if S1-S2&lt;K and else zero.
</span>
<span style="color: #008000;">' PARAMETERS:
</span><span style="color: #008000;">' - S1,S2 are the present values of the underlyings.
</span><span style="color: #008000;">' - v1,v2 the volatilities of the underlyings
</span><span style="color: #008000;">' - Y1,Y2 the yields: Use zero yield for futures, 
</span><span style="color: #008000;">'         set the yield to the interest rate for stocks
</span><span style="color: #008000;">' - c the correlation between S1,S2
</span><span style="color: #008000;">' - r the interest rate (continuously compounded)
</span><span style="color: #008000;">' - t time till expiration in years
</span><span style="color: #008000;">' - K Strike
</span>
<span style="color: #008000;">' NOTES:
</span><span style="color: #008000;">' This function uses two non standard functions:
</span><span style="color: #008000;">'- NormDens, the density function of the standard normal distribution
</span><span style="color: #008000;">'- NormProb, the cumulative standard normal function
</span>
    <span style="color: #008000;">'Gauss Legendre Quadrature on the interval -5 to 5
</span>    <span style="color: #151B8D; font-weight: bold;">Dim</span> x_i <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #F660AB; font-weight: bold;">Variant</span>
    <span style="color: #151B8D; font-weight: bold;">Dim</span> w_i <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #F660AB; font-weight: bold;">Variant</span>
    x_i = Array( _
    -4.98631930924741, -4.92805755772634, -4.82381127793753, -4.6745303796887, _
    -4.48160577883026, -4.24683806866285, -3.97241897983971, -3.66091059370145, _
    -3.31522133465108, -2.93857878620381, -2.53449954466115, -2.10675638065318, _
    -1.65934301141064, -1.19643681126069, -0.722359807913982, -0.241538328438692, _
     0.241538328438692, 0.722359807913982, 1.19643681126069, 1.65934301141064, _
     2.10675638065318, 2.53449954466115, 2.93857878620381, 3.31522133465108, _
     3.66091059370145, 3.97241897983971, 4.24683806866285, 4.48160577883026, _
     4.6745303796887, 4.82381127793753, 4.92805755772634, 4.98631930924741)
&nbsp;
    w_i = Array( _
    0.035093050047348, 8.13719736545292E-02, 0.126960326546311, 0.171369314565107, _
    0.214179490111091, 0.254990296311873, 0.293420467392676, 0.329111113881808, _
    0.361728970544243, 0.390969478935351, 0.416559621134734, 0.438260465022019, _
    0.455869393478819, 0.469221995404022, 0.478193600396374, 0.482700442573639, _
    0.482700442573639, 0.478193600396374, 0.469221995404022, 0.455869393478819, _
    0.438260465022019, 0.416559621134734, 0.390969478935351, 0.361728970544243, _
    0.329111113881808, 0.293420467392676, 0.254990296311873, 0.214179490111091, _
    0.171369314565107, 0.126960326546311, 8.13719736545292E-02, 0.035093050047348)
&nbsp;
    <span style="color: #151B8D; font-weight: bold;">Dim</span> E1 <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #F660AB; font-weight: bold;">Double</span>
    <span style="color: #151B8D; font-weight: bold;">Dim</span> E2 <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #F660AB; font-weight: bold;">Double</span>
    <span style="color: #151B8D; font-weight: bold;">Dim</span> m_i <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #F660AB; font-weight: bold;">Double</span>
&nbsp;
    <span style="color: #151B8D; font-weight: bold;">Dim</span> Prob <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #F660AB; font-weight: bold;">Double</span>
    E1 = S1 * Exp((Y1 - 0.5 * v1 * v1) * t)
    E2 = S2 * Exp((Y2 - 0.5 * v2 * v2) * t)
    Prob = 0
&nbsp;
    <span style="color: #8D38C9; font-weight: bold;">For</span> i = <span style="color: #151B8D; font-weight: bold;">LBound</span>(x_i) <span style="color: #8D38C9; font-weight: bold;">To</span> <span style="color: #151B8D; font-weight: bold;">UBound</span>(x_i)
        m_i = Log((E1 * Exp(x_i(i) * v1 * Sqr(t)) - K) / E2) _ 
               / (v2 * Sqr(t))
        Prob = Prob + w_i(i) * NormDens(x_i(i)) _
              * NormProb((m_i - c * x_i(i)) / Sqr(1 - c * c))
    <span style="color: #8D38C9; font-weight: bold;">Next</span>
&nbsp;
    <span style="color: #8D38C9; font-weight: bold;">If</span> IsCall <span style="color: #8D38C9; font-weight: bold;">Then</span>
        DigitalSpreadOption = Prob * Exp(-r * t)
    <span style="color: #8D38C9; font-weight: bold;">Else</span>
        DigitalSpreadOption = (1# - Prob) * Exp(-r * t)
    <span style="color: #8D38C9; font-weight: bold;">End</span> <span style="color: #8D38C9; font-weight: bold;">If</span>
<span style="color: #8D38C9; font-weight: bold;">End</span> <span style="color: #E56717; font-weight: bold;">Function</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #E56717; font-weight: bold;">Public</span> <span style="color: #E56717; font-weight: bold;">Function</span> NormProb(<span style="color: #151B8D; font-weight: bold;">ByVal</span> x <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #F660AB; font-weight: bold;">Double</span>) <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #F660AB; font-weight: bold;">Double</span>
&nbsp;
  <span style="color: #151B8D; font-weight: bold;">Dim</span> t <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #F660AB; font-weight: bold;">Double</span>
  Const b1 = 0.31938153
  Const b2 = -0.356563782
  Const b3 = 1.781477937
  Const b4 = -1.821255978
  Const b5 = 1.330274429
  Const p = 0.2316419
  Const c = 0.39894228
&nbsp;
  <span style="color: #8D38C9; font-weight: bold;">If</span> x &gt;= 0 <span style="color: #8D38C9; font-weight: bold;">Then</span>
      t = 1# / (1# + p * x)
      NormProb = (1# - c * Exp(-x * x / 2#) * t * _
      (t * (t * (t * (t * b5 + b4) + b3) + b2) + b1))
  <span style="color: #8D38C9; font-weight: bold;">Else</span>
      t = 1# / (1# - p * x)
      NormProb = (c * Exp(-x * x / 2#) * t * _
      (t * (t * (t * (t * b5 + b4) + b3) + b2) + b1))
  <span style="color: #8D38C9; font-weight: bold;">End</span> <span style="color: #8D38C9; font-weight: bold;">If</span>
<span style="color: #8D38C9; font-weight: bold;">End</span> <span style="color: #E56717; font-weight: bold;">Function</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #E56717; font-weight: bold;">Public</span> <span style="color: #E56717; font-weight: bold;">Function</span> NormDens(<span style="color: #151B8D; font-weight: bold;">ByVal</span> x <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #F660AB; font-weight: bold;">Double</span>) <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #F660AB; font-weight: bold;">Double</span>
    NormDens = Exp(-0.5 * x * x) / 2.506628274631
<span style="color: #8D38C9; font-weight: bold;">End</span> <span style="color: #E56717; font-weight: bold;">Function</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.sitmo.com/article/digital-spread-option-pricing-model/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Asset Optimization for a water utility</title>
		<link>http://www.sitmo.com/article/asset-optimization-for-a-water-utility/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=asset-optimization-for-a-water-utility</link>
		<comments>http://www.sitmo.com/article/asset-optimization-for-a-water-utility/#comments</comments>
		<pubDate>Sun, 29 May 2011 06:26:05 +0000</pubDate>
		<dc:creator>Thijs van den Berg</dc:creator>
				<category><![CDATA[Client Projects]]></category>
		<category><![CDATA[Energy]]></category>

		<guid isPermaLink="false">http://www.sitmo.com/?p=182</guid>
		<description><![CDATA[This project involved cost optimization the water transport- and purification process. We looked at the production flexibility, and examined how we can reschedule production to lower electricity cost. Electricity prices are not constant, and the cost reduction strategy involves rescheduling electricity use to cheaper hours. We showed that production costs van be reduced by 20% [...]]]></description>
			<content:encoded><![CDATA[<p>This project involved cost optimization the water transport- and  purification process. We looked at the production flexibility, and examined how we can reschedule production to lower electricity cost. Electricity prices are not constant, and the cost reduction strategy involves rescheduling electricity use to cheaper hours.  We showed that production costs van be reduced by 20% by (dynamic) re-scheduling the timing of production and water transport based on (real-time) electricity prices.<br />
<span id="more-182"></span></p>
<div id="attachment_204" class="wp-caption aligncenter" style="width: 260px"><img src="http://www.sitmo.com/wp-content/uploads/2011/05/apx-average-month.png" alt="" title="apx-average-month" width="250" height="125" class="size-full wp-image-204" /><p class="wp-caption-text">Hourly electricity prices for various months of the year.</p></div>
<p>We found three main elements in the business chain that allow for optimization:</p>
<h3>Water Transport</h3>
<p>Raw material for the water purification process is <em>raw water</em>. Raw water is transported from a distant location to the purification plan, and that transport consumes a lot of energy. There are two main elements that define the optimal transport schedule. First is the size of buffers. Buffers generate flexibility in delivery schedules, it allows you e.g. to postpone transport. The second element is the efficiency of transport. Speeding up transport will increase the amount of energy that is needed for transporting the same volume. This is caused by increased pipe friction as a function of the flow speed.</p>
<div id="attachment_348" class="wp-caption aligncenter" style="width: 310px"><img src="http://www.sitmo.com/wp-content/uploads/2011/05/pump.png" alt="" title="pump" width="300" height="151" class="size-full wp-image-348" /><p class="wp-caption-text">Pump efficiency curves: Increased flowspeed (horizontal axis) will increase energy consumption (gray line y-axis)</p></div>
<p>The optimization model we developed optimized the two factors. On one hand we want to postpone transport to moment when electricity prices are low, but the consequence is that we will need to transport water at higher speeds to make up for the delayed water volume delivery, and that higher speed comes as a cost of increased friction and energy consumption. </p>
<h3>Other elements</h3>
<p>The two other  elements for which we have investigated cost reduction strategies is the  water purification plant, and using the emergency supply auxiliary power generators for opportunistic electricity supply during extreme high electricity prices.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sitmo.com/article/asset-optimization-for-a-water-utility/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Calibrating the Ornstein-Uhlenbeck (Vasicek) model</title>
		<link>http://www.sitmo.com/article/calibrating-the-ornstein-uhlenbeck-model/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=calibrating-the-ornstein-uhlenbeck-model</link>
		<comments>http://www.sitmo.com/article/calibrating-the-ornstein-uhlenbeck-model/#comments</comments>
		<pubDate>Sat, 28 May 2011 11:40:52 +0000</pubDate>
		<dc:creator>Thijs van den Berg</dc:creator>
				<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://www.sitmo.com/?p=134</guid>
		<description><![CDATA[Two methods for calibrating the Ornstein Uhlenbeck process on historical data are given. The least square fit, and the maximum likelihood estimates. Matlab source code for methods in Matlab is given.]]></description>
			<content:encoded><![CDATA[<p>In this article I&#8217;ll describe two methods for calibrating the model parameters of the Ornstein-Uhlenbeck process to a given dataset.</p>
<ul>
<li>The least squares regression method</li>
<li>maximum likelihood method</li>
</ul>
<p><span id="more-134"></span></p>
<h2>Introduction</h2>
<p>The stochastic differential equation (SDE) for the Ornstein-Uhlenbeck process is given by</p>
<p class="ql-center-displayed-equation" style="line-height: 18px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-de96a89b6e7846faf8b7e649673a332d_l3.png"class="ql-img-displayed-equation" alt="&#92;&#91; &#100;&#83;&#95;&#116;&#61;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#40;&#92;&#109;&#117;&#45;&#83;&#95;&#116;&#41;&#100;&#116;&#43;&#92;&#115;&#105;&#103;&#109;&#97;&#32;&#100;&#87;&#95;&#116; &#92;&#93;" title="Rendered by QuickLaTeX.com"/></p>
<p>with <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-2b5c45836864531b8e37025dabadd24a_l3.png" class="ql-img-inline-formula" alt="&#92;&#108;&#97;&#109;&#98;&#100;&#97;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> the mean reversion rate, <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-461fe1a58a75801541487ddf10d32abd_l3.png" class="ql-img-inline-formula" alt="&#92;&#109;&#117;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> the mean, and <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-1c9cc40f96a1492e298e7da85a2c1692_l3.png" class="ql-img-inline-formula" alt="&#92;&#115;&#105;&#103;&#109;&#97;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> the volatility.</p>
<h2>An example simulation</h2>
<p>The table and figure below show a simulated scenario for the Ornstein-Uhlenbeck process with time step <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-02c416d77f6650e9c7849397bf6e11bf_l3.png" class="ql-img-inline-formula" alt="&#92;&#100;&#101;&#108;&#116;&#97;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/>=0.25, mean reversion rate <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-2b5c45836864531b8e37025dabadd24a_l3.png" class="ql-img-inline-formula" alt="&#92;&#108;&#97;&#109;&#98;&#100;&#97;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/>=3.0, long term mean <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-461fe1a58a75801541487ddf10d32abd_l3.png" class="ql-img-inline-formula" alt="&#92;&#109;&#117;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/>=1.0 and a noise term of <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-1c9cc40f96a1492e298e7da85a2c1692_l3.png" class="ql-img-inline-formula" alt="&#92;&#115;&#105;&#103;&#109;&#97;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/>=0.50. We will use this data to explain the model calibration steps.</p>
<p>&nbsp;</p>
<div id="attachment_141" class="wp-caption aligncenter" style="width: 310px"><img class="size-full wp-image-141" title="ll_ou_scenario" src="http://www.sitmo.com/wp-content/uploads/2011/05/ll_ou_scenario.png" alt="" width="300" height="200" /><p class="wp-caption-text">A scenarios of a the Ornstein-Uhlenbeck process. The scenarios start at S(0)=3 and reverting to a long term mean of 1.</p></div>
<p>&nbsp;</p>
<table class="matrix">
<tbody>
<tr>
<th>i</th>
<th>t</th>
<th><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-8f5464d0cc3e4b8b84f8f8534f966ca8_l3.png" class="ql-img-inline-formula" alt="&#83;&#95;&#105;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/></th>
<th><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-efcc523db03d05c127e0ccdf33edcdce_l3.png" class="ql-img-inline-formula" alt="&#78;&#95;&#123;&#48;&#44;&#49;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -6px;"/></th>
</tr>
<tr>
<td>0</td>
<td>0.00</td>
<td>3.0000</td>
<td></td>
</tr>
<tr>
<td>1</td>
<td>0.25</td>
<td>1.7600</td>
<td>-1.0268</td>
</tr>
<tr>
<td>2</td>
<td>0.50</td>
<td>1.2693</td>
<td>-0.4985</td>
</tr>
<tr>
<td>3</td>
<td>0.75</td>
<td>1.1960</td>
<td>0.3825</td>
</tr>
<tr>
<td>4</td>
<td>1.00</td>
<td>0.9468</td>
<td>-0.8102</td>
</tr>
<tr>
<td>5</td>
<td>1.25</td>
<td>0.9532</td>
<td>-0.1206</td>
</tr>
<tr>
<td>6</td>
<td>1.50</td>
<td>0.6252</td>
<td>-1.9604</td>
</tr>
<tr>
<td>7</td>
<td>1.75</td>
<td>0.8604</td>
<td>0.2079</td>
</tr>
<tr>
<td>8</td>
<td>2.00</td>
<td>1.0984</td>
<td>0.9134</td>
</tr>
<tr>
<td>9</td>
<td>2.25</td>
<td>1.4310</td>
<td>2.1375</td>
</tr>
<tr>
<td>10</td>
<td>2.50</td>
<td>1.3019</td>
<td>0.5461</td>
</tr>
<tr>
<td>11</td>
<td>2.75</td>
<td>1.4005</td>
<td>1.4335</td>
</tr>
<tr>
<td>12</td>
<td>3.00</td>
<td>1.2686</td>
<td>0.4414</td>
</tr>
<tr>
<td>13</td>
<td>3.25</td>
<td>0.7147</td>
<td>-2.2912</td>
</tr>
<tr>
<td>14</td>
<td>3.50</td>
<td>0.9237</td>
<td>0.3249</td>
</tr>
<tr>
<td>15</td>
<td>3.75</td>
<td>0.7297</td>
<td>-1.3019</td>
</tr>
<tr>
<td>16</td>
<td>4.00</td>
<td>0.7105</td>
<td>-0.8995</td>
</tr>
<tr>
<td>17</td>
<td>4.25</td>
<td>0.8683</td>
<td>0.0281</td>
</tr>
<tr>
<td>18</td>
<td>4.50</td>
<td>0.7406</td>
<td>-1.0959</td>
</tr>
<tr>
<td>19</td>
<td>4.75</td>
<td>0.7314</td>
<td>-0.8118</td>
</tr>
<tr>
<td>20</td>
<td>5.00</td>
<td>0.6232</td>
<td>-1.3890</td>
</tr>
</tbody>
</table>
<p>The following simulation equation is used for generating paths (sampled with fixed time steps of <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-02c416d77f6650e9c7849397bf6e11bf_l3.png" class="ql-img-inline-formula" alt="&#92;&#100;&#101;&#108;&#116;&#97;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/>=0.25). The equation is an exact solution of the SDE.</p>
<p class="ql-center-displayed-equation" style="line-height: 43px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-cfae89a5ce3240d788d2529fc3004aad_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#83;&#95;&#123;&#105;&#43;&#49;&#125;&#32;&#38;&#61;&#83;&#95;&#105;&#32;&#32;&#101;&#94;&#123;&#45;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#32;&#92;&#100;&#101;&#108;&#116;&#97;&#125;&#43;&#92;&#109;&#117;&#40;&#49;&#45;&#101;&#94;&#123;&#45;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#32;&#92;&#100;&#101;&#108;&#116;&#97;&#125;&#41; &#43;&#92;&#115;&#105;&#103;&#109;&#97;&#92;&#115;&#113;&#114;&#116;&#123;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#45;&#101;&#94;&#123;&#45;&#50;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#32;&#92;&#100;&#101;&#108;&#116;&#97;&#125;&#125;&#123;&#50;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#125;&#125;&#32;&#78;&#95;&#123;&#48;&#44;&#49;&#125; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<p>The random numbers used in this example are shown in the last column of the table 1.</p>
<h2>Calibration using least squares regression</h2>
<p>The relationship between consecutive observations <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-7cdcfbec5299a31d0ff5ff0c3c1edfb7_l3.png" class="ql-img-inline-formula" alt="&#83;&#95;&#105;&#44;&#83;&#95;&#123;&#105;&#43;&#49;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> is linear with a iid normal random term <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-729568734d87ffb0f88cf42b1bc6828a_l3.png" class="ql-img-inline-formula" alt="&#92;&#101;&#112;&#115;&#105;&#108;&#111;&#110;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/></p>
<p class="ql-center-displayed-equation" style="line-height: 16px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-3a0cb6a9c663e1cb4fa542d0f2c7b40f_l3.png"class="ql-img-displayed-equation" alt="&#92;&#91; &#83;&#95;&#123;&#105;&#43;&#49;&#125;&#32;&#61;&#32;&#97;&#32;&#83;&#95;&#105;&#32;&#43;&#32;&#98;&#32;&#43;&#32;&#92;&#101;&#112;&#115;&#105;&#108;&#111;&#110; &#92;&#93;" title="Rendered by QuickLaTeX.com"/></p>
<p>&nbsp;</p>
<div id="attachment_145" class="wp-caption aligncenter" style="width: 310px"><img class="size-full wp-image-145" title="ll_ou_regress" src="http://www.sitmo.com/wp-content/uploads/2011/05/ll_ou_regress.png" alt="" width="300" height="200" /><p class="wp-caption-text">Least square fitting of a line to the data.</p></div>
<p>&nbsp;</p>
<p>The relationship between the linear fit and the model parameters is given by</p>
<p class="ql-center-displayed-equation" style="line-height: 111px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-157f3a67e619614d4c2395c7dcaa1031_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#97;&#32;&#38;&#61;&#101;&#94;&#123;&#45;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#92;&#100;&#101;&#108;&#116;&#97;&#125;&#92;&#92; &#98;&#32;&#38;&#61;&#92;&#109;&#117;&#92;&#108;&#101;&#102;&#116;&#40;&#49;&#45;&#101;&#94;&#123;&#45;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#92;&#100;&#101;&#108;&#116;&#97;&#125;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#92;&#92; &#115;&#100;&#40;&#92;&#101;&#112;&#115;&#105;&#108;&#111;&#110;&#41;&#32;&#38;&#61;&#92;&#115;&#105;&#103;&#109;&#97;&#32;&#92;&#115;&#113;&#114;&#116;&#123;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#45;&#101;&#94;&#123;&#45;&#50;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#92;&#100;&#101;&#108;&#116;&#97;&#125;&#125;&#123;&#50;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#125;&#125; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<p>rewriting these equations gives</p>
<p class="ql-center-displayed-equation" style="line-height: 143px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-107262e21fcba1e4ea9dbb3af0c8fc0e_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#92;&#108;&#97;&#109;&#98;&#100;&#97;&#32;&#38;&#61;&#45;&#92;&#102;&#114;&#97;&#99;&#123;&#92;&#108;&#110;&#32;&#97;&#125;&#123;&#92;&#100;&#101;&#108;&#116;&#97;&#125;&#32;&#92;&#92; &#92;&#109;&#117;&#32;&#38;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#98;&#125;&#123;&#49;&#45;&#97;&#125;&#92;&#92; &#92;&#115;&#105;&#103;&#109;&#97;&#32;&#38;&#61;&#115;&#100;&#40;&#92;&#101;&#112;&#115;&#105;&#108;&#111;&#110;&#41;&#32;&#92;&#115;&#113;&#114;&#116;&#123;&#92;&#102;&#114;&#97;&#99;&#123;&#45;&#50;&#92;&#108;&#110;&#32;&#97;&#125;&#123;&#92;&#100;&#101;&#108;&#116;&#97;&#40;&#49;&#32;&#45;&#32;&#97;&#94;&#50;&#41;&#125;&#125; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h2>Calculating the least squares regression</h2>
<p>Most software tools (Excel, Matlab, R, Octave, Maple, &#8230;) have built in functionality for least square regression. If its not available, a least square regression can easily be done by calculating the the quantities below:</p>
<p class="ql-center-displayed-equation" style="line-height: 287px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-a9b16aed1b77530b67e909e0f1ca29c2_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#83;&#95;&#120;&#32;&#38;&#61;&#92;&#115;&#117;&#109;&#95;&#123;&#105;&#61;&#49;&#125;&#94;&#123;&#110;&#125;&#32;&#83;&#95;&#123;&#105;&#45;&#49;&#125;&#92;&#92; &#83;&#95;&#121;&#32;&#38;&#61;&#92;&#115;&#117;&#109;&#95;&#123;&#105;&#61;&#49;&#125;&#94;&#123;&#110;&#125;&#32;&#83;&#95;&#105;&#32;&#92;&#92; &#83;&#95;&#123;&#120;&#120;&#125;&#32;&#38;&#61;&#92;&#115;&#117;&#109;&#95;&#123;&#105;&#61;&#49;&#125;&#94;&#123;&#110;&#125;&#32;&#83;&#95;&#123;&#105;&#45;&#49;&#125;&#94;&#50;&#92;&#92; &#83;&#95;&#123;&#120;&#121;&#125;&#32;&#38;&#61;&#92;&#115;&#117;&#109;&#95;&#123;&#105;&#61;&#49;&#125;&#94;&#123;&#110;&#125;&#32;&#83;&#95;&#123;&#105;&#45;&#49;&#125;&#32;&#83;&#95;&#105;&#92;&#92; &#83;&#95;&#123;&#121;&#121;&#125;&#32;&#38;&#61;&#92;&#115;&#117;&#109;&#95;&#123;&#105;&#61;&#49;&#125;&#94;&#123;&#110;&#125;&#32;&#83;&#95;&#105;&#94;&#50; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<p>from which we get the following parameters of the least square fit</p>
<p class="ql-center-displayed-equation" style="line-height: 145px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-145193cba70832e7d49ceeef1a4e660c_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#97;&#32;&#38;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#110;&#83;&#95;&#123;&#120;&#121;&#125;&#45;&#83;&#95;&#120;&#83;&#95;&#121;&#125;&#123;&#110;&#83;&#95;&#123;&#120;&#120;&#125;&#45;&#83;&#95;&#120;&#94;&#50;&#125;&#92;&#92; &#98;&#32;&#38;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#83;&#95;&#121;&#32;&#45;&#32;&#97;&#32;&#83;&#95;&#120;&#125;&#123;&#110;&#125;&#92;&#92; &#115;&#100;&#40;&#92;&#101;&#112;&#115;&#105;&#108;&#111;&#110;&#41;&#32;&#38;&#61;&#92;&#115;&#113;&#114;&#116;&#123;&#92;&#102;&#114;&#97;&#99;&#123;&#110;&#32;&#83;&#95;&#123;&#121;&#121;&#125;&#45;&#83;&#95;&#121;&#94;&#50;&#32;&#45;&#32;&#97;&#92;&#108;&#101;&#102;&#116;&#40;&#110;&#32;&#83;&#95;&#123;&#120;&#121;&#125;&#45;&#83;&#95;&#120;&#32;&#83;&#95;&#121;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#125;&#123;&#110;&#40;&#110;&#45;&#50;&#41;&#125;&#125; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h2>Example</h2>
<p>Applying the regression to the data in table 1 we get</p>
<table class="matrix">
<tbody>
<tr>
<th>Param</th>
<th>Value</th>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-f2286baa7c6a1ee9a38654505b0643e5_l3.png" class="ql-img-inline-formula" alt="&#83;&#95;&#120;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/></td>
<td>22.5301</td>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-770e27a2ae8031e0e7f72671d5973379_l3.png" class="ql-img-inline-formula" alt="&#83;&#95;&#121;" title="Rendered by QuickLaTeX.com" style="vertical-align: -6px;"/></td>
<td>20.1534</td>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-6bb39e217b2ef21a294456bc50f67bca_l3.png" class="ql-img-inline-formula" alt="&#83;&#95;&#123;&#120;&#120;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/></td>
<td>30.8338</td>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-88fe6ff50b8cedfbcb7b2fdd7c8a7d4c_l3.png" class="ql-img-inline-formula" alt="&#83;&#95;&#123;&#120;&#121;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -6px;"/></td>
<td>25.1973</td>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-d949774f1ce2bf799b695c36ebba93d8_l3.png" class="ql-img-inline-formula" alt="&#83;&#95;&#123;&#121;&#121;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -6px;"/></td>
<td>22.2222</td>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-5c53d6ebabdbcfa4e107550ea60b1b19_l3.png" class="ql-img-inline-formula" alt="&#97;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/></td>
<td>0.4574</td>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-f56d50c26583f9a035ff6b4e3c0ca5c0_l3.png" class="ql-img-inline-formula" alt="&#98;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/></td>
<td>0.4924</td>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-3eb49bb4473f55c80fd38b650befb8c2_l3.png" class="ql-img-inline-formula" alt="&#115;&#100;&#40;&#92;&#101;&#112;&#115;&#105;&#108;&#111;&#110;&#41;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/></td>
<td>0.2073</td>
</tr>
</tbody>
</table>
<p>These results allow us to recover the model parameters:</p>
<table class="matrix">
<tbody>
<tr>
<th>Param</th>
<th>Value</th>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-461fe1a58a75801541487ddf10d32abd_l3.png" class="ql-img-inline-formula" alt="&#92;&#109;&#117;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/></td>
<td>0.9075</td>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-2b5c45836864531b8e37025dabadd24a_l3.png" class="ql-img-inline-formula" alt="&#92;&#108;&#97;&#109;&#98;&#100;&#97;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/></td>
<td>3.1288</td>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-1c9cc40f96a1492e298e7da85a2c1692_l3.png" class="ql-img-inline-formula" alt="&#92;&#115;&#105;&#103;&#109;&#97;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/></td>
<td>0.5831</td>
</tr>
</tbody>
</table>
<h2>Calibration using Maximum Likelihood estimates</h2>
<h3>Conditional probability density function</h3>
<p>The conditional probability density function is easily derived by combining the simulation equation above with the probability density function of the normal distribution function:</p>
<p class="ql-center-displayed-equation" style="line-height: 40px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-bb067cc9615618b9f884c8eeabd9c46a_l3.png"class="ql-img-displayed-equation" alt="&#92;&#91; &#80;&#40;&#78;&#95;&#123;&#48;&#44;&#49;&#125;&#61;&#120;&#41;&#32;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#92;&#115;&#113;&#114;&#116;&#123;&#50;&#92;&#112;&#105;&#125;&#125;&#101;&#94;&#123;&#45;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#50;&#125;&#120;&#94;&#50;&#125; &#92;&#93;" title="Rendered by QuickLaTeX.com"/></p>
<p>&nbsp;</p>
<div id="attachment_144" class="wp-caption aligncenter" style="width: 310px"><img class="size-full wp-image-144" title="ll_ou_conpron" src="http://www.sitmo.com/wp-content/uploads/2011/05/ll_ou_conpron.png" alt="" width="300" height="200" /><p class="wp-caption-text">Conditional probability density function -red- of S at t=1.</p></div>
<p>&nbsp;</p>
<p>The equation of the conditional probability density of an observation <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-003e9098f8f40746bd51335dcb29c103_l3.png" class="ql-img-inline-formula" alt="&#83;&#95;&#123;&#105;&#43;&#49;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> given a previous observation <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-8f5464d0cc3e4b8b84f8f8534f966ca8_l3.png" class="ql-img-inline-formula" alt="&#83;&#95;&#105;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/> (with a <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-02c416d77f6650e9c7849397bf6e11bf_l3.png" class="ql-img-inline-formula" alt="&#92;&#100;&#101;&#108;&#116;&#97;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> time step between them) is given by</p>
<p class="ql-center-displayed-equation" style="line-height: 81px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-f2b5f5e7756ef1afc44b23b3a25a4ad9_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#38;&#102;&#40;&#83;&#95;&#123;&#105;&#43;&#49;&#125;&#32;&#124;&#32;&#83;&#95;&#105;&#59;&#92;&#109;&#117;&#44;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#44;&#92;&#104;&#97;&#116;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#125;&#41;&#32;&#92;&#92; &#38;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#92;&#115;&#113;&#114;&#116;&#123;&#50;&#92;&#112;&#105;&#32;&#92;&#104;&#97;&#116;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#125;&#94;&#50;&#125;&#125;&#32;&#92;&#101;&#120;&#112;&#32;&#92;&#108;&#101;&#102;&#116;&#91;&#32;&#45;&#92;&#102;&#114;&#97;&#99;&#123;&#32;&#92;&#108;&#101;&#102;&#116;&#40;&#83;&#95;&#105;&#32;&#45;&#32;&#83;&#95;&#123;&#105;&#45;&#49;&#125;&#32;&#101;&#94;&#123;&#45;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#32;&#92;&#100;&#101;&#108;&#116;&#97;&#125;&#45;&#92;&#109;&#117;&#40;&#49;&#45;&#101;&#94;&#123;&#45;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#32;&#92;&#100;&#101;&#108;&#116;&#97;&#125;&#41;&#32;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#94;&#50;&#32;&#125;&#123;&#50;&#92;&#104;&#97;&#116;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#125;&#94;&#50;&#125;&#32;&#92;&#114;&#105;&#103;&#104;&#116;&#93; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<p>with</p>
<p class="ql-center-displayed-equation" style="line-height: 40px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-995f03bf52658df4dab53d19c08f33a8_l3.png"class="ql-img-displayed-equation" alt="&#92;&#91; &#92;&#104;&#97;&#116;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#125;&#94;&#50;&#32;&#61;&#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#45;&#101;&#94;&#123;&#45;&#50;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#92;&#100;&#101;&#108;&#116;&#97;&#125;&#125;&#123;&#50;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#125; &#92;&#93;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Log-likelihood function</h3>
<p>The log-likelihood function of a set of observation <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-33e4c5a159ba2525fb672ad42a333df8_l3.png" class="ql-img-inline-formula" alt="&#40;&#83;&#95;&#48;&#44;&#32;&#83;&#95;&#49;&#44;&#32;&#92;&#108;&#100;&#111;&#116;&#115;&#44;&#32;&#83;&#95;&#110;&#41;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> can be derived from the conditional density function</p>
<p class="ql-center-displayed-equation" style="line-height: 148px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-e1585d0d6b5a67d385924296a064614a_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#38;&#92;&#109;&#97;&#116;&#104;&#99;&#97;&#108;&#123;&#76;&#125;&#40;&#92;&#109;&#117;&#44;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#44;&#92;&#104;&#97;&#116;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#125;&#41;&#32;&#61;&#92;&#115;&#117;&#109;&#95;&#123;&#105;&#61;&#49;&#125;&#94;&#110;&#32;&#92;&#108;&#110;&#32;&#102;&#40;&#83;&#95;&#105;&#32;&#32;&#83;&#95;&#123;&#105;&#45;&#49;&#125;&#59;&#92;&#109;&#117;&#44;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#44;&#92;&#115;&#105;&#103;&#109;&#97;&#41;&#92;&#92; &#38;&#61;&#45;&#92;&#102;&#114;&#97;&#99;&#123;&#110;&#125;&#123;&#50;&#125;&#32;&#32;&#92;&#108;&#110;&#40;&#50;&#92;&#112;&#105;&#41;&#32;&#45;&#110;&#92;&#108;&#110;&#40;&#92;&#104;&#97;&#116;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#125;&#41;&#32;&#92;&#92; &#38;&#92;&#59;&#92;&#59;&#92;&#59;&#92;&#59;&#45;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#50;&#92;&#104;&#97;&#116;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#125;&#94;&#50;&#125;&#32;&#92;&#115;&#117;&#109;&#95;&#123;&#105;&#61;&#49;&#125;&#94;&#110;&#32;&#92;&#108;&#101;&#102;&#116;&#91;&#32;&#83;&#95;&#105;&#32;&#45;&#32;&#83;&#95;&#123;&#105;&#45;&#49;&#125;&#32;&#101;&#94;&#123;&#45;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#32;&#92;&#100;&#101;&#108;&#116;&#97;&#125;&#45;&#92;&#109;&#117;&#40;&#49;&#45;&#101;&#94;&#123;&#45;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#32;&#92;&#100;&#101;&#108;&#116;&#97;&#125;&#41;&#32;&#92;&#114;&#105;&#103;&#104;&#116;&#93;&#94;&#50; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Maximum likelihood conditions</h3>
<p>The maximum of this log-likelihood surface can be found at the location where all the partial derivatives are zero. This leads to the following set of constraints.</p>
<p>&nbsp;</p>
<div id="attachment_143" class="wp-caption aligncenter" style="width: 260px"><img class="size-full wp-image-143" title="ll_ou_condition_mu_250" src="http://www.sitmo.com/wp-content/uploads/2011/05/ll_ou_condition_mu_250.png" alt="" width="250" height="167" /><p class="wp-caption-text">Log likelihood function as function of mu.</p></div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_140" class="wp-caption aligncenter" style="width: 260px"><img class="size-full wp-image-140" title="ll_ou_condition_lambda_250" src="http://www.sitmo.com/wp-content/uploads/2011/05/ll_ou_condition_lambda_250.png" alt="" width="250" height="167" /><p class="wp-caption-text">Log likelihood function as function of lambda.</p></div>
<p>&nbsp;</p>
<p class="ql-center-displayed-equation" style="line-height: 152px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-cf808c1017bf3c8a7284a6b80868fd35_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#92;&#102;&#114;&#97;&#99;&#123;&#92;&#112;&#97;&#114;&#116;&#105;&#97;&#108;&#32;&#92;&#109;&#97;&#116;&#104;&#99;&#97;&#108;&#123;&#76;&#125;&#40;&#92;&#109;&#117;&#44;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#44;&#92;&#104;&#97;&#116;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#125;&#41;&#125;&#123;&#92;&#112;&#97;&#114;&#116;&#105;&#97;&#108;&#92;&#109;&#117;&#125;&#32;&#38;&#61;&#48;&#92;&#92; &#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#92;&#104;&#97;&#116;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#125;&#94;&#50;&#125;&#32;&#38;&#92;&#115;&#117;&#109;&#95;&#123;&#105;&#61;&#49;&#125;&#94;&#110;&#32;&#92;&#108;&#101;&#102;&#116;&#91;&#32;&#83;&#95;&#105;&#32;&#45;&#32;&#83;&#95;&#123;&#105;&#45;&#49;&#125;&#32;&#101;&#94;&#123;&#45;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#32;&#92;&#100;&#101;&#108;&#116;&#97;&#125;&#45;&#92;&#109;&#117;&#40;&#49;&#45;&#101;&#94;&#123;&#45;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#32;&#92;&#100;&#101;&#108;&#116;&#97;&#125;&#41;&#32;&#92;&#114;&#105;&#103;&#104;&#116;&#93;&#92;&#92; &#92;&#109;&#117;&#32;&#38;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#92;&#115;&#117;&#109;&#95;&#123;&#105;&#61;&#49;&#125;&#94;&#123;&#110;&#125;&#92;&#108;&#101;&#102;&#116;&#91;&#83;&#95;&#105;&#32;&#45;&#32;&#83;&#95;&#123;&#105;&#45;&#49;&#125;&#32;&#101;&#94;&#123;&#45;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#32;&#92;&#100;&#101;&#108;&#116;&#97;&#125;&#92;&#114;&#105;&#103;&#104;&#116;&#93;&#125;&#123;&#110;&#92;&#108;&#101;&#102;&#116;&#40;&#49;&#45;&#101;&#94;&#123;&#45;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#32;&#92;&#100;&#101;&#108;&#116;&#97;&#125;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#125; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<p class="ql-center-displayed-equation" style="line-height: 148px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-c8375b5c9ab082ec110d68b3839cd55e_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#92;&#102;&#114;&#97;&#99;&#123;&#92;&#112;&#97;&#114;&#116;&#105;&#97;&#108;&#32;&#92;&#109;&#97;&#116;&#104;&#99;&#97;&#108;&#123;&#76;&#125;&#40;&#92;&#109;&#117;&#44;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#44;&#92;&#104;&#97;&#116;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#125;&#41;&#125;&#123;&#92;&#112;&#97;&#114;&#116;&#105;&#97;&#108;&#32;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#125;&#32;&#38;&#61;&#48;&#32;&#92;&#92; &#61;&#45;&#92;&#102;&#114;&#97;&#99;&#123;&#92;&#100;&#101;&#108;&#116;&#97;&#32;&#101;&#94;&#123;&#45;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#32;&#92;&#100;&#101;&#108;&#116;&#97;&#125;&#125;&#123;&#92;&#104;&#97;&#116;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#125;&#94;&#50;&#125;&#32;&#38;&#92;&#115;&#117;&#109;&#95;&#123;&#105;&#61;&#49;&#125;&#94;&#110;&#32;&#92;&#108;&#101;&#102;&#116;&#91;&#32;&#40;&#83;&#95;&#105;&#32;&#45;&#32;&#92;&#109;&#117;&#41;&#40;&#83;&#95;&#123;&#105;&#45;&#49;&#125;&#32;&#45;&#32;&#92;&#109;&#117;&#41;&#32;&#45;&#32;&#101;&#94;&#123;&#45;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#32;&#92;&#100;&#101;&#108;&#116;&#97;&#125;&#32;&#92;&#108;&#101;&#102;&#116;&#40;&#32;&#83;&#95;&#123;&#105;&#45;&#49;&#125;&#32;&#45;&#32;&#92;&#109;&#117;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#94;&#50;&#32;&#92;&#114;&#105;&#103;&#104;&#116;&#93;&#32;&#92;&#92; &#92;&#108;&#97;&#109;&#98;&#100;&#97;&#32;&#38;&#61;&#45;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#92;&#100;&#101;&#108;&#116;&#97;&#125;&#32;&#92;&#108;&#110;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#32;&#92;&#115;&#117;&#109;&#95;&#123;&#105;&#61;&#49;&#125;&#94;&#110;&#32;&#40;&#83;&#95;&#105;&#45;&#92;&#109;&#117;&#41;&#32;&#40;&#83;&#95;&#123;&#105;&#45;&#49;&#125;&#45;&#92;&#109;&#117;&#41;&#32;&#125;&#123;&#32;&#92;&#115;&#117;&#109;&#95;&#123;&#105;&#61;&#49;&#125;&#94;&#110;&#32;&#40;&#83;&#95;&#123;&#105;&#45;&#49;&#125;&#45;&#92;&#109;&#117;&#41;&#94;&#50;&#32;&#125; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<p class="ql-center-displayed-equation" style="line-height: 156px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-36a442c5bb73c33b97cb455eb257dfca_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#92;&#102;&#114;&#97;&#99;&#123;&#92;&#112;&#97;&#114;&#116;&#105;&#97;&#108;&#32;&#92;&#109;&#97;&#116;&#104;&#99;&#97;&#108;&#123;&#76;&#125;&#40;&#92;&#109;&#117;&#44;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#44;&#92;&#104;&#97;&#116;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#125;&#41;&#125;&#123;&#92;&#112;&#97;&#114;&#116;&#105;&#97;&#108;&#32;&#92;&#104;&#97;&#116;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#125;&#125;&#32;&#38;&#61;&#48;&#32;&#92;&#92; &#61;&#92;&#102;&#114;&#97;&#99;&#123;&#110;&#125;&#123;&#92;&#104;&#97;&#116;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#125;&#125;&#32;&#45;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#92;&#104;&#97;&#116;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#125;&#94;&#51;&#125;&#32;&#38;&#92;&#115;&#117;&#109;&#95;&#123;&#105;&#61;&#49;&#125;&#94;&#110;&#32;&#92;&#108;&#101;&#102;&#116;&#91;&#32;&#40;&#83;&#95;&#105;&#32;&#45;&#32;&#92;&#109;&#117;&#32;&#45;&#32;&#101;&#94;&#123;&#45;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#32;&#92;&#100;&#101;&#108;&#116;&#97;&#125;&#92;&#108;&#101;&#102;&#116;&#40;&#32;&#83;&#95;&#123;&#105;&#45;&#49;&#125;&#32;&#45;&#32;&#92;&#109;&#117;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#32;&#92;&#114;&#105;&#103;&#104;&#116;&#93;&#94;&#50;&#92;&#92; &#92;&#104;&#97;&#116;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#125;&#94;&#50;&#32;&#38;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#110;&#125;&#32;&#92;&#115;&#117;&#109;&#95;&#123;&#105;&#61;&#49;&#125;&#94;&#110;&#32;&#92;&#108;&#101;&#102;&#116;&#91; &#40;&#83;&#95;&#105;&#32;&#45;&#32;&#92;&#109;&#117;&#32;&#45;&#32;&#101;&#94;&#123;&#45;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#32;&#92;&#100;&#101;&#108;&#116;&#97;&#125;&#92;&#108;&#101;&#102;&#116;&#40;&#32;&#83;&#95;&#123;&#105;&#45;&#49;&#125;&#32;&#45;&#32;&#92;&#109;&#117;&#92;&#114;&#105;&#103;&#104;&#116;&#41; &#92;&#114;&#105;&#103;&#104;&#116;&#93;&#94;&#50; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Solution of the conditions</h3>
<p>The problem with these conditions is that the solutions depend on each other. However, both <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-2b5c45836864531b8e37025dabadd24a_l3.png" class="ql-img-inline-formula" alt="&#92;&#108;&#97;&#109;&#98;&#100;&#97;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> and <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-461fe1a58a75801541487ddf10d32abd_l3.png" class="ql-img-inline-formula" alt="&#92;&#109;&#117;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> are independent of <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-1c9cc40f96a1492e298e7da85a2c1692_l3.png" class="ql-img-inline-formula" alt="&#92;&#115;&#105;&#103;&#109;&#97;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/>, and knowing either <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-2b5c45836864531b8e37025dabadd24a_l3.png" class="ql-img-inline-formula" alt="&#92;&#108;&#97;&#109;&#98;&#100;&#97;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> or <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-461fe1a58a75801541487ddf10d32abd_l3.png" class="ql-img-inline-formula" alt="&#92;&#109;&#117;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> will directly give the value  the other.<br />
The solution of <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-1c9cc40f96a1492e298e7da85a2c1692_l3.png" class="ql-img-inline-formula" alt="&#92;&#115;&#105;&#103;&#109;&#97;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> can be found once both <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-2b5c45836864531b8e37025dabadd24a_l3.png" class="ql-img-inline-formula" alt="&#92;&#108;&#97;&#109;&#98;&#100;&#97;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> and <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-461fe1a58a75801541487ddf10d32abd_l3.png" class="ql-img-inline-formula" alt="&#92;&#109;&#117;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> are determined. To solve these equations it is thus sufficient to find either <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-2b5c45836864531b8e37025dabadd24a_l3.png" class="ql-img-inline-formula" alt="&#92;&#108;&#97;&#109;&#98;&#100;&#97;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> or <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-461fe1a58a75801541487ddf10d32abd_l3.png" class="ql-img-inline-formula" alt="&#92;&#109;&#117;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/>.<br />
Finding <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-461fe1a58a75801541487ddf10d32abd_l3.png" class="ql-img-inline-formula" alt="&#92;&#109;&#117;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> can be done by substituting the <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-2b5c45836864531b8e37025dabadd24a_l3.png" class="ql-img-inline-formula" alt="&#92;&#108;&#97;&#109;&#98;&#100;&#97;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> condition into the <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-461fe1a58a75801541487ddf10d32abd_l3.png" class="ql-img-inline-formula" alt="&#92;&#109;&#117;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/>.</p>
<p>First we change notation of the <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-461fe1a58a75801541487ddf10d32abd_l3.png" class="ql-img-inline-formula" alt="&#92;&#109;&#117;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> and <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-2b5c45836864531b8e37025dabadd24a_l3.png" class="ql-img-inline-formula" alt="&#92;&#108;&#97;&#109;&#98;&#100;&#97;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> condition using the same notation as before, i.e</p>
<p class="ql-center-displayed-equation" style="line-height: 287px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-a9b16aed1b77530b67e909e0f1ca29c2_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#83;&#95;&#120;&#32;&#38;&#61;&#92;&#115;&#117;&#109;&#95;&#123;&#105;&#61;&#49;&#125;&#94;&#123;&#110;&#125;&#32;&#83;&#95;&#123;&#105;&#45;&#49;&#125;&#92;&#92; &#83;&#95;&#121;&#32;&#38;&#61;&#92;&#115;&#117;&#109;&#95;&#123;&#105;&#61;&#49;&#125;&#94;&#123;&#110;&#125;&#32;&#83;&#95;&#105;&#32;&#92;&#92; &#83;&#95;&#123;&#120;&#120;&#125;&#32;&#38;&#61;&#92;&#115;&#117;&#109;&#95;&#123;&#105;&#61;&#49;&#125;&#94;&#123;&#110;&#125;&#32;&#83;&#95;&#123;&#105;&#45;&#49;&#125;&#94;&#50;&#92;&#92; &#83;&#95;&#123;&#120;&#121;&#125;&#32;&#38;&#61;&#92;&#115;&#117;&#109;&#95;&#123;&#105;&#61;&#49;&#125;&#94;&#123;&#110;&#125;&#32;&#83;&#95;&#123;&#105;&#45;&#49;&#125;&#32;&#83;&#95;&#105;&#92;&#92; &#83;&#95;&#123;&#121;&#121;&#125;&#32;&#38;&#61;&#92;&#115;&#117;&#109;&#95;&#123;&#105;&#61;&#49;&#125;&#94;&#123;&#110;&#125;&#32;&#83;&#95;&#105;&#94;&#50; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<p>which gives us:</p>
<p class="ql-center-displayed-equation" style="line-height: 94px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-710d5029c2ab8f206d901d600fbb358d_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#92;&#109;&#117;&#32;&#38;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#83;&#95;&#121;&#45;&#101;&#94;&#123;&#45;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#92;&#100;&#101;&#108;&#116;&#97;&#125;&#83;&#95;&#120;&#125;&#123;&#110;&#92;&#108;&#101;&#102;&#116;&#40;&#49;&#45;&#101;&#94;&#123;&#45;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#92;&#100;&#101;&#108;&#116;&#97;&#125;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#125;&#92;&#92; &#92;&#108;&#97;&#109;&#98;&#100;&#97;&#32;&#38;&#61;&#45;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#92;&#100;&#101;&#108;&#116;&#97;&#125;&#92;&#108;&#110;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#83;&#95;&#123;&#120;&#121;&#125;&#45;&#92;&#109;&#117;&#32;&#83;&#95;&#120;&#45;&#92;&#109;&#117;&#32;&#83;&#95;&#121;&#32;&#43;&#32;&#110;&#92;&#109;&#117;&#94;&#50;&#125;&#123;&#83;&#95;&#123;&#120;&#120;&#125;&#32;&#45;&#50;&#92;&#109;&#117;&#32;&#83;&#95;&#120;&#32;&#43;&#32;&#110;&#92;&#109;&#117;&#94;&#50;&#125; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<p>substituting <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-2b5c45836864531b8e37025dabadd24a_l3.png" class="ql-img-inline-formula" alt="&#92;&#108;&#97;&#109;&#98;&#100;&#97;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> into <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-461fe1a58a75801541487ddf10d32abd_l3.png" class="ql-img-inline-formula" alt="&#92;&#109;&#117;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> gives</p>
<p class="ql-center-displayed-equation" style="line-height: 70px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-0d157f7320bd9c9d82167e05bc6bf409_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#110;&#92;&#109;&#117;&#32;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#83;&#95;&#121;&#45;&#92;&#108;&#101;&#102;&#116;&#40;&#92;&#102;&#114;&#97;&#99;&#123;&#83;&#95;&#123;&#120;&#121;&#125;&#45;&#92;&#109;&#117;&#32;&#83;&#95;&#120;&#45;&#92;&#109;&#117;&#32;&#83;&#95;&#121;&#32;&#43;&#32;&#110;&#92;&#109;&#117;&#94;&#50;&#125;&#123;&#83;&#95;&#123;&#120;&#120;&#125;&#32;&#45;&#50;&#92;&#109;&#117;&#32;&#83;&#95;&#120;&#32;&#43;&#32;&#110;&#92;&#109;&#117;&#94;&#50;&#125;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#83;&#95;&#120;&#125;&#123;&#49;&#45;&#92;&#108;&#101;&#102;&#116;&#40;&#92;&#102;&#114;&#97;&#99;&#123;&#83;&#95;&#123;&#120;&#121;&#125;&#45;&#92;&#109;&#117;&#32;&#83;&#95;&#120;&#45;&#92;&#109;&#117;&#32;&#83;&#95;&#121;&#32;&#43;&#32;&#110;&#92;&#109;&#117;&#94;&#50;&#125;&#123;&#83;&#95;&#123;&#120;&#120;&#125;&#32;&#45;&#50;&#92;&#109;&#117;&#32;&#83;&#95;&#120;&#32;&#43;&#32;&#110;&#92;&#109;&#117;&#94;&#50;&#125;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#125; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<p>removing denominators</p>
<p class="ql-center-displayed-equation" style="line-height: 46px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-9cbe8895954f317b08d9f9fbbf8b5164_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#110;&#92;&#109;&#117;&#32;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#83;&#95;&#121;&#40;&#83;&#95;&#123;&#120;&#120;&#125;&#32;&#45;&#50;&#92;&#109;&#117;&#32;&#83;&#95;&#120;&#32;&#43;&#32;&#110;&#92;&#109;&#117;&#94;&#50;&#41;&#45;&#40;&#83;&#95;&#123;&#120;&#121;&#125;&#45;&#92;&#109;&#117;&#32;&#83;&#95;&#120;&#45;&#92;&#109;&#117;&#32;&#83;&#95;&#121;&#32;&#43;&#32;&#110;&#92;&#109;&#117;&#94;&#50;&#41;&#83;&#95;&#120;&#125;&#123;&#40;&#83;&#95;&#123;&#120;&#120;&#125;&#32;&#45;&#50;&#92;&#109;&#117;&#32;&#83;&#95;&#120;&#32;&#43;&#32;&#110;&#92;&#109;&#117;&#94;&#50;&#41;&#45;&#40;&#83;&#95;&#123;&#120;&#121;&#125;&#45;&#92;&#109;&#117;&#32;&#83;&#95;&#120;&#45;&#92;&#109;&#117;&#32;&#83;&#95;&#121;&#32;&#43;&#32;&#110;&#92;&#109;&#117;&#94;&#50;&#41;&#125; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<p>collecting terms</p>
<p class="ql-center-displayed-equation" style="line-height: 46px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-cff7654ac0b89cc6a1413cf9067b2b86_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#110;&#92;&#109;&#117;&#32;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#40;&#83;&#95;&#121;&#32;&#83;&#95;&#123;&#120;&#120;&#125;&#32;&#45;&#32;&#83;&#95;&#120;&#32;&#83;&#95;&#123;&#120;&#121;&#125;&#41;&#32;&#43;&#32;&#92;&#109;&#117;&#40;&#83;&#95;&#120;&#94;&#50;&#32;&#45;&#32;&#83;&#95;&#120;&#32;&#83;&#95;&#121;&#41;&#32;&#43;&#32;&#92;&#109;&#117;&#94;&#50;&#32;&#110;&#40;&#83;&#95;&#121;&#45;&#83;&#95;&#120;&#41;&#125;&#123;&#40;&#83;&#95;&#123;&#120;&#120;&#125;&#32;&#45;&#32;&#83;&#95;&#123;&#120;&#121;&#125;&#41;&#32;&#43;&#32;&#92;&#109;&#117;&#40;&#83;&#95;&#121;&#45;&#83;&#95;&#120;&#41;&#125; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<p>moving all <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-461fe1a58a75801541487ddf10d32abd_l3.png" class="ql-img-inline-formula" alt="&#92;&#109;&#117;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> to the left</p>
<p class="ql-center-displayed-equation" style="line-height: 22px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-4320d34a15364e0dacb9e1bc6f6391ea_l3.png"class="ql-img-displayed-equation" alt="&#92;&#91; &#110;&#92;&#109;&#117;&#40;&#83;&#95;&#123;&#120;&#120;&#125;&#45;&#83;&#95;&#123;&#120;&#121;&#125;&#41;&#32;&#45;&#32;&#92;&#109;&#117;&#40;&#83;&#95;&#120;&#94;&#50;&#32;&#45;&#32;&#83;&#95;&#120;&#32;&#83;&#95;&#121;&#41;&#32;&#61;&#83;&#95;&#121;&#32;&#83;&#95;&#123;&#120;&#120;&#125;&#32;&#45;&#32;&#83;&#95;&#120;&#32;&#83;&#95;&#123;&#120;&#121;&#125; &#92;&#93;" title="Rendered by QuickLaTeX.com"/></p>
<h3>Final results: The maximum likelihood equations</h3>
<p>mean:</p>
<p class="ql-center-displayed-equation" style="line-height: 42px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-1dae159965a33fda91b4fe5e7ed66d0f_l3.png"class="ql-img-displayed-equation" alt="&#92;&#91; &#92;&#109;&#117;&#32;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#83;&#95;&#121;&#32;&#83;&#95;&#123;&#120;&#120;&#125;&#32;&#45;&#32;&#83;&#95;&#120;&#32;&#83;&#95;&#123;&#120;&#121;&#125;&#125;&#123;&#110;&#40;&#83;&#95;&#123;&#120;&#120;&#125;&#45;&#83;&#95;&#123;&#120;&#121;&#125;&#41;&#32;&#45;&#32;&#40;&#83;&#95;&#120;&#94;&#50;&#32;&#45;&#32;&#83;&#95;&#120;&#32;&#83;&#95;&#121;&#41;&#125; &#92;&#93;" title="Rendered by QuickLaTeX.com"/></p>
<p>mean reversion rate:</p>
<p class="ql-center-displayed-equation" style="line-height: 44px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-738142993314f2930999b6995100c8aa_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#92;&#108;&#97;&#109;&#98;&#100;&#97;&#32;&#61;&#32;&#45;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#92;&#100;&#101;&#108;&#116;&#97;&#125;&#92;&#108;&#110;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#83;&#95;&#123;&#120;&#121;&#125;&#45;&#92;&#109;&#117;&#32;&#83;&#95;&#120;&#45;&#92;&#109;&#117;&#32;&#83;&#95;&#121;&#32;&#43;&#32;&#110;&#92;&#109;&#117;&#94;&#50;&#125;&#123;&#83;&#95;&#123;&#120;&#120;&#125;&#32;&#45;&#50;&#92;&#109;&#117;&#32;&#83;&#95;&#120;&#32;&#43;&#32;&#110;&#92;&#109;&#117;&#94;&#50;&#125; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<p>variance:</p>
<p class="ql-center-displayed-equation" style="line-height: 108px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-90c183835045cf82ca5638fabbfa6c6c_l3.png"class="ql-img-displayed-equation" alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#92;&#104;&#97;&#116;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#125;&#94;&#50;&#61;&#38;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#110;&#125;&#32;&#91;&#32;&#83;&#95;&#123;&#121;&#121;&#125;&#32;&#45;&#32;&#50;&#92;&#97;&#108;&#112;&#104;&#97;&#32;&#83;&#95;&#123;&#120;&#121;&#125;&#32;&#43;&#32;&#92;&#97;&#108;&#112;&#104;&#97;&#94;&#50;&#32;&#83;&#95;&#123;&#120;&#120;&#125;&#32;&#92;&#92; &#38;&#32;&#45;&#50;&#32;&#92;&#109;&#117;&#32;&#40;&#49;&#45;&#92;&#97;&#108;&#112;&#104;&#97;&#41;&#32;&#32;&#40;&#83;&#95;&#121;&#32;&#45;&#32;&#92;&#97;&#108;&#112;&#104;&#97;&#32;&#83;&#95;&#120;&#41;&#32;&#43;&#110;&#32;&#92;&#109;&#117;&#94;&#50;&#32;&#40;&#49;&#45;&#92;&#97;&#108;&#112;&#104;&#97;&#41;&#94;&#50;&#32;&#93;&#92;&#92; &#92;&#115;&#105;&#103;&#109;&#97;&#94;&#50;&#61;&#38;&#32;&#92;&#104;&#97;&#116;&#123;&#92;&#115;&#105;&#103;&#109;&#97;&#125;&#94;&#50;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#50;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#125;&#123;&#49;&#45;&#92;&#97;&#108;&#112;&#104;&#97;&#94;&#50;&#125; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<p>with <img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-e0f2bed4357008a1d6aba83b7a05d7f0_l3.png" class="ql-img-inline-formula" alt="&#92;&#97;&#108;&#112;&#104;&#97;&#32;&#61;&#101;&#94;&#123;&#45;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#92;&#100;&#101;&#108;&#116;&#97;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/></p>
<h3>Example</h3>
<p>Calculating the sums based on table 1 we get</p>
<table class="matrix">
<tbody>
<tr>
<th>Param</th>
<th>Value</th>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-f2286baa7c6a1ee9a38654505b0643e5_l3.png" class="ql-img-inline-formula" alt="&#83;&#95;&#120;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/></td>
<td>22.5301</td>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-770e27a2ae8031e0e7f72671d5973379_l3.png" class="ql-img-inline-formula" alt="&#83;&#95;&#121;" title="Rendered by QuickLaTeX.com" style="vertical-align: -6px;"/></td>
<td>20.1534</td>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-6bb39e217b2ef21a294456bc50f67bca_l3.png" class="ql-img-inline-formula" alt="&#83;&#95;&#123;&#120;&#120;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/></td>
<td>30.8338</td>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-88fe6ff50b8cedfbcb7b2fdd7c8a7d4c_l3.png" class="ql-img-inline-formula" alt="&#83;&#95;&#123;&#120;&#121;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -6px;"/></td>
<td>25.1973</td>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-d949774f1ce2bf799b695c36ebba93d8_l3.png" class="ql-img-inline-formula" alt="&#83;&#95;&#123;&#121;&#121;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -6px;"/></td>
<td>22.2222</td>
</tr>
</tbody>
</table>
<p>These results allow us to recover the model parameters:</p>
<table class="matrix">
<tbody>
<tr>
<th>Param</th>
<th>Value</th>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-461fe1a58a75801541487ddf10d32abd_l3.png" class="ql-img-inline-formula" alt="&#92;&#109;&#117;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/></td>
<td>0.9075</td>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-2b5c45836864531b8e37025dabadd24a_l3.png" class="ql-img-inline-formula" alt="&#92;&#108;&#97;&#109;&#98;&#100;&#97;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/></td>
<td>3.1288</td>
</tr>
<tr>
<td><img src="http://www.sitmo.com/wp-content/ql-cache/quicklatex.com-1c9cc40f96a1492e298e7da85a2c1692_l3.png" class="ql-img-inline-formula" alt="&#92;&#115;&#105;&#103;&#109;&#97;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/></td>
<td>0.5532</td>
</tr>
</tbody>
</table>
<h2>Matlab Code</h2>
<h3>Least Squares Calibration</h3>

<div class="wp_syntax"><div class="code"><pre class="m" style="font-family:monospace;">function [mu,sigma,lambda] = OU_Calibrate_LS(S,delta)
  n = length(S)-1;
&nbsp;
  Sx  = sum( S(1:end-1) );
  Sy  = sum( S(2:end) );
  Sxx = sum( S(1:end-1).^2 );
  Sxy = sum( S(1:end-1).*S(2:end) );
  Syy = sum( S(2:end).^2 );
&nbsp;
  a  = ( n*Sxy - Sx*Sy ) / ( n*Sxx -Sx^2 );
  b  = ( Sy - a*Sx ) / n;
  sd = sqrt( (n*Syy - Sy^2 - a*(n*Sxy - Sx*Sy) )/n/(n-2) );
&nbsp;
  lambda = -log(a)/delta;
  mu     = b/(1-a);
  sigma  =  sd * sqrt( -2*log(a)/delta/(1-a^2) );
end</pre></div></div>

<h3>Maximum Likelyhood Calibration</h3>

<div class="wp_syntax"><div class="code"><pre class="m" style="font-family:monospace;">function [mu,sigma,lambda] = OU_Calibrate_ML(S,delta)
  n = length(S)-1;
&nbsp;
  Sx  = sum( S(1:end-1) );
  Sy  = sum( S(2:end) );
  Sxx = sum( S(1:end-1).^2 );
  Sxy = sum( S(1:end-1).*S(2:end) );
  Syy = sum( S(2:end).^2 );
&nbsp;
  mu  = (Sy*Sxx - Sx*Sxy) / ( n*(Sxx - Sxy) - (Sx^2 - Sx*Sy) );
  lambda = -log( (Sxy - mu*Sx - mu*Sy + n*mu^2) / (Sxx -2*mu*Sx + n*mu^2) ) / delta;
  a = exp(-lambda*delta);
  sigmah2 = (Syy - 2*a*Sxy + a^2*Sxx - 2*mu*(1-a)*(Sy - a*Sx) + n*mu^2*(1-a)^2)/n;
  sigma = sqrt(sigmah2*2*lambda/(1-a^2));
end</pre></div></div>

<h3>Example Usage</h3>

<div class="wp_syntax"><div class="code"><pre class="m" style="font-family:monospace;">S = [ 3.0000 1.7600 1.2693 1.1960 0.9468 0.9532 0.6252 ...
      0.8604 1.0984 1.4310 1.3019 1.4005 1.2686 0.7147 ...
      0.9237 0.7297 0.7105 0.8683 0.7406 0.7314 0.6232 ];
&nbsp;
delta = 0.25;
&nbsp;
[mu1, sigma1, lambda1] = OU_Calibrate_LS(S,delta)
[mu2, sigma2, lambda2] = OU_Calibrate_ML(S,delta)</pre></div></div>

<p>gives</p>

<div class="wp_syntax"><div class="code"><pre class="m" style="font-family:monospace;">mu1     = 0.90748788828331
sigma1  = 0.58307607458526
lambda1 = 3.12873217812387
&nbsp;
mu2     = 0.90748788828331
sigma2  = 0.55315453345189
lambda2 = 3.12873217812386</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.sitmo.com/article/calibrating-the-ornstein-uhlenbeck-model/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>Outgrowing Excel: Moving to the Cloud</title>
		<link>http://www.sitmo.com/article/from-excel-to-a-database/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=from-excel-to-a-database</link>
		<comments>http://www.sitmo.com/article/from-excel-to-a-database/#comments</comments>
		<pubDate>Sun, 19 Dec 2010 23:43:41 +0000</pubDate>
		<dc:creator>Thijs van den Berg</dc:creator>
				<category><![CDATA[Client Projects]]></category>

		<guid isPermaLink="false">http://www.sitmo.com/?p=62</guid>
		<description><![CDATA[A client has been building some very useful Excel based tools for corporates. For their next release, we have been helping then move the data that is currently stored in Excel to a proper database. There are various reasons for doing so: Centralized storage, allowing for structured backup and replication Multiuser environment, allowing for roles, [...]]]></description>
			<content:encoded><![CDATA[<p>A client has been building some very useful Excel based tools for corporates. For their next release, we have been helping then move the data that is currently stored in Excel to a proper database.<br />
<span id="more-62"></span></p>
<p>There are various reasons for doing so:</p>
<ul>
<li>Centralized storage, allowing for structured backup and replication</li>
<li>Multiuser environment, allowing for roles, and authentication</li>
</ul>
<p>The project involves designed database the structure, make it portable for a MySQL, MSSQL or Oracle backend, and convert VBA code inside Excel to code that connects to databases.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sitmo.com/article/from-excel-to-a-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Energy trading in Farming: Risk Management and Optimization</title>
		<link>http://www.sitmo.com/article/chp-operation-risk-management-and-optimization/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=chp-operation-risk-management-and-optimization</link>
		<comments>http://www.sitmo.com/article/chp-operation-risk-management-and-optimization/#comments</comments>
		<pubDate>Sun, 19 Dec 2010 23:08:51 +0000</pubDate>
		<dc:creator>Thijs van den Berg</dc:creator>
				<category><![CDATA[Client Projects]]></category>
		<category><![CDATA[Energy]]></category>

		<guid isPermaLink="false">http://www.sitmo.com/?p=52</guid>
		<description><![CDATA[Together with Maarten van der Kloot Meijburg, we have looked into the risk and trading behavior of farmers who own a CHP (combined heat power cogeneration). A lot of farmers own CHP&#8217;s, and that makes sense -they can use most of their outputs -power, heat, CO2- to grow their crops.]]></description>
			<content:encoded><![CDATA[<p>Together with <a href="http://www.mkmconsultancy.nl/">Maarten van der Kloot Meijburg</a>, we have looked into the risk and trading behavior of farmers who own a CHP (combined heat power cogeneration).<br />
A lot of farmers own CHP&#8217;s, and that makes sense -they can use most of their outputs -power, heat, CO2- to grow their crops.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sitmo.com/article/chp-operation-risk-management-and-optimization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Analysis of Renewable Regulatory Exposure</title>
		<link>http://www.sitmo.com/article/renewable-subsidy-exposure/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=renewable-subsidy-exposure</link>
		<comments>http://www.sitmo.com/article/renewable-subsidy-exposure/#comments</comments>
		<pubDate>Sun, 19 Dec 2010 22:40:03 +0000</pubDate>
		<dc:creator>Thijs van den Berg</dc:creator>
				<category><![CDATA[Client Projects]]></category>
		<category><![CDATA[Energy]]></category>

		<guid isPermaLink="false">http://www.sitmo.com/?p=43</guid>
		<description><![CDATA[I have completed a consultancy project that I did together with SQ consult for a large West-European energy utility. An interesting project, with interesting results! The goal of the project was to model the financial and strategic effects of 5 different (national and European) renewable energy regulatory scenariose on its portfolio. This model looked into [...]]]></description>
			<content:encoded><![CDATA[<p>I have completed a consultancy project that I did together with <a href="http://www.sqconsult.com/">SQ consult</a> for a large West-European energy utility. An interesting project, with interesting results!</p>
<p>The goal of the project was to model the financial and strategic effects of 5 different (national and European) renewable energy regulatory scenariose on its portfolio.</p>
<p>This model looked into the entire value chain (upstream, trading and sales), analysing the risks for the grey portfolio, existing green installations and new asset development with a specific focus on possible movements within the national merit order.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sitmo.com/article/renewable-subsidy-exposure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

